* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }
html { touch-action: manipulation; }
input, select, textarea, button { font-size: 16px; font-family: inherit; }

/* ── App shell ── */
.app-body {
  background: #fef2f2;
  color: #111827;
}
.page {
  max-width: 32rem;
  margin: 0 auto;
  padding: 1rem 1rem 6rem;
}
.page-auth {
  min-height: 100dvh;
  max-width: 32rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Top bar ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid #fecdd3;
  background: #fff;
}
.app-header-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, auto);
  align-items: center;
  min-height: 3.25rem;
  gap: .35rem;
  padding: .5rem 0;
}
.app-brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: #e11d48;
  text-decoration: none;
  min-width: 0;
}
.app-header-actions {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .2rem;
  border-radius: 9999px;
  border: 1px solid #fecdd3;
  background: #fffafa;
}
.app-header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.85rem;
  padding: 0 .55rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  font-size: .6875rem;
  font-weight: 700;
  color: #be123c;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.app-header-link:hover,
.app-header-link:active { background: #fff1f2; }
.app-exit-btn {
  min-height: 1.85rem;
  padding: 0 .6rem;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}
.app-exit-btn:active { background: #f3f4f6; }
.app-boost-link {
  justify-self: end;
  font-size: .75rem;
  font-weight: 700;
  color: #d97706;
  text-decoration: none;
  white-space: nowrap;
}
.app-boost-spacer { justify-self: end; width: 2rem; }
.app-header-extra { padding-bottom: .5rem; }

.disc-controls { margin-bottom: .75rem; }

.disc-radius-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .15rem 0;
}
.disc-radius-label {
  flex-shrink: 0;
  font-size: .75rem;
  color: #6b7280;
}
.disc-radius-input {
  flex: 1;
  min-width: 0;
  height: 2rem;
  margin: 0;
  padding: 0;
  cursor: pointer;
  touch-action: pan-x;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.disc-radius-input::-webkit-slider-runnable-track {
  height: .35rem;
  border-radius: 9999px;
  background: #fecdd3;
}
.disc-radius-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: -.45rem;
  border-radius: 50%;
  background: #f43f5e;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.disc-radius-input::-moz-range-track {
  height: .35rem;
  border-radius: 9999px;
  background: #fecdd3;
}
.disc-radius-input::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #f43f5e;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.disc-radius-val {
  flex-shrink: 0;
  width: 3.5rem;
  text-align: right;
  font-size: .75rem;
  font-weight: 700;
  color: #e11d48;
}
.disc-location-note {
  margin-top: .25rem;
  text-align: center;
  font-size: .7rem;
  color: #9ca3af;
}

.intro-bubble {
  margin-top: .5rem;
  padding: .75rem 1rem;
  border-radius: .875rem;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}
.intro-bubble-label {
  display: block;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #e11d48;
  margin-bottom: .25rem;
}
.intro-bubble p {
  font-size: .875rem;
  color: #374151;
  line-height: 1.45;
}


/* ── Cards & forms ── */
.card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #fecdd3;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card + .card { margin-top: 1rem; }
.label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .25rem;
}
.field, .input {
  width: 100%;
  height: 3rem;
  margin-top: .15rem;
  padding: 0 .875rem;
  border-radius: .75rem;
  border: 1px solid #e5e7eb;
  background: #fff;
}
.field:focus, .input:focus {
  outline: none;
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244,63,94,.12);
}
.textarea.field, textarea.field {
  height: auto;
  min-height: 5rem;
  padding: .75rem .875rem;
}
.field-invalid { border-color: #ef4444 !important; }
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.25rem;
  border: none;
  border-radius: .875rem;
  background: linear-gradient(to right, #f43f5e, #fb923c);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.btn-primary:disabled { opacity: .7; }
.btn-amber { background: linear-gradient(to right, #f59e0b, #fb923c); }
.alert-error {
  padding: .75rem 1rem;
  border-radius: .75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: .875rem;
  margin-bottom: 1rem;
}

/* ── Auth logo (login / lang) ── */
.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fecdd3;
  font-size: 1.75rem;
  color: #f43f5e;
  animation: heart-beat 1.4s ease-in-out infinite;
  margin-bottom: .75rem;
}
.auth-logo-name {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: #be123c;
}
.auth-logo-sub {
  margin-top: .35rem;
  font-size: .875rem;
  color: #6b7280;
}
@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ── Discover loader ── */
.discover-status { text-align: center; padding: 2rem 1rem; }
.discover-loader {
  position: relative;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
}
.discover-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #fecdd3;
  animation: ring-pulse 2s ease-out infinite;
}
.discover-loader-ring:nth-child(2) { animation-delay: .4s; }
.discover-loader-core {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #f43f5e;
  animation: heart-beat 1.4s ease-in-out infinite;
}
.discover-status-label { font-size: .875rem; font-weight: 600; color: #9f1239; }
@keyframes ring-pulse {
  0% { transform: scale(.4); opacity: .8; }
  100% { transform: scale(1.1); opacity: 0; }
}
.page-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  gap: .75rem;
}
.page-loader-spinner {
  width: 2rem; height: 2rem;
  border: 3px solid #fecdd3;
  border-top-color: #f43f5e;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Places autocomplete ── */
.places-wrap { position: relative; }
.places-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  max-height: 12rem; overflow-y: auto;
  margin: 0; padding: .25rem 0; list-style: none;
  border-radius: .75rem; border: 1px solid #e5e7eb;
  background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.places-item {
  display: flex; justify-content: space-between; gap: .5rem;
  padding: .5rem .875rem; cursor: pointer; font-size: .875rem;
}
.places-item-active, .places-item:hover { background: #fff1f2; }
.places-area { font-weight: 600; }
.places-state { color: #6b7280; font-size: .8125rem; }
.places-hint { margin-top: .25rem; font-size: .75rem; color: #6b7280; }

/* ── Profile chips ── */
.chip-wrap { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  border-radius: 9999px; border: 1px solid #fecdd3;
  padding: .3rem .7rem; font-size: .75rem; background: #fff; cursor: pointer;
}
.chip-on { background: #fff1f2; border-color: #f43f5e; color: #be123c; font-weight: 600; }
.prof-thumb { width: 4.5rem; height: 4.5rem; border-radius: .75rem; object-fit: cover; }
.photo-grid { display: flex; flex-wrap: wrap; gap: .75rem; }
.photo-tile {
  position: relative;
  width: 5.5rem;
}
.photo-tile .prof-thumb {
  width: 5.5rem;
  height: 5.5rem;
  display: block;
  border: 2px solid #fecdd3;
}
.photo-tile-primary .prof-thumb { border-color: #f43f5e; }
.photo-badge {
  position: absolute;
  top: .35rem;
  left: .35rem;
  background: #f43f5e;
  color: #fff;
  font-size: .625rem;
  font-weight: 700;
  padding: .15rem .4rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.photo-actions {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-top: .35rem;
}
.photo-action {
  display: block;
  width: 100%;
  padding: .35rem .25rem;
  border-radius: .5rem;
  border: 1px solid #fecdd3;
  background: #fff;
  font-size: .6875rem;
  font-weight: 600;
  color: #be123c;
  text-align: center;
  cursor: pointer;
}
.photo-action.photo-delete {
  border-color: #fecaca;
  color: #b91c1c;
}
.photo-action:disabled { opacity: .6; cursor: wait; }

/* ── Guidelines ── */
.guidelines-page .guidelines-section { margin-top: 1rem; }
.guidelines-heading {
  font-size: 1rem;
  font-weight: 800;
  color: #be123c;
  margin-bottom: .75rem;
}
.guidelines-list {
  list-style: disc;
  padding-left: 1.25rem;
  font-size: .875rem;
  line-height: 1.55;
  color: #374151;
}
.guidelines-list li + li { margin-top: .5rem; }
.guidelines-laws li { list-style: none; padding-left: 0; margin-left: 0; }
.guidelines-laws li::before {
  content: "§";
  color: #f43f5e;
  font-weight: 700;
  margin-right: .35rem;
}
.guidelines-alert {
  border-color: #fecaca !important;
  background: #fef2f2;
}
.guidelines-disclaimer {
  border-color: #e5e7eb;
  background: #f9fafb;
}

/* ── Public legal pages ── */
.legal-page { padding-bottom: 2rem; }
.public-legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #fecdd3;
  font-size: .8125rem;
}
.public-legal-nav a {
  color: #be123c;
  font-weight: 600;
  text-decoration: none;
}
.public-legal-nav a:hover { text-decoration: underline; }

/* ── Permission modals ── */
.perm-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(17, 24, 39, .45);
}
.perm-modal-card {
  width: 100%;
  max-width: 22rem;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #fecdd3;
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
}
.perm-modal-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: #be123c;
}
.perm-modal-body {
  margin-top: .75rem;
  font-size: .875rem;
  line-height: 1.5;
  color: #4b5563;
}
.perm-modal-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.perm-modal-secondary {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid #e5e7eb;
  border-radius: .875rem;
  background: #fff;
  font-size: .875rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
}

.install-prompt {
  position: fixed; inset-inline: 0; z-index: 60;
  bottom: max(1rem, env(safe-area-inset-bottom));
  padding: 0 1rem 1rem;
}
body:has(nav.fixed.bottom-0) .install-prompt,
body:has(#reg-footer) .install-prompt {
  bottom: calc(4.75rem + env(safe-area-inset-bottom));
}
.install-prompt-inner {
  max-width: 28rem; margin: 0 auto;
  border-radius: 1rem; border: 1px solid #ffe4e6;
  background: #fff; padding: 1rem;
  box-shadow: 0 8px 24px rgba(244,63,94,.12);
}

/* ── RTL ── */
[dir="rtl"] .nav-link,
[dir="rtl"] input, [dir="rtl"] textarea, [dir="rtl"] select { text-align: right; }
[dir="rtl"] .flex.gap-2, [dir="rtl"] .flex.gap-3 { flex-direction: row-reverse; }

/* ── Matches tabs ── */
.match-tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.match-tab {
  flex: 1 1 auto;
  min-width: 4.5rem;
  min-height: 2.35rem;
  padding: 0 .4rem;
  border: 1px solid #fecdd3;
  border-radius: .75rem;
  background: #fff;
  color: #be123c;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
}
.match-tab.active {
  background: linear-gradient(to right, #f43f5e, #fb923c);
  border-color: transparent;
  color: #fff;
}

/* ── Discover card actions (touch-friendly) ── */
.discover-actions button {
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.discover-actions .msg-sent {
  opacity: .75;
}

/* ── Discover profile modal ── */
.profile-view-modal { align-items: flex-end; padding: 0; }
.profile-view-modal .profile-view-card {
  max-width: 28rem;
  max-height: min(92vh, 40rem);
  border-radius: 1rem 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 480px) {
  .profile-view-modal { align-items: center; padding: 1rem; }
  .profile-view-modal .profile-view-card { border-radius: 1rem; max-height: min(90vh, 38rem); }
}
.profile-view-scroll {
  overflow-y: auto;
  padding: 1rem 1.25rem 1.25rem;
  -webkit-overflow-scrolling: touch;
}
.profile-view-hero {
  width: 100%;
  max-height: 18rem;
  object-fit: cover;
  border-radius: .875rem;
  background: #fff1f2;
}
.profile-view-thumbs {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
  overflow-x: auto;
}
.profile-view-thumb {
  width: 3.5rem;
  height: 3.5rem;
  flex-shrink: 0;
  border-radius: .5rem;
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
}
.profile-view-thumb.active { border-color: #f43f5e; }
.profile-view-name { margin-top: .75rem; font-size: 1.25rem; font-weight: 800; color: #111827; }
.profile-view-meta { margin-top: .25rem; font-size: .8125rem; color: #f43f5e; }
.profile-view-line { margin-top: .5rem; font-size: .875rem; line-height: 1.45; color: #374151; }
.profile-view-section { margin-top: 1rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #9ca3af; }
.profile-view-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.profile-view-tag {
  background: #fff1f2;
  color: #be123c;
  border-radius: 9999px;
  padding: .25rem .65rem;
  font-size: .75rem;
}
.profile-view-prompt {
  margin-top: .5rem;
  padding: .75rem;
  border-radius: .75rem;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
}
.profile-view-prompt-q { font-size: .75rem; font-weight: 600; color: #6b7280; }
.profile-view-prompt-a { margin-top: .25rem; font-size: .875rem; color: #111827; }
.profile-view-footer {
  flex-shrink: 0;
  padding: .75rem 1.25rem 1.25rem;
  border-top: 1px solid #fecdd3;
  background: #fff;
}
.profile-view-btn {
  width: 100%;
  margin-top: .5rem;
  padding: .5rem;
  border: none;
  background: none;
  font-size: .8125rem;
  font-weight: 600;
  color: #f43f5e;
  cursor: pointer;
  text-align: center;
}
