.preview-active .topbar {
  z-index: 1000;
}

.preview-active .people-panel {
  display: none;
}

.preview-active #peopleToggle {
  display: none;
}

.preview-view-switch {
  position: absolute;
  z-index: 1050;
  top: calc(max(10px, env(safe-area-inset-top)) + 62px);
  left: 50%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 184px;
  height: 42px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(34, 47, 43, 0.14);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.18s ease, visibility 0.18s;
}

.preview-active:not(.preview-center-mode) .preview-view-switch {
  visibility: visible;
  opacity: 1;
}

.preview-view-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #697771;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.preview-view-switch button svg {
  width: 16px;
  height: 16px;
}

.preview-view-switch button.is-active {
  background: #1f826b;
  color: #fff;
  box-shadow: 0 2px 7px rgba(31, 130, 107, 0.23);
}

.preview-page {
  position: absolute;
  inset: 0;
  z-index: 600;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #f4f7f5;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0.16s;
  scrollbar-width: thin;
}

.preview-page.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.preview-directory {
  padding: calc(max(10px, env(safe-area-inset-top)) + 118px) 12px
    calc(80px + env(safe-area-inset-bottom));
}

.preview-directory-inner,
.preview-center-inner {
  width: min(100%, 720px);
  margin: 0 auto;
}

.preview-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 15px;
}

.preview-kicker {
  display: block;
  margin-bottom: 4px;
  color: #1d7864;
  font-size: 12px;
  font-weight: 750;
}

.preview-page-heading h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
  font-weight: 800;
}

.preview-page-heading p {
  margin: 7px 0 0;
  color: #6b7873;
  font-size: 13px;
  line-height: 1.4;
}

.preview-demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid #efc9bb;
  border-radius: 12px;
  background: #fff4ef;
  color: #b74e35;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.preview-search {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 0 10px 0 14px;
  border: 1px solid #d8e1dd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(31, 47, 42, 0.06);
}

.preview-search > svg {
  width: 18px;
  height: 18px;
  color: #77847f;
}

.preview-search input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #17211f;
  font-size: 14px;
}

.preview-search input::placeholder {
  color: #909b97;
}

.preview-search input::-webkit-search-cancel-button {
  display: none;
}

.preview-search-clear {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #edf2ef;
  color: #5e6c66;
  cursor: pointer;
}

.preview-search-clear svg {
  width: 15px;
  height: 15px;
}

.preview-directory-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 1px 14px;
  scrollbar-width: none;
}

.preview-directory-filters::-webkit-scrollbar {
  display: none;
}

.preview-filter-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid #d8e1dd;
  border-radius: 16px;
  background: #fff;
  color: #52615b;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.preview-filter-chip span {
  color: #8a9792;
  font-size: 10px;
}

.preview-filter-chip.is-active {
  border-color: #1f826b;
  background: #1f826b;
  color: #fff;
}

.preview-filter-chip.is-active span {
  color: rgba(255, 255, 255, 0.72);
}

.preview-directory-list {
  display: grid;
  gap: 9px;
}

.preview-directory-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  width: 100%;
  min-height: 100px;
  padding: 13px 12px;
  border: 1px solid #e0e7e3;
  border-radius: 8px;
  background: #fff;
  color: #17211f;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(31, 47, 42, 0.045);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.preview-directory-card:hover {
  border-color: #b9d7cc;
  background: #fbfdfc;
}

.preview-directory-card:active {
  transform: scale(0.992);
}

.preview-directory-card .avatar-holder {
  margin-top: 1px;
}

.preview-directory-card-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.preview-directory-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.preview-directory-name strong {
  overflow: hidden;
  color: #17211f;
  font-size: 15px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.preview-directory-name small {
  flex: 0 0 auto;
  color: #1d7864;
  font-size: 11px;
  font-weight: 650;
}

.preview-directory-bio {
  display: -webkit-box;
  overflow: hidden;
  color: #61706a;
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.preview-directory-tags {
  display: flex;
  gap: 5px;
  overflow: hidden;
  padding-top: 2px;
  white-space: nowrap;
}

.preview-directory-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 7px;
  border-radius: 10px;
  background: #eef4f1;
  color: #4c6a60;
  font-size: 10px;
  font-weight: 650;
}

.preview-directory-distance {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 54px;
  padding-top: 2px;
  color: #77847f;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.preview-directory-distance svg {
  width: 14px;
  height: 14px;
  color: #a3ada9;
}

.preview-empty {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 220px;
  border: 1px dashed #d6e0dc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  color: #6b7873;
  text-align: center;
}

.preview-empty > span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #eaf1ee;
  color: #7f8d87;
}

.preview-empty svg {
  width: 21px;
  height: 21px;
}

.preview-empty strong {
  color: #34433d;
  font-size: 14px;
}

.preview-empty p {
  margin: 0;
  font-size: 12px;
}

.preview-center {
  padding: calc(max(10px, env(safe-area-inset-top)) + 64px) 0
    calc(82px + env(safe-area-inset-bottom));
}

.preview-center-inner {
  overflow: hidden;
  background: #fff;
}

.preview-center-hero {
  padding: 20px 16px 0;
  border-bottom: 1px solid #dce5e1;
  background: #edf4f0;
}

.preview-center-identity {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.preview-center-avatar-slot {
  display: inline-flex;
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
}

.preview-center-identity .avatar-holder {
  width: 82px;
  height: 82px;
  border: 3px solid rgba(255, 255, 255, 0.92);
}

.preview-center-copy {
  min-width: 0;
}

.preview-center-copy h1 {
  margin: 7px 0 3px;
  overflow: hidden;
  font-size: 23px;
  line-height: 1.2;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.preview-center-copy p {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: #567069;
  font-size: 12px;
}

.preview-center-copy p svg {
  width: 14px;
  height: 14px;
  color: #1f826b;
}

.preview-icon-action {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #cfddd7;
  border-radius: 8px;
  background: #fff;
  color: #40534c;
  cursor: pointer;
}

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

.preview-center-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid #d6e2dd;
}

.preview-center-stats > div {
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 13px 5px 14px;
  border-right: 1px solid #d6e2dd;
}

.preview-center-stats > div:last-child {
  border-right: 0;
}

.preview-center-stats strong {
  color: #1e3a31;
  font-size: 19px;
  line-height: 1.2;
}

.preview-center-stats span {
  color: #708079;
  font-size: 10px;
}

.preview-center-section {
  padding: 4px 16px;
  border-bottom: 8px solid #f4f7f5;
  background: #fff;
}

.preview-center-section:last-child {
  border-bottom: 0;
}

.preview-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 49px;
}

.preview-section-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 780;
}

.preview-section-heading span {
  color: #8a9792;
  font-size: 10px;
}

.preview-section-heading button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #1d7864;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.preview-setting-row {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 61px;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid #edf1ef;
  background: transparent;
  color: #17211f;
  text-align: left;
}

button.preview-setting-row {
  cursor: pointer;
}

.preview-setting-row.is-static {
  cursor: default;
}

.preview-setting-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #edf4f1;
  color: #1f7865;
}

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

.preview-setting-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.preview-setting-copy strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.preview-setting-copy small {
  overflow: hidden;
  color: #8a9792;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.preview-chevron {
  width: 17px;
  height: 17px;
  color: #a2ada8;
}

.preview-switch {
  position: relative;
  width: 40px;
  height: 23px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #cfd8d4;
  cursor: pointer;
  transition: background 0.15s ease;
}

.preview-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(28, 43, 38, 0.18);
  transition: transform 0.15s ease;
}

.preview-switch.is-on {
  background: #1f826b;
}

.preview-switch.is-on span {
  transform: translateX(17px);
}

.preview-text-action {
  min-width: 48px;
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid #cbdcd5;
  border-radius: 7px;
  background: #fff;
  color: #1d7864;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.preview-status-text {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 12px;
  background: #edf4f1;
  color: #1d7864;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.preview-recent-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 0 16px;
  scrollbar-width: none;
}

.preview-recent-list::-webkit-scrollbar {
  display: none;
}

.preview-recent-empty {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 74px;
  border: 1px dashed #d7e1dd;
  border-radius: 8px;
  background: #f8fbf9;
  color: #85928c;
  font-size: 11px;
}

.preview-recent-person {
  flex: 0 0 124px;
  display: grid;
  justify-items: start;
  gap: 7px;
  min-width: 0;
  padding: 11px;
  border: 1px solid #e0e7e3;
  border-radius: 8px;
  background: #f8fbf9;
  color: #17211f;
  text-align: left;
  cursor: pointer;
}

.preview-recent-person > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
  width: 100%;
}

.preview-recent-person strong,
.preview-recent-person small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.preview-recent-person strong {
  font-size: 12px;
}

.preview-recent-person small {
  color: #7e8b85;
  font-size: 10px;
}

.preview-bottom-nav {
  position: absolute;
  z-index: 1100;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: calc(62px + env(safe-area-inset-bottom));
  padding: 5px 18px env(safe-area-inset-bottom);
  border-top: 1px solid rgba(213, 223, 218, 0.95);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -6px 20px rgba(30, 43, 39, 0.08);
  backdrop-filter: blur(14px);
}

.preview-bottom-nav button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-width: 0;
  padding: 2px;
  border: 0;
  background: transparent;
  color: #81908a;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.preview-bottom-nav button svg {
  width: 20px;
  height: 20px;
}

.preview-bottom-nav button.is-active {
  color: #1f826b;
}

.preview-list-mode .map-canvas,
.preview-list-mode .people-panel,
.preview-center-mode .map-canvas,
.preview-center-mode .people-panel {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.preview-list-mode #locateButton,
.preview-list-mode #peopleToggle,
.preview-center-mode #locateButton,
.preview-center-mode #peopleToggle {
  display: none;
}

@media (min-width: 760px) {
  .preview-active .people-panel {
    bottom: calc(18px + 68px);
    height: auto;
    min-height: 0;
  }

  .preview-view-switch {
    top: 84px;
    left: 18px;
    transform: none;
  }

  .preview-directory {
    padding-top: 144px;
    padding-left: 22px;
    padding-right: 22px;
  }

  .preview-center {
    padding-top: 88px;
    padding-left: 22px;
    padding-right: 22px;
  }

  .preview-center-inner {
    border: 1px solid #dce5e1;
    border-radius: 8px;
    box-shadow: 0 16px 42px rgba(30, 43, 39, 0.1);
  }

  .preview-bottom-nav {
    left: 50%;
    right: auto;
    bottom: 12px;
    width: 360px;
    height: 60px;
    padding: 5px 18px;
    border: 1px solid rgba(213, 223, 218, 0.95);
    border-radius: 8px;
    transform: translateX(-50%);
  }

  .preview-center-hero {
    padding-left: 24px;
    padding-right: 24px;
  }

  .preview-center-section {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 380px) {
  .preview-directory-card {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 9px;
    padding-left: 10px;
    padding-right: 9px;
  }

  .preview-directory-card .avatar-holder {
    width: 44px;
    height: 44px;
  }

  .preview-directory-distance {
    min-width: 47px;
  }

  .preview-directory-name small {
    display: none;
  }

  .preview-center-identity {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px;
  }

  .preview-center-identity .avatar-holder {
    width: 70px;
    height: 70px;
  }

  .preview-center-avatar-slot {
    width: 70px;
    height: 70px;
  }
}

@media (max-height: 720px) and (max-width: 759px) {
  .preview-active .people-panel {
    height: min(39dvh, 320px);
  }
}
