:root {
  --ink: #1c334f;
  --muted: #647387;
  --line: #dbe3eb;
  --accent: #244f79;
  --paper: #f2f5f8;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size: 16px;
}

p {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  color: #000000;
  line-height: calc(1ex / 0.42);
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.site-header {
  background: var(--ink);
  color: white;
  padding: 22px 28px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 4px solid #dba54b;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: .15em;
  font-weight: 650;
}

.site-header .eyebrow {
  color: #c5d3e3;
}

h1 {
  font-family: Bitter,serif;
  font-size: 36px;
  margin: 3px 0 0;
  font-weight: 400;
  letter-spacing: -.025em;
}

.header-caption {
  text-align: right;
  font-size: 15px;
  line-height: 1.7;
}

.header-caption span {
  color: #b8c8da;
  font-size: 14px;
}

h2 {
  font-size: 18px;
  font-weight: 650;
  margin: 0;
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 10px 3px;
  text-align: center !important;
}

.stats-bar>div:not(.stats-note),.stat-button {
  display: flex;
  flex-direction: column;
}

.stats-bar strong {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.2;
}

.stats-bar span {
  font-size: 14px;
  color: var(--muted);
}

.stat-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 0;
  border-bottom: 1px dashed #8b99aa;
}

.stat-button:hover {
  color: #996211;
}

.stats-note {
  margin-left: auto;
  text-align: right;
  font-size: 14px;
}

.stats-note span {
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: 285px minmax(0,1fr);
  gap: 16px;
  align-items: stretch;
}

.filter-panel,.map-section,.results-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}

.filter-panel {
  padding: 18px;
  max-height: 690px;
  overflow: auto;
}

.filter-panel h2 {
  font-size: 16px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-control,.form-select {
  font-size: 14px;
  min-height: 38px;
  border-color: #cbd6e0;
}

.form-control:focus,.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #244f7920;
}

.btn-primary {
  --bs-btn-bg: #244f79;
  --bs-btn-border-color: #244f79;
  --bs-btn-hover-bg: #1c3b5b;
  --bs-btn-hover-border-color: #1c3b5b;
}

.btn-outline-primary {
  --bs-btn-color: #244f79;
  --bs-btn-border-color: #244f79;
  --bs-btn-hover-bg: #244f79;
  --bs-btn-hover-border-color: #244f79;
}

.btn-link {
  color: var(--accent);
  text-decoration: none;
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(6,1fr);
  gap: 5px;
}

.letter-button {
  white-space: nowrap;
  background: #fff;
  border: 1px solid #d5dfe8;
  border-bottom: 4px solid var(--letter);
  border-radius: 5px;
  min-height: 36px;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  padding: 4px 2px;
}

.letter-button[aria-pressed=true] {
  background: var(--letter);
  color: white;
  border-color: var(--letter);
  box-shadow: inset 0 0 0 2px #ffffff99;
}

.letter-button:hover {
  outline: 2px solid var(--letter);
  outline-offset: 1px;
}

.letter-button.blank {
  grid-column: span 2;
}

.filter-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0;
}

.advanced {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.advanced summary {
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.advanced summary span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 15px;
}

.filter-footer {
  font-size: 12px;
  color: var(--muted);
  padding-top: 16px;
}

.map-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 15px 18px;
}

.map-toolbar h2 {
  font-family: Bitter,serif;
  font-size: 21px;
  font-weight: 400;
}

.map-toolbar>div>span {
  font-size: 13px;
  color: var(--muted);
}

.form-check-label {
  font-size: 14px;
}

.map-wrap {
  position: relative;
  min-height: 465px;
  flex: 1;
  background: #e2e8ee;
}

.map-wrap #map {
  height: 100%;
  width: 100%;
  min-height: 465px;
  position: absolute;
  inset: 0;
}

.map-key {
  position: absolute;
  bottom: 33px;
  left: 12px;
  right: auto;
  background: #fffffff2;
  border: 1px solid #d9e1e7;
  border-radius: 5px;
  padding: 7px 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  box-shadow: 0 1px 6px #172d4310;
}

.key-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--ink);
  border-radius: 50%;
}

.key-gradient {
  display: inline-block;
  width: 32px;
  height: 12px;
  margin-left: 9px;
  border-radius: 8px;
  background: linear-gradient(90deg,#7f98bc16,#4c73a1);
}

.map-foot {
  padding: 10px 15px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  	display: none;
}

.map-foot a,.page-footer a {
  color: #526d8c;
}

.map-notice {
  position: absolute;
  inset: 35% 15% auto;
  background: #fffffff5;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 20px;
  text-align: center;
  pointer-events: none;
}

.map-error {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 50px;
  background: #fff4d8;
  padding: 8px 12px;
  border: 1px solid #e6c77e;
  font-size: 14px;
  border-radius: 4px;
}

.results-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 15px;
  align-items: center;
}

.results-heading .eyebrow {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}

.results-heading h2 {
  font-family: Bitter,serif;
  font-size: 23px;
  font-weight: 400;
}

.results-heading p {
  font-size: 14px;
  color: var(--muted);
  margin: 5px 0 0;
}

.results-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.threshold {
  width: 110px;
}

.table-prompt {
  border-top: 1px solid var(--line);
  padding: 10px;
  text-align: center;
  background: #fbfcfd;
}

.table-prompt p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 15px;
}

.table-prompt>span {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

thead {
  background: #f2f5f8;
}

thead th {
  padding: 10px 13px!important;
  white-space: nowrap;
  font-size: 13px;
  background: #f2f5f8!important;
}

thead button {
  border: 0;
  background: transparent;
  font-weight: 650;
  padding: 0;
  color: var(--ink);
}

tbody td {
  font-size: 14px;
  padding: 12px 13px!important;
  color: #334a63!important;
}

tbody tr.selected td {
  background: #eaf1f8;
}

td.description {
  min-width: 250px;
  max-width: 560px;
}

td.nowrap {
  white-space: nowrap;
}

.card-link {
  border: 0;
  background: none;
  text-align: left;
  color: #1d568a;
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.letter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.letter-tag .photo-available {
  display: inline-block;
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 1px;
  background: #198754;
  border: 1px solid #146c43;
}

[data-bs-theme=dark] .letter-tag .photo-available {
  background: #4ade80;
  border-color: #86efac;
}

.location-status {
  font-size: 11px;
  color: #916529;
  display: block;
}

.pagination-bar {
  border-top: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.page-footer {
  padding: 18px 2px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

dialog {
  width: min(520px,calc(100vw - 28px));
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 20px 100px #11233955;
  color: var(--ink);
}

dialog::backdrop {
  background: #10253dc0;
}

.detail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.placeholder-image {
  height: 170px;
  background: repeating-linear-gradient(135deg,#eef2f6,#eef2f6 12px,#f5f7f9 12px,#f5f7f9 24px);
  border: 1px solid #d9e1e9;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  color: #657a90;
  margin-bottom: 20px;
  font-size: 14px;
}

dialog h2 {
  font-family: Bitter,serif;
  font-size: 28px;
  margin-bottom: 6px;
}

.detail-location {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  font-size: 14px;
}

dt {
  font-weight: 600;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.maplibregl-popup-content {
  font-family: system-ui,sans-serif;
  font-size: 14px;
  max-width: 280px;
  padding: 14px;
}

.maplibregl-popup-content p {
  margin: 5px 0 10px;
}

.maplibregl-popup-content h3 {
  font-size: 17px;
  padding-right: 15px;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 8px;
  z-index: 1000;
  background: white;
  padding: 10px;
}

.skip-link:focus {
  top: 8px;
}

button:focus-visible,summary:focus-visible,a:focus-visible {
  outline: 3px solid #d39729;
  outline-offset: 3px;
}

[hidden] {
  display: none!important;
}

@media(min-width:1450px) {
  .map-wrap,.map-wrap #map {
    min-height: 560px;
  }

  .filter-panel {
    max-height: 780px;
  }

  .workspace {
    grid-template-columns: 300px minmax(0,1fr);
  }

}

@media(max-width:900px) {
  .workspace {
    grid-template-columns: 245px minmax(0,1fr);
  }

  .filter-panel {
    padding: 14px;
  }

  .stats-bar {
    gap: 18px;
  }

  .stats-note {
    display: none;
  }

  .map-toolbar {
    flex-wrap: wrap;
  }

  .map-key {
    font-size: 11px;
    gap: 4px;
    left: 6px;
    padding: 6px;
  }

  .map-foot {
    display: block;
  }

  .map-foot a {
    display: block;
    margin-top: 4px;
  }

  .results-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .results-actions {
    justify-content: flex-start;
  }

  .page-footer {
    flex-direction: column;
  }

  .header-caption {
    display: none;
  }

}

@media(max-width:650px) {
  .site-header {
    padding: 17px 18px;
  }

  h1 {
    font-size: 31px;
  }

  .site-header .eyebrow {
    font-size: 10px;
  }

  .stats-bar {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 8px;
    padding: 10px 0;
  }

  .stats-bar strong {
    font-size: 21px;
  }

  .stats-bar span {
    font-size: 11px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .filter-panel {
    max-height: 350px;
  }

  .letter-grid {
    grid-template-columns: repeat(10,1fr);
  }

  .letter-button {
    min-height: 34px;
  }

  .map-wrap,.map-wrap #map {
    min-height: 390px;
  }

  .map-toolbar h2 {
    font-size: 20px;
  }

  .map-key {
    max-width: calc(100% - 12px);
    flex-wrap: wrap;
  }

  .results-heading {
    padding: 15px;
  }

  .results-actions .small {
    font-size: 12px;
  }

  .results-actions {
    gap: 7px;
  }

  .table-prompt {
    padding: 8px 8px;
  }

  dl {
    grid-template-columns: 110px 1fr;
  }

  .pagination-bar {
    padding: 12px;
  }

  .form-control,.form-select {
    font-size: 16px;
  }

  .threshold {
    font-size: 14px;
  }

  .filter-panel .form-label {
    font-size: 14px;
  }

}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-actions .btn {
  white-space: nowrap;
}

.map-view {
  width: 170px;
  min-height: 32px;
}

.map-toolbar {
  flex-wrap: wrap;
}

[data-bs-theme=dark] {
  color-scheme: dark;
  --ink: #e2eaf4;
  --muted: #a3b2c5;
  --line: #304153;
  --accent: #90bfe9;
  --paper: #0c141e;
  --bs-body-bg: #15212f;
  --bs-body-color: #e2eaf4;
  --bs-secondary-color: #a3b2c5;
}

[data-bs-theme=dark] .site-header {
  background: #111f30;
  border-bottom-color: #a87c3d;
}

[data-bs-theme=dark] .filter-panel,[data-bs-theme=dark] .map-section,[data-bs-theme=dark] .results-panel,[data-bs-theme=dark] dialog {
  background: #15212f;
}

[data-bs-theme=dark] .form-control,[data-bs-theme=dark] .form-select {
  background-color: #161616;
  border-color: #595959;
  color: #e2eaf4;
}

[data-bs-theme=dark] .form-control::placeholder {
  color: #91a0b2;
}

[data-bs-theme=dark] .letter-button {
  background: #1b2b3d;
  color: #e2eaf4;
  border-top-color: #415066;
  border-left-color: #415066;
  border-right-color: #415066;
}

[data-bs-theme=dark] .letter-button[aria-pressed=true] {
  background: var(--letter);
  color: white;
  border-color: var(--letter);
}

[data-bs-theme=dark] .btn-outline-secondary {
  --bs-btn-color: #b6c5d7;
  --bs-btn-border-color: #617287;
  --bs-btn-hover-bg: #34495f;
  --bs-btn-hover-border-color: #8aa3be;
}

[data-bs-theme=dark] .btn-outline-primary {
  --bs-btn-color: #9dcefa;
  --bs-btn-border-color: #5c8fb9;
  --bs-btn-hover-bg: #275274;
}

[data-bs-theme=dark] .btn-primary {
  --bs-btn-bg: #2f6592;
  --bs-btn-border-color: #407fb0;
  --bs-btn-hover-bg: #3e7eaf;
}

[data-bs-theme=dark] .table-prompt,[data-bs-theme=dark] thead,[data-bs-theme=dark] thead th {
  background: #101010!important;
}

[data-bs-theme=dark] tbody td {
  color: #d0deee!important;
  background: #15212f;
}

[data-bs-theme=dark] tbody tr:hover td,[data-bs-theme=dark] tbody tr.selected td {
  background: #253c53;
}

[data-bs-theme=dark] .card-link {
  color: #9bcafa;
}

[data-bs-theme=dark] .location-status {
  color: #d4b178;
}

[data-bs-theme=dark] .map-wrap {
  background: #101923;
}

[data-bs-theme=dark] .map-key,[data-bs-theme=dark] .map-notice {
  background: #132233f2;
  color: #d4e0ef;
  border-color: #3a4e66;
}

[data-bs-theme=dark] .map-error {
  background: #46361f;
  color: #f3dfb1;
  border-color: #8f7246;
}

[data-bs-theme=dark] .map-foot a,[data-bs-theme=dark] .page-footer a {
  color: #9fbad8;
}

[data-bs-theme=dark] .placeholder-image {
  background: repeating-linear-gradient(135deg,#1a2b3c,#1a2b3c 12px,#182635 12px,#182635 24px);
  border-color: #3a5068;
  color: #afc1d7;
}

[data-bs-theme=dark] .duplicate-image-warning {
  background: #3b2d12;
  border-color: #8f6b25;
  color: #ffe3a3;
}

[data-bs-theme=dark] .maplibregl-popup-content {
  background: #17293c;
  color: #e2eaf4;
  border: 1px solid #425e7b;
}

[data-bs-theme=dark] .maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
  border-top-color: #17293c;
}

[data-bs-theme=dark] .maplibregl-popup-anchor-top .maplibregl-popup-tip {
  border-bottom-color: #17293c;
}

[data-bs-theme=dark] .maplibregl-popup-close-button {
  color: #e2eaf4;
}

[data-bs-theme=dark] .maplibregl-ctrl-group,[data-bs-theme=dark] .maplibregl-ctrl-attrib {
  background: #162537;
  color: #d0deee;
}

[data-bs-theme=dark] .maplibregl-ctrl-attrib a {
  color: #d0deee;
}

[data-bs-theme=dark] .maplibregl-ctrl-icon {
  filter: invert(1);
}

[data-bs-theme=dark] .maplibregl-ctrl-scale {
  background: #162537cc;
  border-color: #9bafc5;
  color: #d0deee;
}

[data-bs-theme=dark] .maplibregl-ctrl-attrib-button {
  filter: invert(1);
}

@media(max-width:650px) {
  .site-header {
    gap: 10px;
  }

  .site-header .eyebrow {
    max-width: 225px;
  }

  .header-actions {
    gap: 0;
  }

  .header-actions .btn {
    font-size: 12px;
    padding: 6px 8px;
  }

  .map-view {
    font-size: 14px;
    width: 162px;
  }

}

.detail-images {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(220px,100%),1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.detail-image-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #0d1722;
  cursor: zoom-in;
}

.detail-image-link img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 52vh;
  object-fit: contain;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  width: fit-content;
  max-width: calc(100vw - 48px);
  height: fit-content;
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 9px;
  overflow: visible;
  background: transparent;
  box-shadow: 0 20px 100px #000b;
}

.image-lightbox::backdrop {
  background: #06111be8;
}

.image-lightbox img {
  display: block;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  width: auto;
  height: auto;
  border-radius: 9px;
  object-fit: contain;
  background: #0a1118;
}

.image-lightbox-close {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border: 1px solid #ffffff75;
  border-radius: 50%;
  background: #07111dcc;
  color: #fff;
  font-size: 29px;
  line-height: 31px;
  cursor: pointer;
  box-shadow: 0 2px 10px #0008;
}

.image-lightbox-close:hover {
  background: #000;
}

.duplicate-image-warning {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: -2px 0 18px;
  padding: 10px 12px;
  border: 1px solid #d8a640;
  border-radius: 7px;
  background: #fff4d6;
  color: #624812;
  font-size: 13px;
  line-height: 1.35;
}

.duplicate-warning-icon {
  font-size: 20px;
  line-height: 1;
}

[data-bs-theme=dark] .duplicate-image-warning {
  background: #3b2d12;
  border-color: #8f6b25;
  color: #ffe3a3;
}

[data-bs-theme=dark] .image-lightbox {
  background: transparent;
}

.maplibregl-popup-content p {
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  color: inherit;
}

/* Keep shared site styles and mobile dialog sizing consistent. */
body.catalog-page,body.catalog-page.dark-mode {
  background: #3c4959!important;
  color: var(--ink);
  line-height: 1.3;
}

body.catalog-page main p,body.catalog-page dialog p {
  font-family: inherit;
  font-weight: 400;
  line-height: 1.3;
  color: #cfcfcf;
}

body.catalog-page main h2,body.catalog-page dialog h2 {
  color: var(--ink);
}

html[data-bs-theme=light] {
  color-scheme: light;
}

#cardDialog {
  box-sizing: border-box;
  width: 520px;
  max-width: calc(100% - 24px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  margin: auto;
}

#cardDialog .detail-images {
  grid-template-columns: minmax(0,1fr);
  min-width: 0;
  max-width: 100%;
}

#cardDialog .detail-image-link {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

#cardDialog .detail-image-link img {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  height: auto;
  max-height: 52vh;
  max-height: 52dvh;
  object-fit: contain;
}

#cardDialog dl {
  grid-template-columns: 110px minmax(0,1fr);
}

#imageDialog {
  box-sizing: border-box;
  width: calc(100% - 24px);
  max-width: 1000px;
  height: fit-content;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

#expandedImage {
  box-sizing: border-box;
  display: block;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  object-fit: contain;
}

@media(max-width:650px) {
  #cardDialog {
    padding: 16px;
  }

  .letter-grid {
    grid-template-columns: repeat(6,minmax(0,1fr));
  }

  .workspace>* {
    min-width: 0;
    max-width: 100%;
  }

  .map-toolbar>div {
    min-width: 0;
    max-width: 100%;
  }

  .stats-bar>div,.stat-button {
    min-width: 0;
  }

  .results-actions {
    max-width: 100%;
  }

  .pagination-bar {
    gap: 8px;
    flex-wrap: wrap;
  }

}

/* Keep unresolved statistics secondary without disabling their filter. */
.stats-bar #unresolvedShortcut,.stats-bar #unresolvedShortcut strong,.stats-bar #unresolvedShortcut span {
  color: var(--muted);
}

@media(max-width:650px) {
  .stats-bar {
    grid-template-columns: repeat(3,minmax(0,1fr));
    row-gap: 14px;
  }

}

.map-expanded,:fullscreen {
  background: var(--bs-body-bg,#101923);
}

.map-expanded {
  position: fixed!important;
  inset: 0!important;
  z-index: 10000!important;
  width: 100vw!important;
  height: 100dvh!important;
  border-radius: 0!important;
}

.map-expanded-open {
  overflow: hidden;
}

.map-expanded,.map-section:fullscreen {
  display: flex;
  flex-direction: column;
}

.map-expanded .map-wrap,:fullscreen .map-wrap {
  flex: 1;
  min-height: 0!important;
}

.map-expanded #map,:fullscreen #map {
  height: 100%!important;
  min-height: 0!important;
}

/* Catalog navigation and introductory content. */
.reset-button {
  flex: 0 0 auto;
  background: #dba54b!important;
  border-color: #dba54b!important;
  color: #17293c!important;
  font-weight: 750;
  box-shadow: 0 2px 7px #0002;
}

.reset-button:hover,.reset-button:focus-visible {
background: #0d6efd !important;
    border-color: #244f79 !important;
    color: #ffffff !important;
}

.catalog-intro {
  margin: 10px 0 4px;
  padding: 18px 20px;
  border: 2px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease,background-color .16s ease,box-shadow .16s ease;
}

.catalog-intro:hover {
  border-color: color-mix(in srgb,var(--line) 55%,var(--accent) 45%);
  box-shadow: 0 4px 14px #00000012;
}

.catalog-intro:focus-visible {
  outline: 3px solid color-mix(in srgb,var(--accent) 70%,transparent);
  outline-offset: 3px;
}

.catalog-intro h2 {
  font-family: Bitter;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 7px;
}

.catalog-intro-summary p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.55;
}

.catalog-intro-more {
  display: inline;
  margin: 0 0 0 .22em;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b1b9c1 !important;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.catalog-intro-more:hover,.catalog-intro-more:focus-visible {
  color: color-mix(in srgb,var(--accent) 78%,white 22%);
  text-decoration: none;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9998;
  width: 48px;
  height: 48px;
  border: 1px solid #ffffff66;
  border-radius: 50%;
  background: #bf8336;
  color: #fff;
  font: 700 27px/1 system-ui;
  box-shadow: 0 5px 18px #0007;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease,transform .18s ease,background .18s ease;
}

.back-to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.back-to-top:hover,.back-to-top:focus-visible {
  background: #dba54b;
  color: #17293c;
}

.catalog-intro-dialog {
  box-sizing: border-box;
  width: min(1120px,calc(100vw - 56px));
  max-width: none;
  height: min(88dvh,900px);
  max-height: calc(100dvh - 56px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  overflow: auto;
  box-shadow: 0 24px 80px #000b;
}

.catalog-intro-dialog[open] {
  animation: catalog-intro-open .24s cubic-bezier(.2,.78,.25,1) both;
}

.catalog-intro-dialog::backdrop {
  background: #06111bb8;
  backdrop-filter: blur(2px);
  animation: catalog-intro-backdrop .2s ease-out both;
}

@keyframes catalog-intro-open {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.975);
  }

  to {
    opacity: 1;
    transform: none;
  }

}

@keyframes catalog-intro-backdrop {
  from {
    background: #06111b00;
    backdrop-filter: blur(0);
  }

  to {
    background: #06111bb8;
    backdrop-filter: blur(2px);
  }

}

.catalog-intro-dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 24px clamp(20px,5vw,76px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.catalog-intro-dialog-header h2 {
  font-family: Bitter,serif;
  font-size: clamp(28px,4vw,46px);
  font-weight: 400;
  margin: 3px 0 0;
}

.catalog-intro-dialog-header .btn-close {
  flex: 0 0 auto;
  margin-top: 8px;
}
 
.catalog-intro-dialog-body {
  width: min(880px,calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(30px,6vw,80px) 0 100px;
  font-size: 18px;
  line-height: 1.7;
}

.catalog-intro-dialog-body h3 {
  font: 400 28px/1.3 Bitter,serif;
  margin: 38px 0 12px;
}

[data-bs-theme=dark] .catalog-intro,[data-bs-theme=dark] .catalog-intro-dialog,[data-bs-theme=dark] .catalog-intro-dialog-header {
  background: #161616;
  border-color: #62676d;
}

[data-bs-theme=dark] .catalog-intro-more {
  color: #a9d5ff;
}

[data-bs-theme=dark] .catalog-intro-dialog .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Give the collection introduction more room on desktop. */
@media (min-width: 651px) {
  .catalog-intro-dialog {
    width: 79vw;
    height: 88dvh;
  }

  .catalog-intro-dialog-header {
    padding: 16px 24px;
  }

  .catalog-intro-dialog-body {
    width: auto;
    margin: 0;
    padding: 24px;
  }
}

@media(max-width:650px) {
  .catalog-intro {
    padding: 15px 16px;
  }

  .catalog-intro h2 {
    font-size: 21px;
  }

  .reset-button {
    font-size: 12px;
    padding: 6px 8px;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
  }

  .catalog-intro-dialog {
    width: calc(100vw - 24px);
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 11px;
  }

  .catalog-intro-dialog-header {
    padding: 18px;
  }

  .catalog-intro-dialog-body {
    width: calc(100% - 36px);
    padding-top: 28px;
    font-size: 16px;
  }

}

@media(prefers-reduced-motion:reduce) {
  .catalog-intro-dialog[open],.catalog-intro-dialog::backdrop {
    animation: none;
  }

  .catalog-intro {
    transition: none;
  }

}

/* Compact controls remain within the map region. */
.workspace {
  display: block;
}

.map-section {
  --control-surface: #fff;
  --number-color: #156abc;
}

.map-wrap,.map-wrap #map {
  min-height: 640px;
}

.map-wrap {
  --dock-height: 160px;
}

[data-bs-theme=dark] .map-section {
  --control-surface: #172331;
  --number-color: #6fbaff;
}

.map-search {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  width: min(360px,calc(100% - 360px));
  display: flex;
  align-items: center;
   background: #ba8d42;
  border: 0px solid var(--line);
  border-radius: 6px;
  padding: 3px;
  box-shadow: 0 2px 8px #0002;
}

.map-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  box-shadow: none!important;
}

.map-search .clear-search {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.layers-toggle {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 10px;
}

.map-action-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 7px;
  color: var(--ink);
  background: var(--control-surface);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.map-action-icon svg {
  width: 21px;
  height: 21px;
}

.map-wrap .maplibregl-ctrl-top-right {
  top: 52px;
}

.layer-panel.filter-panel {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 56px;
  width: 282px;
  max-height: calc(100% - var(--dock-height) - 56px);
  padding: 12px;
  background: var(--control-surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 3px 12px #0003;
  overflow: auto;
  overscroll-behavior: contain;
}

.layer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.layer-heading h2 {
  font-size: 15px;
}

.layer-panel .form-label {
  font-size: 13px;
}

.layer-panel #mapView {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.layer-panel .advanced {
  margin-top: 12px!important;
}

.layer-panel .filter-footer {
  padding-top: 10px;
}

.layer-panel .map-layer-options {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.map-dock {
  position: absolute;
  z-index: 3;
  left: 10px;
  right: 10px;
  bottom: 0px;
  padding: 7px 9px;
  background: #161616 !important;
  border-radius: 2px;
  border-top: 3px solid #243852;
  padding-top: 5px;
}

.map-control-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  font-size: 1rem;
  min-height: 20px;
  margin: 0;
}

.map-control-title button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  padding: 0 2px;
  min-height: 20px;
}

.map-control-title.first-number-title {
  margin-top: 3px;
}

.control-strip {
  display: flex;
  min-width: 0;
}

.map-dock .icon-row {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 1px;
  min-width: 0;
}

.atlas-icon-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 3px;
}

.atlas-icon-button svg {
  width: 24px;
  height: 24px;
}

.atlas-icon-button[aria-pressed=true] {
  background: #244f7915;
  box-shadow: inset 0 0 0 2px currentColor;
}

[data-bs-theme=dark] .atlas-icon-button[aria-pressed=true] {
  background: #90bfe920;
}

.atlas-icon-button:disabled {
  opacity: .25;
  cursor: default;
}

#letters .atlas-icon-button.unavailable {opacity:.25;}
#letters .atlas-icon-button[aria-pressed=true] {background:currentColor;box-shadow:none;}
#letters .atlas-icon-button[aria-pressed=true] svg rect {fill:currentColor;}
#letters .atlas-icon-button[aria-pressed=true] svg text {fill:var(--control-surface,#101923);}

.number-icon-button {
  color: var(--number-color);
}

.number-icon-button[aria-pressed=true] {
  color: #e9a23b;
}

.scroll-arrow {
  display: none;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  padding: 8px;
}

.scroll-arrow svg {
  width: 20px;
  height: 20px;
}

.scroll-arrow:disabled {
  opacity: .25;
}

.map-dock-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
  min-height: 34px;
}

.map-summary-count {
  font-size: 12px;
}

.map-summary-count strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.map-summary-count #mapCaption {
  margin-left: 12px;
  color: var(--muted);
  font-size: 12px;
}

.map-dock-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.map-dock-actions .map-action-icon {
  width: 30px;
  height: 30px;
  padding: 5px;
}

.map-dock-actions .reset-button {
  background: var(--control-surface);
  border-color: var(--line);
  color: var(--ink);
}

.map-notice {
  inset: auto 12% calc(var(--dock-height) + 65px);
  z-index: 2;
}

.map-error {
  top: auto;
  bottom: calc(var(--dock-height) + 42px);
  left: 10px;
  right: 56px;
  z-index: 2;
  pointer-events: none;
}

@media(max-width:1000px) and (min-width:651px) {
  .map-search {
    width: calc(100% - 360px);
  }

  .map-wrap,.map-wrap #map {
    min-height: 660px;
  }

}

@media(max-width:650px) {
  .map-wrap,.map-wrap #map {
    min-height: 580px;
  }

  .map-search {
    width: auto;
    right: 60px;
    left: 8px;
    top: 8px;
    padding: 2px;
  }

  .map-search input {
    font-size: 16px;
    min-height: 40px;
    padding: 4px 7px;
  }

  .layers-toggle {
    top: 8px;
    right: 8px;
  }

  .map-action-icon {
    width: 44px;
    height: 44px;
    padding: 11px;
  }

  .map-wrap .maplibregl-ctrl-top-right {
    top: 56px;
  }

  .layer-panel.filter-panel {
    top: 58px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100% - var(--dock-height) - 100px);
    padding: 12px;
  }

  .layer-heading .map-action-icon {
    width: 36px;
    height: 36px;
    padding: 8px;
  }

  .layer-panel .form-control,.layer-panel .form-select {
    font-size: 16px;
  }

  .map-dock {
    left: 7px;
    right: 7px;
    bottom: 30px;
    padding: 4px;
  }

  .map-control-title {
    padding: 0 3px;
    min-height: 22px;
  }

  .map-control-title button {
    min-height: 22px;
  }

  .map-control-title.first-number-title {
    margin-top: 0;
  }

  .control-strip {
    display: grid;
    grid-template-columns: 36px minmax(0,1fr) 36px;
  }

  .map-dock .icon-row {
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
  }

  .map-dock .icon-row::-webkit-scrollbar {
    display: none;
  }

  .atlas-icon-button {
    width: 44px;
    height: 44px;
    padding: 10px;
  }

  .scroll-arrow {
    display: grid;
    place-items: center;
    width: 36px;
    height: 44px;
    padding: 8px;
  }

  .map-dock-summary {
    min-height: 38px;
    margin-top: 2px;
    padding: 2px 3px 0;
    gap: 3px;
  }

  .map-summary-count #mapCaption {
    display: none;
  }

  .map-summary-count strong {
    font-size: 14px;
  }

  .map-summary-count {
    font-size: 11px;
  }

  .map-dock-actions {
    gap: 2px;
  }

  .map-dock-actions .map-action-icon {
    width: 36px;
    height: 36px;
    padding: 8px;
  }

  .map-foot {
    font-size: 11px;

  }

  .map-error {
    right: 8px;
    left: 8px;
    font-size: 12px;
  }

}

@media(prefers-reduced-motion:reduce) {
  .map-dock .icon-row {
    scroll-behavior: auto;
  }

}

.layer-panel label.form-label.mt-3 {
  margin-top: 10px!important;
}

.layer-panel .map-layer-options {
  margin-top: 8px;
  padding-top: 8px;
}

.layer-panel .form-check.mt-3 {
  margin-top: 8px!important;
}

@media(max-width:650px) {
  .control-strip {
    grid-template-columns: 44px minmax(0,1fr) 44px;
  }

  .scroll-arrow {
    width: 44px;
  }

}


/* Map button adjustments: larger SVGs and less surrounding space. */
.map-dock {
  padding: 4px 5px;
}

.map-dock .atlas-icon-button {
  width: 38px;
  height: 38px;
  padding: 1px;
}

.map-dock .atlas-icon-button svg {
  width: 36px;
  height: 36px;
}

.map-dock-actions .reset-button {
  width: auto;
  min-width: 76px;
  height: 34px;
  padding: 5px 14px;
  border-radius: 4px;
  font-weight: 650;
}

/* Fit results and full screen, centered at the top of the map. */
.map-view-actions {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--control-surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 2px 8px #0003;
}

.map-view-actions .map-action-icon {
  width: 44px;
  height: 44px;
  padding: 6px;
}

.map-view-actions .map-action-icon svg {
  width: 30px;
  height: 30px;
}

@media (min-width: 651px) {
  .map-search {
    max-width: calc(50% - 62px);
  }
}

@media (max-width: 650px) {
  .map-dock {
    padding: 3px;
  }

  .map-dock .atlas-icon-button {
    width: 44px;
    height: 44px;
    padding: 2px;
  }

  .map-dock .atlas-icon-button svg {
    width: 40px;
    height: 40px;
  }

  .map-dock-actions .reset-button {
    min-height: 44px;
    padding: 6px 12px;
  }

  .map-view-actions {
    top: 60px;
  }
}


/* Compact custom header for the postcard page only. */
body.catalog-page > header.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: block;
  padding: 0;
  border: 0;
  background: #0d1831;
}
body.catalog-page #navbar {
  position: relative;
  top: 0 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  min-height: 0;
  padding: 3px 0;
}
body.catalog-page #navbar > .container-fluid {
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center !important;
}
body.catalog-page #navbar .navbar-brand {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0;
  background: #ffffffd9 url('https://chattanoogahistory.com/webp/CHALOGO21c.webp') center / cover no-repeat;
  border-radius: 50%;
}
body.catalog-page #chapterTitleGroup {
  position: static !important;
  transform: none !important;
  width: auto;
  max-width: none;
  min-width: 0;
  text-align: center;
}
body.catalog-page #chapterTitle {
  margin: 0;
  font-size: clamp(1rem, 1.65vw, 1.55rem);
  line-height: 1.15;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
body.catalog-page #navbarNav .navbar-nav {
  margin-left: auto;
  margin-right: 0 !important;
}
body.catalog-page #navbar .nav-link {
  padding: 6px 8px;
}
body.catalog-page main {
  padding-top: 4px;
}
body.catalog-page .catalog-intro {
  margin-top: 0;
}
.catalog-page-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 4px;
}
.catalog-page-actions[hidden] {
  display: none !important;
}
@media (max-width: 991.98px) {
  body.catalog-page #navbar > .container-fluid {
    grid-template-columns: 40px minmax(0, 1fr) 44px;
    gap: 6px;
  }
  body.catalog-page #navbar .navbar-toggler {
    width: 44px;
    height: 44px;
    padding: 6px;
  }
  body.catalog-page #navbarNav {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  body.catalog-page #navbarNav .navbar-nav {
    flex-direction: row;
    justify-content: center;
    width: 100%;
  }
  body.catalog-page #navbar .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* SVG actions next to the first-number filters. */
.first-number-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}
.first-number-row .first-number-strip{flex:0 1 auto;max-width:100%;width:fit-content}
.first-number-row .first-number-strip .icon-row{flex:0 1 auto}
.map-svg-actions{display:flex;align-items:center;gap:12px;padding-left:16px;border-left:1px solid var(--line,#394552)}
.map-svg-button{display:inline-flex;align-items:center;justify-content:center;height:38px;min-height:38px;padding:0 1px;border:0;border-radius:4px;background:transparent;cursor:pointer;transition:background-color .15s,box-shadow .15s,transform .15s}
.map-svg-button img{display:block;max-width:100%;width:auto;height:36px}
.map-svg-button:hover{background:#284354}
.map-svg-button:focus-visible{outline:2px solid #85cbff;outline-offset:3px}
.map-svg-button:active,.map-svg-button[aria-pressed="true"],.map-svg-button.is-fitting{background:#245c88;box-shadow:0 0 0 2px #85cbff}
.map-svg-button:active{transform:translateY(1px)}
@media(max-width:650px){.map-svg-actions{padding-left:0;border-left:0;gap:8px}.first-number-row{gap:6px}.map-svg-button{height:44px;min-height:44px}.map-svg-button img{height:40px}}
@media(prefers-reduced-motion:reduce){.map-svg-button{transition:none}}

.map-svg-reset:hover{background:#dba54b18}
.map-svg-reset:focus-visible{outline-color:#dba54b}
.map-svg-reset:active{background:#dba54b24;box-shadow:0 0 0 2px #dba54b}

/* Keep map display choices accessible beside the catalog statistics. */
.stats-bar{flex-wrap:wrap}
.stats-bar>.map-display-controls{flex-direction:row;flex:0 1 auto}

.map-display-controls #mapView{
	display:flex;
	flex-wrap:wrap;
	gap:8px 18px;
	font-size:1rem;
    padding: 4px 8px 4px 8px;
    border: 3px solid #203853;
    border-radius: .5rem;
    background-color: #162f45c9;
	justify-content: center;
}
.map-display-controls label{display:inline-flex;align-items:center;gap:7px;min-height:44px;cursor:pointer;white-space:nowrap}
.map-display-controls input {
    accent-color: #f9a649;
    width: 20px;
    height: 20px;
    margin: 0;
}

@media(max-width:650px){.stats-bar>.map-display-controls{flex-basis:100%;width:100%;grid-column:1/-1}.map-display-controls #mapView{gap:6px 18px}.map-display-controls label{font-size:13px}}

/* Desktop controls sit beside the filter rows; mobile keeps its top controls. */
.layers-control {
  position: absolute;
  z-index: 4;
  right: 20px;
  bottom: calc(var(--dock-height) - 72px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.layers-caption {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.layers-control .layers-toggle {
  position: static;
}

@media(min-width:651px) {
  .map-search {
    top: auto;
    bottom: calc(var(--dock-height) + 6px);
    width: min(400px,calc(100% - 20px));
    max-width: none;
  }

  .map-dock > .map-control-title:not(.first-number-title),
  .map-dock > .control-strip {
    margin-right: 108px;
  }

  #allLetters,#allFirstNumbers {
    display: none;
  }

  .map-wrap .maplibregl-ctrl-top-right {
    top: 0;
  }
}

@media(max-width:650px) {
  .map-section {
    position: relative;
  }

  .layers-control {
    top: 8px;
    right: 8px;
    bottom: auto;
  }

  .layers-caption {
    display: none;
  }

  .map-dock {
    left: 0;
    right: 0;
    bottom: 0;
  }

  .map-foot {
    position: absolute;
    z-index: 1;
    bottom: 0;
    left: 0;
    right: 0;
  }

  .first-number-row .first-number-strip {
    flex: 0 0 100%;
    width: 100%;
  }

  .map-svg-actions {
    flex: 0 0 100%;
    justify-content: center;
  }

  .scroll-arrow {
    color: var(--ink);
  }

  .scroll-arrow svg {
    width: 28px;
    height: 28px;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

/* Requested map icons and results statistics; existing user styles preserved above. */
.map-search .clear-search {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
}
.map-search .clear-search svg {
  width: 26px;
  height: 26px;
  stroke: rgb(255 255 255);
  stroke-width: 0.5;
}
.map-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.map-fullscreen {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  padding: 7px;
}
.map-fullscreen svg { width: 28px; height: 28px; }
.map-wrap .maplibregl-ctrl-top-right { top: 58px; }
.results-heading { justify-content: flex-start; flex-wrap: wrap; gap: 16px 32px; }
.results-heading .results-actions { margin-left: auto; }
.results-location-stats { display: flex; align-items: center; gap: 32px; }
.results-location-stats > div,.results-location-stats .stat-button { display: flex; flex-direction: column; }
.results-location-stats strong { font-size: 26px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.results-location-stats span { font-size: 14px; color: var(--muted); }
.results-location-stats #unresolvedShortcut { color: var(--muted); }
@media(max-width:650px) {
  .map-fullscreen { top: 62px; }
  .map-wrap .maplibregl-ctrl-top-right { top: 110px; }
  .results-location-stats { gap: 24px; }
  .results-location-stats strong { font-size: 21px; }
}

/* Hold the map camera while catalog filters continue to update. */
.map-location-lock {
    gap: 5px;
    padding: 0 6px;
    border: 2px solid var(--muted, #aebac7);
    color: var(--ink, #e6edf4);
    font-size: 12px;
    white-space: nowrap;
}
.map-location-lock[aria-pressed="false"] {
    border: 0px solid #ff6868;
     background: #5f5f5f59;
    box-shadow: none;
}


.map-location-lock[aria-pressed="true"]{border-color:#ff6868;background:#ff686817;box-shadow:none}
.map-location-lock[aria-pressed="true"] svg{color:#ff6868}

.map-svg-button.map-location-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 33px;
    min-height: 33px;
    padding: 0 3px;
    border-radius: 6px;
    background: #5f5f5f59;
    cursor: pointer;
    transition: background-color .15s, box-shadow .15s, transform .15s;
}

.map-location-lock svg {
    width: 23px;
    height: 20px;
    flex: none;
}

.map-location-lock[aria-pressed="true"] {
    border: 2px solid #ff6868;
     background: #5f5f5f59;
    box-shadow: none;
}

@media(max-width:650px){.map-location-lock{font-size:12px;padding:0 7px}}

/* Introduction article: wrap the photograph on desktop, center it inline on mobile. */
.catalog-intro-article { display: flow-root; }
.catalog-intro-article p { margin: 0 0 1.4em; }
.catalog-intro-photo {
  box-sizing: border-box;
  float: right;
  width: 44%;
  margin: 0 0 24px 32px;
}
.catalog-intro-photo img {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: auto;
  border: 12px solid #fff;
}
.catalog-intro-photo figcaption {
  margin: 10px 12px 0;
  font-size: clamp(14px,1.1vw,16px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.catalog-intro-photo figcaption em { display: inline-block; margin-top: 4px; }
.catalog-intro-contact { font-weight: 700; }
.catalog-intro-signature { font: 700 clamp(20px,1.5vw,18px)/1.35 Bitter,serif; }
.catalog-intro-signature a { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.catalog-intro-links {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: clamp(16px,3vw,40px);
  align-items: center;
  margin-top: 0;
}
.catalog-intro-additional { margin-top: 0.5rem; }
.catalog-intro-additional #catalogIntroLinksTitle {
  margin: 0 0 12px;
  font: inherit;
}
.catalog-intro-links a {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  height: 100%;
  border: 3px solid #898c8f;
  border-radius: 0.5rem;
  color: inherit;
  text-decoration: none;
}
.catalog-intro-links img {
  display: block;
  flex: 0 0 36%;
  width: 36%;
  height: auto;
  object-fit: contain;
}
.catalog-intro-links span {
  min-width: 0;
  font-size: clamp(14px,1.5vw,24px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.catalog-intro-links a:hover { border-color: currentColor; }
.catalog-intro-dialog-body a:focus-visible { outline: 3px solid #dba54b; outline-offset: 5px; }
@media (max-width: 767px) {
  .catalog-intro-photo { float: none; width: min(100%,600px); margin: 24px auto; }
  .catalog-intro-photo img { border-width: 10px; }
  .catalog-intro-photo figcaption { font-size: 14px; }
  .catalog-intro-links { grid-template-columns: minmax(0,400px); justify-content: center; gap: 20px; }
  .catalog-intro-summary p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}
  
  
}
/* Header artwork and control corrections; live styles preserved above. */
.layers-control { align-items: center; }
.map-fullscreen { padding: 0; }
.map-fullscreen .fullscreen-art {
  display: block; width: 100%; height: 100%;
  background: url("https://chattanoogahistory.com/clinecards/fullpage_rest.png") center / contain no-repeat;
}
.map-fullscreen:hover .fullscreen-art,
.map-fullscreen:focus-visible .fullscreen-art {
  background-image: url("https://chattanoogahistory.com/clinecards/fullpage_hover.png");
}
.map-fullscreen:active .fullscreen-art,
.map-fullscreen[aria-pressed="true"] .fullscreen-art {
  background-image: url("https://chattanoogahistory.com/clinecards/fullpage_pressed.png");
}
.catalog-intro { position: relative; overflow: hidden; padding-right: clamp(130px,22vw,270px); }
.catalog-intro::after,
.catalog-intro-dialog-header::after {
  content: ""; position: absolute; pointer-events: none;
  background: url("https://chattanoogahistory.com/img/cline-modal-top.png") center top / auto 100% no-repeat;
  width: clamp(110px,20vw,230px); right: 24px; top: 0; bottom: 0;
}
.catalog-intro-dialog[open] { display: flex; flex-direction: column; overflow: visible; }
.catalog-intro-dialog-header {
  flex: 0 0 auto; border-radius: 13px 13px 0 0;
  padding-right: clamp(160px,24vw,290px);
}
.catalog-intro-dialog-header::after { right: 65px; top: -9px; clip-path: inset(0); }
.catalog-intro-dialog-header .btn-close { position: absolute; right: 22px; top: 24px; z-index: 2; }
.catalog-intro-dialog-body { overflow: auto; min-height: 0; overscroll-behavior: contain; }

@media (max-width:650px) {
  .catalog-intro { padding: 10px; }
  .catalog-intro::after { right: 4px; width: 106px; }
  .catalog-intro-dialog-header { padding-right: 125px; }
  .catalog-intro-dialog-header::after { right: 30px; width: 95px; top: -6px; }
  .catalog-intro-dialog-header .btn-close { right: 10px; top: 10px; }

}
@media (min-width:651px) {
  .catalog-intro::after,
  .catalog-intro-dialog-header::after { background-size: 100% auto; }
}

/* Requested usability refinements; current live styles retained above. */
body.catalog-page #chapterTitle { opacity: .5; font-weight: 500; }
.map-filter-label {
  position: absolute;
  z-index: 3;
  left: 10px;
  right: 10px;
  bottom: calc(var(--dock-height, 180px) + 6px);
  text-align: center;
  font-family: Bitter, serif;
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  text-shadow: 0 2px 5px #000;
  overflow-wrap: anywhere;
  pointer-events: none;
}
@media (max-width: 768px) {
  .catalog-intro::after { display: none; }
  .catalog-intro { padding-right: 20px; }
}
@media (max-width: 650px) {
  .map-dock-summary { display: none; }
  .map-dock .control-strip {
    --filter-arrow-width: 29.48px; /* 44px reduced by 33%. */
    position: relative;
    display: block;
    min-height: 44px;
  }
  .map-dock .control-strip .icon-row {
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    padding-inline: var(--filter-arrow-width);
    mask-image: linear-gradient(to right,
      rgb(0 0 0 / .2) 0 var(--filter-arrow-width),
      #000 var(--filter-arrow-width) calc(100% - var(--filter-arrow-width)),
      rgb(0 0 0 / .2) calc(100% - var(--filter-arrow-width)) 100%);
  }
  .map-dock .control-strip .scroll-arrow {
    position: absolute;
    top: 0;
    z-index: 1;
    width: var(--filter-arrow-width);
    height: 44px;
    padding: 0;
  }
  .map-dock .control-strip .scroll-arrow:first-child { left: 0; }
  .map-dock .control-strip .scroll-arrow:last-child { right: 0; }
}

/* Reclaim the modal artwork area on phones and narrow tablets. */
@media (max-width: 768px) {
  .catalog-intro-dialog-header::after { display: none; }
  .catalog-intro-dialog-header { padding-right: 60px; }
}

/* Provider credit stays above the filter dock on the optional MapTiler maps. */
.maptiler-logo { position: absolute; z-index: 3; right: 12px; bottom: calc(var(--dock-height) + 6px); }
.maptiler-logo img { display: block; width: 100px; height: 25px; }
.maptiler-active .maplibregl-ctrl-bottom-right { bottom: calc(var(--dock-height) + 34px); }

.maptiler-active .map-filter-label { color: #101923; text-shadow: 0 1px 3px #fff, 0 0 6px #fff; }

/* Catalog layout refinements; the current live stylesheet is preserved above. */
@media (min-width: 901px) {
  .stats-bar { flex-wrap: nowrap; }
  .stats-bar > div.map-display-controls { flex: 1 1 auto; flex-direction: row; align-items: center; justify-content: center; min-width: 0; }
  .stats-bar > .stats-note { flex: 0 0 auto; margin-left: 0; }
}
@media (min-width: 992px) {
  .map-wrap { --dock-search-width: clamp(220px, 24vw, 440px); }
  .map-search {
    z-index: 4;
    left: auto;
    right: 128px;
    bottom: calc(var(--dock-height) - 68px);
    width: var(--dock-search-width);
    max-width: none;
  }
  .map-dock > .control-strip,
  .map-dock > .map-control-title:not(.first-number-title) {
    margin-right: calc(var(--dock-search-width) + 128px);
  }
}
/* Compact only this catalog page's shared footer. */
body.catalog-page > footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 12px !important;
  min-height: 40px;
  background: #3b444b !important;
}
body.catalog-page > footer > .container {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0 !important;
}
body.catalog-page > footer > .container > .row { width: auto; margin: 0 !important; }
body.catalog-page > footer .footer-logo {
  width: 28px;
  height: 28px;
  margin: 0 !important;
  background-size: contain;
  background-repeat: no-repeat;
}
body.catalog-page > footer > .bg-primary { padding: 0 !important; background: transparent !important; }
body.catalog-page > footer h6 { margin: 0; font-size: 18px; line-height: 1.2; }

/* Two directly accessible basemap thumbnails; the live layout stays intact. */
.stats-bar > div.basemap-picker { display: flex; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 16px; }
.basemap-thumbnail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100px;
  padding: 2px;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}
.basemap-thumbnail img { width: 48px; height: 48px; object-fit: cover; border: 2px solid transparent; border-radius: 3px; }
.basemap-thumbnail span { font-size: 12px; line-height: 1.15; color: inherit; white-space: nowrap; }
.basemap-thumbnail[aria-pressed="true"] img { border-color: #e9a23b; }
.basemap-thumbnail:hover img { box-shadow: 0 0 0 1px currentColor; }
.basemap-thumbnail:focus-visible { outline: 2px solid #e9a23b; outline-offset: 2px; }
.basemap-thumbnail:disabled { opacity: .45; cursor: default; }
.basemap-picker--mobile { display: none; }
@media (max-width:650px) {
  .stats-bar > div.basemap-picker--desktop { display: none; }
  .results-heading { position: relative; padding-right: 80px; min-height: 126px; }
  .results-heading > .basemap-picker--mobile {
    position: absolute;
    top: 14px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .basemap-picker--mobile .basemap-thumbnail { width: 44px; height: 44px; padding: 0; }
  .basemap-picker--mobile .basemap-thumbnail img { width: 44px; height: 44px; }
  .basemap-picker--mobile .basemap-thumbnail span { display: none; }
  .results-location-stats { flex-wrap: wrap; }
  .results-actions { max-width: 100%; }
  .results-actions button { white-space: normal; }
}

/* Hide only this catalog's navbar title and label the mobile basemap controls. */
body.catalog-page #navbar #chapterTitleGroup { display: none !important; }
@media (max-width:650px) {
  .results-heading > .basemap-picker--mobile::before {
    content: "basemap";
    display: block;
    text-align: center;
    font-size: 12px;
    line-height: 14px;
    font-weight: 400;
    color: var(--ink);
  }
  .results-heading { min-height: 148px; }
}

/* Use the reference site's wrapping flex row and overhanging brand on mobile. */
@media (max-width: 991.98px) {
  body.catalog-page #navbar { padding: 2px 0; min-height: 0; }
  body.catalog-page #navbar > .container-fluid {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center !important;
    min-height: 36px;
    gap: 0;
    padding-inline: 12px;
  }
  body.catalog-page #navbar .navbar-brand {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    margin: 0 0 -8px;
    align-self: center;
  }
  body.catalog-page #navbar .navbar-toggler {
    flex: 0 0 40px;
    width: 40px;
    height: 36px;
    margin: 0 0 0 auto;
    padding: 6px;
  }
  body.catalog-page #navbar .navbar-toggler-icon { width: 22px; height: 22px; }
  body.catalog-page #navbarNav { flex: 0 0 100%; width: 100%; margin-top: 0; }
}

/* Keep essential footer branding and navbar typography independent of shared CSS. */
body.catalog-page > footer .footer-logo {
  background: #fff url('https://chattanoogahistory.com/webp/CHALOGO21c.webp') center / contain no-repeat;
  border-radius: 50%;
}
body.catalog-page > footer h6 {
  font-family: Bitter, serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
}
body.catalog-page #navbar .navbar-nav > li > a {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Explain the existing green image marker beside the top results page count. */
.pagination-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 48px; }
.image-legend { font-size: 12px; }
@media (max-width:650px) {
  .pagination-summary { column-gap: 16px; }
}

/* Use the same chevron SVG as socialshared, within the existing scroll button. */
.back-to-top { display: grid; place-items: center; padding: 10px; }
.back-to-top img { display: block; width: 100%; height: 100%; object-fit: contain; filter: invert(1); }
.back-to-top:hover img, .back-to-top:focus-visible img { filter: none; }
