:root {
  --bg: #ebe7d0;
  --panel: #ebe7d0;
  --panel-2: #f3f0df;
  --card: #f6f3e6;
  --stroke: #d0c8b0;
  --text: #5e5e5e;
  --muted: #7b7468;
  --accent: #d3a550;
  --amber: #d3a550;
  --danger: #d01110;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.15), 0 8px 28px rgba(12, 9, 6, 0.15);
  --radius: 18px;
  --bg-grad-1: rgba(211, 165, 80, 0.2);
  --bg-grad-2: rgba(208, 17, 16, 0.12);
  --accent-ink: #121110;
}

html[data-theme="dark"] {
  --bg: #121110;
  --panel: #1a1816;
  --panel-2: #211e1b;
  --card: #2a2621;
  --stroke: #4d4333;
  --text: #d7ccb5;
  --muted: #ab9b7f;
  --accent: #b98b45;
  --amber: #b98b45;
  --danger: #d01110;
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.35);
  --bg-grad-1: rgba(211, 165, 80, 0.12);
  --bg-grad-2: rgba(208, 17, 16, 0.08);
  --accent-ink: #121110;
}

html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color 0.32s ease, color 0.32s ease, border-color 0.32s ease, box-shadow 0.32s ease, fill 0.32s ease, stroke 0.32s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background: radial-gradient(circle at 20% 20%, var(--bg-grad-1) 0, transparent 30%),
              radial-gradient(circle at 80% 0, var(--bg-grad-2) 0, transparent 28%),
              var(--bg);
  min-height: 100vh;
}

.page-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 26px 80px;
}

.home-shell {
  max-width: none;
  width: 100%;
  padding: 32px 32px 24px;
}

.logo-menu-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 76px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.logo-menu {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%) scale(1);
  z-index: 300;
}

.topbar {
  position: relative;
  z-index: 300;
}

.logo-button {
  border: 2px solid var(--accent);
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  border-radius: 14px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  box-shadow: var(--shadow);
  transform-origin: center top;
  transition: padding 0.4s ease, border-radius 0.4s ease, transform 0.2s ease;
  transform: scale(1);
  position: relative;
}

.logo-button.is-hovering {
  transform: scale(1.06);
}


.logo-menu .logo {
  width: 48px;
  height: 48px;
  transition: width 0.4s ease, height 0.4s ease;
}

.logo-menu.sticky {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.logo-menu.sticky .logo-button {
  padding: 4px 6px;
  border-radius: 12px;
}

.logo-menu.sticky .logo {
  width: 24px;
  height: 24px;
}

body.modal-open .logo-button {
  padding: 4px 6px;
  border-radius: 12px;
}

body.modal-open .logo-menu .logo {
  width: 24px;
  height: 24px;
}

body.modal-open .brand-text {
  display: none;
}

body.modal-open .logo-menu {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.logo-menu-panel {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) scale(0.96);
  display: inline-flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.logo-menu-panel.left {
  right: calc(100% + 12px);
  left: auto;
}

.logo-menu-panel.right {
  left: calc(100% + 12px);
  right: auto;
}

.logo-menu-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.menu-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.04);
  font-size: 18px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.menu-icon-img {
  width: 20px;
  height: 20px;
  display: block;
}

.logo,
.menu-icon-img[src$=".svg"] {
  filter: grayscale(1) saturate(0) contrast(1.05);
}

.menu-icon-img[src*="Messages.svg"] {
  filter: grayscale(1) saturate(0) invert(1) contrast(1.05);
}

/* Left submenu icon tone tuning by theme */
.logo-menu-panel.left .menu-icon-img[src$=".svg"] {
  filter: grayscale(1) saturate(0) contrast(1.08) brightness(0.72);
}

.logo-menu-panel.left .menu-icon-img[src*="Camera.svg"],
.logo-menu-panel.left .menu-icon-img[src*="Swipe Icon.svg"] {
  filter: grayscale(1) saturate(0) contrast(1.2) brightness(0.66) drop-shadow(0 0 0.45px #000);
  transform: scale(1.08);
  transform-origin: center;
}

html[data-theme="dark"] .logo,
html[data-theme="dark"] .menu-icon-img[src$=".svg"] {
  filter: grayscale(1) saturate(0) invert(1) contrast(1.05);
}

html[data-theme="dark"] .menu-icon-img[src*="Messages.svg"] {
  filter: grayscale(1) saturate(0) contrast(1.05);
}

html[data-theme="dark"] .logo-menu-panel.left .menu-icon-img[src$=".svg"] {
  filter: grayscale(1) saturate(0) invert(1) contrast(1.08) brightness(1.22);
}

html[data-theme="dark"] .logo-menu-panel.left .menu-icon-img[src*="Camera.svg"],
html[data-theme="dark"] .logo-menu-panel.left .menu-icon-img[src*="Swipe Icon.svg"] {
  filter: grayscale(1) saturate(0) invert(1) contrast(1.2) brightness(1.28) drop-shadow(0 0 0.45px #fff);
  transform: scale(1.08);
  transform-origin: center;
}

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 62px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel-2);
  box-shadow: var(--shadow);
  z-index: 520;
  padding: 0;
}

.theme-mark {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%);
  pointer-events: none;
}

.theme-mark-sun {
  left: 10px;
  border-radius: 50%;
  border: 2px solid var(--text);
}

.theme-mark-moon {
  right: 10px;
  border-radius: 50%;
  box-shadow: -2px 0 0 0 var(--text);
  border: 1px solid transparent;
}

.theme-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #c8922d);
  border: 1px solid rgba(0, 0, 0, 0.14);
  transition: transform 0.26s ease;
}

html[data-theme="dark"] .theme-thumb {
  transform: translateX(30px);
}

.menu-icon-img.profile-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
}

.menu-icon:hover,
.menu-icon:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border-color: var(--accent);
}

h1, h2, h3 {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 { font-size: 40px; line-height: 1.1; }
h2 { font-size: 28px; line-height: 1.15; }
h3 { font-size: 20px; line-height: 1.2; }

p {
  margin: 0;
  color: var(--muted);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 0 14px;
  width: 100%;
  margin: 0;
  box-shadow: none;
  position: relative;
  top: auto;
  z-index: 400;
  isolation: isolate;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  margin: 0 auto;
}

.logo {
  width: 48px;
  height: 48px;
}

.logo.small {
  width: 40px;
  height: 40px;
}

.brand-text {
  display: grid;
  gap: 4px;
}

.wordmark {
  font-weight: 700;
  letter-spacing: 0.32em;
  font-size: 36px;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--amber);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

button.primary {
  background: linear-gradient(120deg, var(--accent), var(--danger));
  color: var(--accent-ink);
  padding: 12px 18px;
  font-weight: 700;
  border: none;
  box-shadow: 0 12px 40px rgba(211, 165, 80, 0.28);
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--stroke);
  padding: 12px 16px;
}

button.slim {
  padding: 10px 14px;
}

button.small {
  padding: 8px 12px;
  font-size: 12px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border-color: var(--accent);
}

main {
  margin-top: 10px;
  display: grid;
  gap: 48px;
}

.hero-card {
  background: linear-gradient(180deg, var(--card), var(--panel));
  border: 1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.card-header {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
  font-size: 12px;
}

.pill-amber { border-color: rgba(255, 184, 108, 0.5); color: var(--amber); }
.pill-green { border-color: rgba(211, 165, 80, 0.5); color: var(--accent); }

.profile-photo {
  position: relative;
  min-height: 240px;
  background-image: var(--accent);
  border-radius: 18px;
  margin: 0 14px 12px;
  overflow: hidden;
  display: grid;
  place-items: end;
}

.profile-photo .overlay {
  width: 100%;
  padding: 14px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.7));
  display: grid;
  gap: 10px;
}

.photo-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.12);
  font-size: 13px;
  color: var(--text);
  width: fit-content;
}

.badge-glow {
  box-shadow: 0 6px 24px rgba(211, 165, 80, 0.25);
}

.card-body {
  padding: 0 18px 18px;
  display: grid;
  gap: 12px;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.subtitle {
  color: #5e5e5e;
}

.subtitle.clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.subtitle.clamp-1 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid var(--stroke);
  color: var(--text);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--stroke);
  padding: 8px 10px;
  border-radius: 10px;
  color: #121110;
  font-size: 13px;
}

.cta-row {
  display: flex;
  gap: 10px;
}

.catalog {
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
  width: min(1400px, 100%);
  margin: 0 auto;
}

.catalog-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: auto;
  justify-content: center;
  align-content: start;
  row-gap: 452px;
  column-gap: 18px;
  max-height: 750px;
  overflow-x: visible;
  overflow-y: auto;
  overflow-clip-margin: 28px;
  position: relative;
  padding-top: 140px;
  padding-bottom: 140px;
  padding-left: 32px;
  padding-right: 32px;
  background: var(--bg);
  border-radius: 16px;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scrollbar-color: var(--accent) var(--panel-2);
  scrollbar-width: thin;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 40px 24px;
  border: 1px dashed var(--stroke);
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.03);
}

.grid::-webkit-scrollbar {
  width: 10px;
}

.grid::-webkit-scrollbar-track {
  background: var(--panel-2);
  border-radius: 12px;
}

.grid::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), #c8922d);
  border-radius: 12px;
  border: 2px solid var(--panel-2);
}

.grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #e0b462, var(--accent));
}

.swipe-page {
  overflow: hidden;
}

.swipe-shell {
  min-height: calc(100vh - 220px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 12px 0 24px;
  align-items: start;
  justify-items: center;
  position: relative;
}

.swipe-stack {
  width: min(760px, 100%);
  height: 74vh;
  position: relative;
  display: grid;
  place-items: center;
  grid-column: 1;
  grid-row: 1;
  overflow: visible;
}

.swipe-card {
  width: 100%;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  overflow: hidden;
  display: block;
  box-shadow: 0 40px 140px rgba(0, 0, 0, 0.5);
  transition: transform 0.35s ease, opacity 0.35s ease;
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.swipe-card-main {
  z-index: 6;
  position: relative;
  border: 2px solid var(--accent);
}

.swipe-card.keep-top {
  z-index: 7;
}

.swipe-card.fade-out {
  opacity: 0;
}

.swipe-card.is-empty {
  opacity: 0;
  pointer-events: none;
}


.swipe-card-back {
  opacity: 1;
  filter: saturate(0.9);
  pointer-events: none;
  isolation: isolate;
  border: 2px solid rgba(211, 165, 80, 0.45);
}

.swipe-card-next .modal-hero,
.swipe-card-next-two .modal-hero,
.swipe-card-next-three .modal-hero {
  grid-template-areas: "summary photo";
}

.swipe-card-back::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(235, 231, 208, 0.3);
  z-index: 4;
  pointer-events: none;
}

.swipe-card-prev {
  z-index: 5;
  transform: translateX(-38%) scale(0.94);
  background: var(--card);
}

.swipe-card-next {
  z-index: 5;
  transform: translateX(38%) scale(0.94);
  background: var(--card);
}

.swipe-card-prev-two {
  z-index: 4;
  transform: translateX(-62%) scale(0.9);
  background: var(--card);
}

.swipe-card-next-two {
  z-index: 4;
  transform: translateX(62%) scale(0.9);
  background: var(--card);
}

.swipe-card-prev-three {
  z-index: 3;
  transform: translateX(-90%) scale(0.82);
  background: var(--card);
}

.swipe-card-next-three {
  z-index: 3;
  transform: translateX(90%) scale(0.82);
  background: var(--card);
}

.swipe-card-faux {
  z-index: 2;
  transform: translateX(0) scale(0.78);
  background: var(--card);
  pointer-events: none;
}

.swipe-card-faux-left {
  transform: translateX(-102%) scale(0.74);
}

.swipe-card-faux-right {
  transform: translateX(102%) scale(0.74);
}


.swipe-full {
  padding: 24px 24px 36px;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
}

.swipe-empty {
  margin: 0;
  color: var(--muted);
}

.swipe-empty-main,
.swipe-empty-preview {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
  padding: 16px;
  box-sizing: border-box;
}

.swipe-empty-preview {
  position: relative;
  z-index: 6;
  margin: 24px;
  min-height: calc(100% - 48px);
  border: 1px dashed var(--stroke);
  border-radius: 16px;
  background: rgba(235, 231, 208, 0.74);
  color: #121110;
}

.swipe-card.is-transitioning {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
}

.swipe-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  height: 100%;
}

.swipe-info {
  padding: 8px 10px 10px;
  display: grid;
  gap: 6px;
  color: #121110;
  background: var(--card);
  border-top: 1px solid var(--stroke);
}

.swipe-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #121110;
}

.swipe-name {
  margin: 0;
  font-size: 22px;
  color: #121110;
}

.swipe-bio {
  margin: 0;
  color: #5e5e5e;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.swipe-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swipe-traits span {
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--stroke);
  border-radius: 9px;
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
  color: #121110;
  display: inline-flex;
  align-items: center;
}

.swipe-actions {
  display: none;
}

.swipe-actions button {
  min-width: 120px;
}

.swipe-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  grid-column: 1;
  grid-row: 2;
}

.swipe-endcap {
  grid-column: 1;
  grid-row: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.03);
}

.swipe-endcap p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.swipe-endcap .ghost.small {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 11px;
}

.map-page {
  overflow: auto;
}

.map-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: start;
  padding: 12px 0 24px;
}

.map-panel,
.map-side {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.map-panel {
  position: relative;
  z-index: 3;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.map-toolbar {
  position: relative;
  z-index: 2200;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.map-search {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex: 1 1 320px;
}

.map-search-field {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.map-search input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 9px 12px;
  font: inherit;
  color: var(--text);
  background: var(--panel);
}

.map-search input::placeholder {
  color: var(--muted);
}

.map-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: auto;
  max-height: 260px;
  z-index: 2400;
  padding: 4px;
}

.map-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.map-suggestion:hover,
.map-suggestion:focus-visible {
  background: rgba(0, 0, 0, 0.06);
  transform: none;
  box-shadow: none;
}

.map-suggestion-loading {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
}

.map-radius {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.map-radius strong {
  min-width: 68px;
  text-align: right;
}

.map-radius input[type="range"] {
  width: 160px;
  accent-color: var(--accent);
}

.map-hint {
  font-size: 12px;
  color: var(--muted);
}

#world-map {
  width: 100%;
  height: 620px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.map-side {
  padding: 16px;
  display: grid;
  gap: 12px;
  max-height: 760px;
}

.map-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-side-head h2 {
  margin: 0;
}

.map-center {
  font-size: 12px;
  color: var(--muted);
}

.map-results {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.map-empty {
  border: 1px dashed var(--stroke);
  border-radius: 14px;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.03);
}

.map-result-card {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: 74px minmax(0, 1fr);
  background: var(--panel-2);
}

.map-result-image {
  width: 74px;
  height: 92px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
}

.map-result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map-result-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.map-result-content h3 {
  margin: 0;
  font-size: 16px;
  color: #121110;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.map-result-content h3 span {
  font-size: 13px;
  color: var(--muted);
}

.map-result-location {
  font-size: 12px;
  color: #121110;
}

.map-result-headline {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.map-result-distance {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.map-popup {
  display: grid;
  gap: 2px;
  color: #121110;
}

.leaflet-control-zoom a {
  color: var(--text);
  background: var(--card);
  border-color: var(--stroke);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--card);
  color: var(--text);
}

@media (max-width: 1100px) {
  .swipe-shell {
    grid-template-columns: 1fr;
  }

  .swipe-stack {
    width: min(90vw, 720px);
  }

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

  #world-map {
    height: 480px;
  }
}

.camera-page {
  overflow: hidden;
}

.camera-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: start;
  padding: 12px 0 24px;
}

.camera-stage {
  display: grid;
  gap: 16px;
}

.video-stack {
  display: grid;
  gap: 16px;
}

.video-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  min-height: 220px;
  box-shadow: var(--shadow);
}

.video-card.remote {
  height: 420px;
}

.video-card.local {
  height: 180px;
}

.video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #121110;
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.55));
  display: grid;
  place-items: center;
  color: #ebe7d0;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 12px;
  text-align: center;
  padding: 12px;
  pointer-events: none;
}

.video-overlay.hidden {
  opacity: 0;
}

.video-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #ebe7d0;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.camera-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.camera-actions button {
  min-width: 140px;
}

.video-card.audio-only video {
  opacity: 0;
}

.video-card.audio-only .video-overlay {
  opacity: 1;
}

.camera-chat {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  gap: 16px;
}

.camera-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.camera-chat-header h2 {
  margin: 6px 0 0;
  color: #121110;
}

.status-chip {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0, 0, 0, 0.05);
  color: #121110;
}

.status-chip[data-tone="good"] {
  border-color: rgba(47, 122, 79, 0.4);
  background: rgba(47, 122, 79, 0.15);
}

.status-chip[data-tone="warning"] {
  border-color: rgba(211, 165, 80, 0.5);
  background: rgba(211, 165, 80, 0.2);
}

.status-chip[data-tone="error"] {
  border-color: rgba(208, 17, 16, 0.5);
  background: rgba(208, 17, 16, 0.2);
}

.consent-card {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.03);
  display: grid;
  gap: 10px;
}

.consent-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #121110;
}

.consent-chip {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.consent-prompt p {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.consent-actions {
  display: flex;
  gap: 8px;
}

.camera-chat-thread {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.chat-message {
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.04);
  color: #121110;
}

.chat-message.from-me {
  justify-self: end;
  background: rgba(211, 165, 80, 0.2);
  border-color: rgba(211, 165, 80, 0.5);
}

.chat-message.system {
  justify-self: center;
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  font-size: 12px;
}

.camera-chat .chat-compose {
  margin-top: auto;
}

@media (max-width: 1000px) {
  .camera-shell {
    grid-template-columns: 1fr;
  }
}

.swipe-preview-info {
  display: grid;
  gap: 4px;
}

.swipe-preview-name {
  font-weight: 700;
  font-size: 14px;
}

.swipe-preview-meta {
  font-size: 12px;
  color: var(--muted);
}

.profile-card {
  background: linear-gradient(180deg, var(--card), var(--panel-2));
  border: 1px solid var(--stroke);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-rows: 1.6fr 1.05fr;
  gap: 0;
  box-shadow: none;
  transition: transform 0.18s ease, border-color 0.18s ease;
  transform-origin: center;
  color: #121110;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1 / 2.2;
}

.profile-card h3 {
  margin: 0;
  color: #121110;
}

.profile-card:hover {
  border-color: var(--accent);
}

.profile-card:hover:not(.freeze-hover) {
  transform: scale(1.15);
  z-index: 5;
}

.profile-card.hovering,
.profile-card.settling {
  z-index: 5;
}

.profile-card.freeze-hover {
  transform: none;
  transition: none;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(235, 231, 208, 0.88);
  color: #121110;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--shadow);
  transition: none;
}

.gallery-nav:hover,
.gallery-nav:focus-visible {
  transform: translateY(-50%);
  box-shadow: var(--shadow);
}

.gallery-nav.prev {
  left: 10px;
}

.gallery-nav.next {
  right: 10px;
}

.profile-thumb .gallery-nav {
  width: 26px;
  height: 26px;
  font-size: 14px;
  z-index: 3;
}

.modal-photo .gallery-nav {
  width: 36px;
  height: 36px;
  font-size: 18px;
  z-index: 3;
}

.profile-thumb {
  position: relative;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.age-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(211, 165, 80, 0.5);
  border: 1px solid var(--stroke);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #121110;
  font-size: 13px;
}

.profile-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
  z-index: 1;
}

.profile-thumb .pill {
  display: none;
}

.profile-content {
  padding: 12px 14px 14px;
  display: grid;
  gap: 8px;
  background: var(--card);
  border-top: 1px solid var(--stroke);
  color: #121110;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.profile-content .subtitle {
  margin: 0;
  line-height: calc(1.4em - 2px);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1300px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.profile-content h3 {
  margin: 0;
}

.meta {
  display: flex;
  justify-content: space-between;
  color: #121110;
  font-size: 12px;
}

.traits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.traits span {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--stroke);
  border-radius: 9px;
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
  color: #121110;
}

.traits .ellipsis {
  background: transparent;
  border: none;
  height: 22px;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  color: #121110;
}

.footer {
  margin-top: 14px;
  padding: 4px 0 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.footer-left {
  flex: 1;
  margin-right: auto;
  text-align: left;
}

.footer-left p {
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
}

.footer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: 0;
  justify-content: center;
  width: 100%;
}

.footer-actions button {
  font-size: 12px;
  padding: 6px 10px;
  min-height: 0;
}

.footer-actions .ghost {
  padding: 6px 12px;
}

@media (max-width: 720px) {
  .footer {
    flex-wrap: wrap;
  }

  .footer-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.bottom-brand {
  margin: 28px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open .topbar {
  pointer-events: none;
}

.profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 17, 16, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.profile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.profile-modal {
  width: min(900px, 94vw);
  max-height: 85vh;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  box-shadow: 0 40px 140px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  transform: translate(var(--from-x, 0px), var(--from-y, 0px)) scale(var(--from-scale, 1));
  opacity: 1;
  transform-origin: 0 0;
  transition: transform 2.5s ease-in-out;
}

.profile-modal.is-open {
  transform: translate(0, 0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: #121110;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-weight: 700;
}

.profile-modal-content {
  padding: 24px;
  display: grid;
  gap: 20px;
  max-height: 85vh;
  overflow-y: auto;
}

.profile-modal-content::-webkit-scrollbar {
  width: 10px;
}

.profile-modal-content::-webkit-scrollbar-track {
  background: var(--panel-2);
  border-radius: 12px;
}

.profile-modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), #c8922d);
  border-radius: 12px;
  border: 2px solid var(--panel-2);
}

.modal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  grid-template-areas: "photo summary";
}

.modal-photo {
  grid-area: photo;
  height: 360px;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
  position: relative;
}

.modal-summary {
  grid-area: summary;
  display: grid;
  gap: 0;
}

.modal-title {
  display: grid;
  gap: 0;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: flex-start;
}

.modal-title h2 {
  margin: 0;
  color: #121110;
  line-height: 1.1;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-subtitle {
  color: #5e5e5e;
  line-height: 1.5;
  margin: 0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  justify-content: flex-start;
  margin-left: 0;
}

.modal-actions button {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  height: 28px;
  line-height: 1;
  min-height: 0;
}

.modal-actions .danger {
  border-color: var(--danger);
  color: var(--danger);
}

.modal-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.modal-traits span {
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1;
  min-height: 0;
  color: #121110;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.detail-card {
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.detail-card h4 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #121110;
}

.detail-card p {
  margin: 0;
  color: #5e5e5e;
}

.detail-card.wide {
  grid-column: 1 / -1;
}

.hover-loader {
  position: fixed;
  width: 48px;
  height: 48px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
  z-index: 450;
  --duration: 1500ms;
  --circumference: 113;
}

.hover-loader.active {
  opacity: 1;
}

.hover-loader svg {
  width: 100%;
  height: 100%;
}

.loader-track {
  fill: none;
  stroke: rgba(18, 17, 16, 0.25);
  stroke-width: 3;
}

.loader-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: var(--circumference);
  stroke-dashoffset: var(--circumference);
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.hover-loader.active .loader-ring {
  animation: fill-ring var(--duration) linear forwards;
}

@keyframes fill-ring {
  from { stroke-dashoffset: var(--circumference); }
  to { stroke-dashoffset: 0; }
}


@media (max-width: 720px) {
  h1 { font-size: 32px; }
  .topbar {
    position: static;
  }
  .nav-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
.topbar .logo,
.bottom-brand .logo {
  width: 48px;
  height: 48px;
}

.topbar .wordmark,
.bottom-brand .wordmark {
  font-size: 36px;
  letter-spacing: 0.32em;
}

html[data-theme="dark"] .menu-icon {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .swipe-card-back::after {
  background: rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .swipe-endcap {
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .swipe-empty-preview {
  background: rgba(255, 255, 255, 0.08);
  color: #d9ccb2;
}

html[data-theme="dark"] .catalog,
html[data-theme="dark"] .logo-button,
html[data-theme="dark"] .swipe-card-main,
html[data-theme="dark"] .gallery-nav,
html[data-theme="dark"] .profile-card:hover,
html[data-theme="dark"] .menu-icon:hover,
html[data-theme="dark"] .menu-icon:focus-visible {
  border-color: rgba(185, 139, 69, 0.72);
}

html[data-theme="dark"] .swipe-card-back {
  border-color: rgba(185, 139, 69, 0.4);
}

html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .profile-content,
html[data-theme="dark"] .modal-title h2,
html[data-theme="dark"] .meta,
html[data-theme="dark"] .traits span,
html[data-theme="dark"] .traits .ellipsis,
html[data-theme="dark"] .tag-row span,
html[data-theme="dark"] .swipe-info,
html[data-theme="dark"] .swipe-meta,
html[data-theme="dark"] .swipe-name,
html[data-theme="dark"] .swipe-traits span,
html[data-theme="dark"] .modal-traits span,
html[data-theme="dark"] .detail-card h4,
html[data-theme="dark"] .camera-chat-header h2,
html[data-theme="dark"] .status-chip,
html[data-theme="dark"] .age-badge,
html[data-theme="dark"] .gallery-nav,
html[data-theme="dark"] .modal-close {
  color: var(--text);
}

html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .swipe-bio,
html[data-theme="dark"] .modal-subtitle,
html[data-theme="dark"] .detail-card p {
  color: var(--muted);
}

html[data-theme="dark"] .gallery-nav,
html[data-theme="dark"] .modal-close {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .profile-card h3,
html[data-theme="dark"] .profile-content h3,
html[data-theme="dark"] .modal-title h2,
html[data-theme="dark"] .swipe-name,
html[data-theme="dark"] .meta,
html[data-theme="dark"] .swipe-meta,
html[data-theme="dark"] .map-result-content h3,
html[data-theme="dark"] .map-result-location,
html[data-theme="dark"] .map-popup {
  color: #d9ccb2;
}

html[data-theme="dark"] .profile-content .subtitle,
html[data-theme="dark"] .modal-subtitle,
html[data-theme="dark"] .swipe-bio,
html[data-theme="dark"] .detail-card p,
html[data-theme="dark"] .map-result-headline,
html[data-theme="dark"] .map-result-content h3 span,
html[data-theme="dark"] .map-center {
  color: #ad9d82;
}

html[data-theme="dark"] .map-empty,
html[data-theme="dark"] .map-result-card {
  background: rgba(0, 0, 0, 0.16);
}

html[data-theme="dark"] .map-suggestions {
  background: var(--panel);
}

html[data-theme="dark"] .map-suggestion:hover,
html[data-theme="dark"] .map-suggestion:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .loader-track {
  stroke: rgba(235, 231, 208, 0.32);
}
