:root {
  --bg: #f6f5f8;
  --surface: #ffffff;
  --border: #e5e1ea;
  --text: #211c29;
  --text-muted: #6f6779;
  --primary: #a3348f;
  --primary-hover: #8a2b78;
  --error: #d64545;
  --success: #1e9e5a;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#language-switcher {
  position: relative;
  margin-left: auto;
}

#language-switcher-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.9rem;
  line-height: 1;
  font-family: var(--font);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
}

#language-switcher-toggle:hover {
  border-color: var(--primary);
}

#language-switcher-code {
  font-size: 1.3rem;
  line-height: 1;
}

#language-switcher-menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 1001;
}

.language-switcher-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.language-switcher-option-flag {
  font-size: 1.2rem;
  line-height: 1;
}

.language-switcher-option:hover {
  background: var(--bg);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav.nav {
  visibility: hidden;
}

.nav a.brand {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  width: 48px;
  height: 48px;
}

.brand-logo {
  display: block;
  height: 48px;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--primary);
}

.nav a.active {
  color: var(--primary);
}

.nav a.nav-logout {
  margin-left: auto;
}

#mobile-nav-menu {
  display: contents;
}

.nav:has(#mobile-nav-toggle) #logout-link {
  order: 1;
}

.mobile-nav-toggle {
  display: none;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

.container.wide {
  max-width: 1100px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  margin: 0;
}

.search-input-wrap {
  margin-bottom: 1.5rem;
}

.search-input-wrap input[type="text"] {
  max-width: 360px;
}

.search-name-row {
  margin-bottom: 1rem;
}

.search-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.search-filters label {
  margin-top: 0;
}

.search-filters button {
  width: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.search-age-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-age-range input[type="number"] {
  width: 70px;
}

.search-inline-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-inline-field label {
  margin: 0;
  white-space: nowrap;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

#error-404-card {
  text-align: center;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

p.subtitle {
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  margin-top: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

input:focus,
select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.checkbox-row input {
  margin-top: 0.2rem;
}

.checkbox-row label {
  margin: 0;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.question-field > label {
  margin-top: 0;
}

.hobbies-dropdown {
  position: relative;
}

.hobbies-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.hobbies-dropdown-toggle:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.hobbies-dropdown-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hobbies-dropdown-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.hobbies-dropdown-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.hobbies-dropdown-panel[hidden] {
  display: none;
}

.hobbies-dropdown-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.25rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}

.hobbies-dropdown-option input {
  margin: 0;
}

.about-me-field-col .question-field {
  display: flex;
  flex-direction: column;
}

.about-me-textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  resize: none;
}

.yes-no-toggle {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.4rem;
}

.yes-no-toggle label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  font-size: 0.95rem;
  margin-top: 0;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.7rem 1.25rem;
  background: var(--primary);
  color: white;
  transition: background 0.15s ease;
  width: 100%;
}

button:hover {
  background: var(--primary-hover);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-danger {
  background: var(--error);
}

.btn-danger:hover {
  background: var(--error);
  opacity: 0.85;
}

.btn-row {
  margin-top: 1.5rem;
}

.language-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.message {
  margin-top: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.message.success {
  background: #e6f7ee;
  color: var(--success);
}

.message.error {
  background: #fbeaea;
  color: var(--error);
}

.form-footer {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
}

.form-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.profile-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 2.25rem;
  letter-spacing: 0.02em;
  overflow: hidden;
}

.status-dot {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  z-index: 2;
}

.status-dot-inline {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.status-dot-green {
  background: #2ecc71;
}

.status-dot-yellow {
  background: #f1c40f;
}

.profile-photo img,
.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-link,
.profile-name-link {
  cursor: pointer;
}

.profile-name-link:hover {
  text-decoration: underline;
}

.profile-info {
  padding: 0.85rem 1rem 0.6rem;
}

.profile-name-age {
  font-weight: 700;
  font-size: 1.02rem;
}

.match-percentage {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

.profile-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}

.profile-actions button {
  width: auto;
  flex: 1;
  padding: 0.55rem 0.5rem;
  font-size: 0.85rem;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--bg);
}

.btn-outline.active {
  background: var(--primary);
  color: white;
}

.no-results {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 0;
}

.settings-section {
  margin-bottom: 1.5rem;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h2 {
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.25rem;
}

.section-header-row h2 {
  margin: 0;
}

.section-header-row button {
  width: auto;
  flex-shrink: 0;
}

#about-match-btn {
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

.credits-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.chat-shell {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 1rem;
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-header h1 {
  margin: 0;
  font-size: 1.15rem;
}

.chat-header .subtitle {
  margin: 0.1rem 0 0;
}

.chat-window {
  flex: 1;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bubble {
  max-width: 75%;
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.35;
  word-wrap: break-word;
}

.bubble .meta {
  display: block;
  font-size: 0.72rem;
  opacity: 0.7;
  margin-bottom: 0.15rem;
}

.bubble img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 8px;
  display: block;
  margin-top: 0.3rem;
  object-fit: cover;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.chat-message-photo {
  cursor: pointer;
}

#photo-lightbox {
  background: rgba(0, 0, 0, 0.6);
}

.photo-lightbox-inner {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
}

.photo-lightbox-inner img {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#photo-lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

#photo-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

.bubble.from-user {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.bubble.from-profile {
  align-self: flex-start;
  background: var(--bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-input-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.chat-input-row textarea {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  resize: none;
}

.chat-shell .chat-input-row textarea {
  background: var(--surface);
}

.chat-input-row button {
  width: auto;
  flex-shrink: 0;
}

.chat-attach-btn {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.55rem 0.7rem;
  font-size: 1rem;
  line-height: 1;
  height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-attach-btn:hover {
  background: var(--bg);
}

.chat-photo-preview {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.chat-photo-preview[hidden] {
  display: none;
}

.chat-photo-preview img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.chat-photo-preview button {
  width: auto;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

#current-credits-balance {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.packages-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 280px));
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.package-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.package-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.package-credits {
  font-size: 1.6rem;
  font-weight: 800;
}

.package-name {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.15rem 0 0.75rem;
}

.package-price {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.package-card button {
  width: 100%;
}

.checkout-form {
  max-width: 420px;
}

.checkout-form .sandbox-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
}

.checkout-row {
  display: flex;
  gap: 1rem;
}

.checkout-row > div {
  flex: 1;
}

.nav-badge {
  display: inline-block;
  background: #e0303d;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 999px;
  margin-left: 0.3rem;
  padding: 0 4px;
}

.nav-badge[hidden] {
  display: none;
}

#toast-container {
  position: fixed;
  top: 84px;
  right: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

@media (max-width: 640px) {
  #toast-container {
    display: none;
  }
}

.toast {
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 320px;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 2px solid #e53e3e;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transform: translateX(120%);
  transition: transform 0.35s ease;
}

.toast-visible {
  transform: translateX(0);
}

.toast-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  overflow: hidden;
}

.toast-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.toast-body {
  min-width: 0;
}

.toast-name {
  font-weight: 600;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-action {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.people-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.people-list .profile-card .profile-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0 1rem 0.6rem;
  margin-top: -0.5rem;
}

.chats-list {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
}

.chat-item-header .chat-avatar {
  width: 40px;
  height: 40px;
  font-size: 0.9rem;
}

.chat-item-summary {
  flex: 1;
  min-width: 0;
}

.chat-item-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.chat-item-preview {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-time {
  color: var(--text-muted);
  font-size: 0.78rem;
  flex-shrink: 0;
}

.chat-item-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.chat-item.expanded .chat-item-chevron {
  transform: rotate(90deg);
}

.chat-item-body {
  border-top: 1px solid var(--border);
  padding: 1rem;
}

.chat-item-body .chat-window {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

#promo-splash-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

#promo-splash-card {
  position: relative;
  background: var(--surface);
  color: var(--text);
  padding: 2rem 2.5rem;
  border-radius: var(--radius);
  text-align: center;
  max-width: 320px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

#promo-splash-close {
  position: absolute;
  top: 0.4rem;
  right: 0.7rem;
  width: auto;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0.2rem 0.4rem;
}

#promo-splash-message {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 1rem;
  color: var(--text);
}

#promo-splash-timer {
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

#promo-splash-buy {
  display: block;
  margin-top: 1.25rem;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  text-decoration: none;
}

#purchase-splash-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

#purchase-splash-card {
  position: relative;
  background: var(--surface);
  color: var(--text);
  padding: 2rem 2.5rem;
  border-radius: var(--radius);
  text-align: center;
  max-width: 320px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

#purchase-splash-close {
  position: absolute;
  top: 0.4rem;
  right: 0.7rem;
  width: auto;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0.2rem 0.4rem;
}

#purchase-splash-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

#purchase-splash-message {
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
  color: var(--text);
}

#purchase-splash-detail {
  color: var(--text-muted);
  margin: 0;
}

#purchase-splash-ok {
  margin-top: 1.25rem;
}

.landing-photo-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-auto-rows: 160px;
  gap: 4px;
  overflow: hidden;
}

.landing-photo-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  filter: grayscale(35%) blur(1px);
}

.landing-photo-scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
}

.landing-hero {
  padding-top: 6rem;
}

.landing-hero .card {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
  text-align: center;
}

.landing-content-rows {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(100vh - 26rem) 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.landing-content-row {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 2.5rem;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.landing-content-row-reverse {
  flex-direction: row-reverse;
}

.landing-content-row-image,
.landing-content-row-text {
  flex: 1 1 0;
  min-width: 0;
}

.landing-content-row-image img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}

.landing-content-row-heading {
  margin: 0 0 1rem;
}

.landing-content-row-body {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .landing-content-row,
  .landing-content-row-reverse {
    flex-direction: column;
  }
}

.profile-detail {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

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

.profile-detail-photo {
  border-radius: 12px;
}

#profile-detail-card .profile-detail-photo img {
  cursor: pointer;
}

.photo-pending-label {
  margin: 0.4rem 0 0;
  padding: 0.3rem 0.6rem;
  background: rgba(241, 196, 15, 0.15);
  border: 1px solid #f1c40f;
  border-radius: 6px;
  color: #b8890a;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.profile-detail-name {
  margin-top: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.gift-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: auto;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.gift-btn:hover {
  background: var(--bg);
}

.gift-btn-icon {
  width: 20px;
  height: 20px;
}

#gift-modal .modal-panel {
  position: relative;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
}

#gift-modal-close {
  position: absolute;
  top: 0.4rem;
  right: 0.7rem;
  width: auto;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0.2rem 0.4rem;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.gift-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.gift-item:hover {
  border-color: var(--primary);
}

.gift-item img {
  width: 90px;
  height: 90px;
}

.gift-message-img {
  display: block;
  width: 72px;
  height: 72px;
  margin-top: 0.4rem;
}

.gift-list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.gift-list-row .profile-name-link {
  color: inherit;
}

.gift-list-row .profile-name-link:not(:hover) {
  text-decoration: none;
}

.gift-list-row .gift-message-img {
  width: 36px;
  height: 36px;
  margin-top: 0;
  flex-shrink: 0;
}

.gift-scroll-list {
  max-height: 240px;
  overflow-y: auto;
}

.profile-detail-info-col {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.about-me-field-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-top: 1.25rem;
}

.profile-detail-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .profile-detail-fields {
    grid-template-columns: 1fr;
  }
}

.profile-detail-field dt {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.profile-detail-field dd {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
}

.profile-detail-field-full {
  grid-column: 1 / -1;
}

.profile-detail-field-full dd {
  white-space: pre-wrap;
}

.inline-edit-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.inline-edit-row select,
.inline-edit-row input[type="text"] {
  width: auto;
  flex: 1;
}

.inline-edit-row button {
  width: auto;
  flex-shrink: 0;
}

.profile-detail-field-editable .message {
  margin-top: 0.4rem;
}

.profile-detail-photo-col {
  display: flex;
  flex-direction: column;
}

.photo-edit-section {
  margin-top: 0.75rem;
}

.profile-detail-actions {
  padding: 0;
  margin-top: 0.85rem;
}

.profile-detail-about-me {
  margin: 0.85rem 0 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.btn-outline.btn-danger-outline {
  color: var(--error);
  border-color: var(--error);
}

.btn-outline.btn-danger-outline:hover {
  background: #fbeaea;
}

.btn-outline.btn-danger-outline.active {
  background: var(--error);
  color: white;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
}

.modal-panel h2 {
  margin-top: 0;
}

#settings-modal .modal-panel {
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

#match-preferences-modal .modal-panel {
  max-height: 90vh;
  overflow-y: auto;
}

.modal-panel textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  resize: vertical;
}

.btn-row-split {
  display: flex;
  gap: 0.75rem;
}

.btn-row-split button {
  flex: 1;
  width: auto;
}

.emoji-picker-wrap {
  position: relative;
  flex-shrink: 0;
}

.emoji-picker-popup {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 0.4rem;
  display: flex;
  flex-direction: column;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 20;
}

.emoji-picker-popup[hidden] {
  display: none;
}

.emoji-picker-search {
  width: 100%;
  flex-shrink: 0;
  margin-bottom: 0.4rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

.emoji-picker-tabs {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.4rem;
  flex-shrink: 0;
}

.emoji-picker-tab {
  width: auto;
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.3rem 0.4rem;
  cursor: pointer;
}

.emoji-picker-tab:hover {
  background: var(--bg);
}

.emoji-picker-tab.active {
  background: var(--bg);
  outline: 1px solid var(--border);
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.15rem;
  max-height: 220px;
  overflow-y: auto;
}

.emoji-picker-item {
  width: auto;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.5rem;
  cursor: pointer;
}

.emoji-picker-item:hover {
  background: var(--bg);
}

.blocked-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.blocked-list-item:last-child {
  border-bottom: none;
}

.blocked-list-item button {
  width: auto;
}

.site-footer {
  margin-top: auto;
  padding: 1.5rem;
  background: #ffffff;
  border-top: 1px solid var(--border);
}

.site-footer-columns {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .site-footer-columns {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.site-footer-col-left {
  text-align: left;
}

.site-footer-col-center {
  text-align: center;
}

.site-footer-col-right {
  text-align: right;
}

.site-footer-logo {
  display: inline-block;
  max-height: 40px;
  max-width: 100%;
  margin-bottom: 0.6rem;
}

.site-footer-text {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 0.6rem;
}

.site-footer-text :is(h1, h2, h3) {
  color: var(--text);
  font-size: 1rem;
  margin: 0 0 0.3rem;
}

.site-footer-text a {
  color: var(--primary);
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
}

.site-footer-col-left .site-footer-links {
  flex-direction: column;
  align-items: flex-start;
}

.site-footer-col-center .site-footer-links {
  justify-content: center;
}

.site-footer-col-right .site-footer-links {
  flex-direction: column;
  align-items: flex-end;
}

@media (max-width: 640px) {
  .site-footer-col-left .site-footer-links,
  .site-footer-col-right .site-footer-links {
    align-items: center;
  }
  .site-footer-links {
    justify-content: center;
  }
}

.site-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
}

.site-footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.page-body {
  margin-top: 1rem;
  line-height: 1.6;
}

.cookie-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.25rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.cookie-consent-text {
  color: var(--text);
  font-size: 0.9rem;
}

.cookie-consent-accept {
  flex-shrink: 0;
  width: auto;
  padding: 0.5rem 1.2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}

.cookie-consent-accept:hover {
  background: var(--primary-hover);
}


:root {
  --tab-bar-height: 0px;
}

@media (max-width: 768px) {
  .nav [hidden] {
    display: none !important;
  }

  .nav:has(#language-switcher) .brand {
    flex-basis: 100%;
  }

  .nav:has(#mobile-nav-toggle) #mobile-nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 1rem;
    flex-direction: column;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    z-index: 1001;
    gap: 0;
  }

  .nav:has(#mobile-nav-toggle) #mobile-nav-menu:not([hidden]) {
    display: flex;
  }

  .nav:has(#mobile-nav-toggle) #mobile-nav-menu a {
    padding: 0.75rem 1rem;
    margin-left: 0;
  }

  .nav:has(#mobile-nav-toggle) #credits-badge {
    order: -1;
  }

  .nav:has(#mobile-nav-toggle) a[href="buy-credits.html"] {
    order: 1;
  }

  .nav:has(#mobile-nav-toggle) .mobile-nav-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.4rem;
    width: auto;
    padding: 0.3rem 0.5rem;
    color: var(--text);
    cursor: pointer;
    order: 3;
  }

  button,
  .btn-outline,
  .nav a {
    min-height: 48px;
  }

  .checkbox-row {
    min-height: 48px;
    align-items: center;
  }

  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.7rem;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="number"],
  select,
  textarea {
    font-size: 1rem;
  }

  .profile-name-age {
    font-size: 1.1rem;
  }

  .profile-detail-field dd {
    font-size: 1rem;
  }

  .bubble {
    font-size: 1rem;
  }

  .profiles-grid,
  .people-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .profile-card {
    border-radius: 16px;
  }

  .profile-card > .profile-actions {
    padding: 0.85rem 1rem 1rem;
    justify-content: center;
  }

  .profile-card > .profile-actions button {
    flex: none;
    font-size: 0.8rem;
    min-height: 38px;
    padding: 0.44rem 0.4rem;
  }

  .people-list .profile-card .profile-meta {
    padding: 0 1rem;
  }

  .profile-detail {
    grid-template-columns: 1fr;
  }

  #profile-detail-card .profile-photo.profile-detail-photo {
    aspect-ratio: auto;
    height: 50vh;
  }

  #profile-detail-card {
    padding-bottom: calc(var(--tab-bar-height) + 7rem);
  }

  #profile-detail-card .profile-detail-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--tab-bar-height) + 3.5rem);
    z-index: 900;
    margin: 0;
    padding: 0.6rem 1rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
  }

  #profile-detail-card .btn-row:has(#chat-btn) {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--tab-bar-height);
    z-index: 900;
    margin: 0;
    padding: 0.6rem 1rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
  }

  #profile-detail-card .btn-row:has(#chat-btn) button {
    min-height: 48px;
  }

  .chat-shell {
    max-width: none;
    margin: 0;
    padding: 0 1rem;
    height: 100vh;
    height: 100dvh;
  }

  .chat-header {
    padding: 1rem 0;
  }

  .chat-shell .chat-window {
    padding-bottom: 8rem;
  }

  .chat-shell .chat-input-row {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--tab-bar-height);
    z-index: 900;
    margin: 0;
    padding: 0.6rem 1rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
  }

  .chat-shell .chat-input-row textarea {
    min-height: 48px;
  }

  .chat-input-row {
    flex-wrap: wrap;
  }

  .chat-input-row textarea {
    order: 1;
    flex: 1 1 100%;
  }

  .chat-input-row button[type="submit"] {
    margin-left: auto;
  }

  #account-photo-preview.profile-detail-photo {
    aspect-ratio: auto;
    height: 45vh;
  }

  .landing-photo-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
  }

  .landing-photo-grid img {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .landing-hero {
    padding-top: 1.5rem;
  }

  .landing-hero .container {
    max-width: none;
    padding: 0 1rem;
  }

  .landing-hero .card {
    padding: 1.5rem 1.25rem;
    border-radius: 16px;
  }

  .packages-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .package-card {
    padding: 1rem;
  }

  #promo-splash-overlay {
    padding: 1rem;
  }

  #promo-splash-card {
    max-height: 100%;
    overflow-y: auto;
    padding: 1.5rem 1.25rem;
  }
}

@media (min-width: 769px) and (max-width: 1366px) {
  .landing-photo-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
  }

  .landing-photo-grid img {
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

.country-search {
  position: relative;
}

.country-search-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  max-height: min(40vh, 280px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  color: var(--text);
  text-align: left;
}

.country-search-list.above {
  top: auto;
  bottom: calc(100% + 4px);
}

.country-search-list li {
  padding: 0.6rem 0.75rem;
  font-size: 16px;
  line-height: 1.3;
  cursor: pointer;
}

.country-search-list li.active {
  background: var(--primary);
  color: #fff;
}

@media (hover: hover) {
  .country-search-list li:not(.empty):hover {
    background: var(--primary);
    color: #fff;
  }
}

.country-search-list li.empty {
  cursor: default;
  color: var(--text-muted);
}
