:root {
  --brand1: #ff4f6d;
  --brand2: #ff8a3d;
  --brand: linear-gradient(135deg, var(--brand1), var(--brand2));
  --bg: #efeff4;
  --surface: #ffffff;
  --surface-2: #f6f6f9;
  --text: #1d1d24;
  --muted: #6b6b78;
  --line: #e4e4ea;
  --ok: #17a86b;
  --bad: #e5484d;
  --verified: #2b8cff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 20, 40, 0.14);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c10;
    --surface: #17171d;
    --surface-2: #212129;
    --text: #f1f1f4;
    --muted: #a3a3b0;
    --line: #2c2c36;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--brand1);
}

[hidden] {
  display: none !important;
}

/* The logo's lettering (Fredoka, SIL Open Font License: public/fonts/OFL.txt). */
@font-face {
  font-family: 'Fredoka';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/fredoka-600.woff2') format('woff2');
}
.brand,
.welcome h1 {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}
/* A heart for the dot on the "i". */
.wm-i {
  position: relative;
}
/* Positioned, so the gradient text clip skips it: paint it the gradient's start colour. */
.brand .wm-i {
  color: var(--brand1);
}
.wm-i::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.1em;
  width: 0.24em;
  height: 0.22em;
  transform: translateX(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21C5 15.5 1 12 1 7a5.5 5.5 0 0 1 11-1 5.5 5.5 0 0 1 11 1c0 5-4 8.5-11 14z' fill='%23ff8a5b'/%3E%3C/svg%3E") center / contain no-repeat;
}
.welcome .wm-i::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21C5 15.5 1 12 1 7a5.5 5.5 0 0 1 11-1 5.5 5.5 0 0 1 11 1c0 5-4 8.5-11 14z' fill='%23fff'/%3E%3C/svg%3E");
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.center {
  text-align: center;
}

/* ---------- Shell ---------- */

.shell {
  position: relative;
  max-width: 460px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--surface);
  overflow: hidden;
}

@media (min-width: 540px) {
  body {
    padding: 20px 0;
  }
  .shell {
    height: calc(100vh - 40px);
    height: calc(100dvh - 40px);
    border-radius: 28px;
    box-shadow: var(--shadow);
  }
}

.screen {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  min-width: 0;
}

.brand {
  flex: 1;
  padding-left: 4px;
  font-size: 26px;
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.icon-btn,
.text-btn {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--surface-2);
}
.text-btn {
  border-radius: 8px;
  padding: 0 8px;
  font: inherit;
  font-size: 14px;
}

main.content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.tabs {
  display: flex;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 10px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.tabs a.active {
  color: var(--brand1);
}
.tabs a {
  position: relative;
}
.tab-badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand1);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.tab-badge[hidden] {
  display: none;
}

/* ---------- Buttons & forms ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn.primary {
  background: var(--brand);
  color: #fff;
}
.btn.ghost {
  background: var(--surface-2);
  color: var(--text);
}
.btn.ghost.light {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.btn.danger {
  background: var(--bad);
  color: #fff;
}
.btn.small {
  width: auto;
  min-height: 40px;
}

.row-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 0;
}
.field-label {
  font-size: 14px;
  font-weight: 600;
}
.hint {
  color: var(--muted);
  font-size: 13px;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input[type='date'],
input[type='number'],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
textarea {
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--brand1);
  outline-offset: 0;
  border-color: transparent;
}
input:disabled {
  opacity: 0.7;
}

.form-section h2 {
  margin: 4px 0 6px;
  font-size: 22px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.chip.on {
  border-color: var(--brand1);
  background: rgba(255, 79, 109, 0.1);
  color: var(--brand1);
  font-weight: 600;
}
.chip-x {
  font-size: 16px;
  line-height: 1;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
}
.consent input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--brand1);
  flex: none;
}

.mode-cards {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.mode-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mode-card span {
  color: var(--muted);
  font-size: 14px;
}
.mode-card.on {
  border-color: var(--brand1);
  background: rgba(255, 79, 109, 0.07);
}

.age-range {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.progress span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}
.progress span.on {
  background: var(--brand);
}

.sticky-actions {
  position: sticky;
  bottom: -16px;
  margin: 24px -16px -16px;
  padding: 12px 16px 16px;
  background: linear-gradient(transparent, var(--surface) 30%);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.photo-slot {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}
.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-slot.add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Welcome & auth ---------- */

.welcome {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 100%;
  overflow-y: auto;
  padding: 48px 24px 28px;
  /* A happy couple (public/images/CREDITS.md) under the brand colours. */
  background:
    linear-gradient(135deg, rgba(255, 79, 109, 0.86), rgba(255, 138, 61, 0.8)),
    url('/images/welcome-couple.jpg') center 30% / cover no-repeat,
    var(--brand1);
  color: #fff;
}
.welcome-hero {
  text-align: center;
}
.welcome-logo {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.welcome h1 {
  margin: 12px 0 0;
  font-size: 48px;
}
.tagline {
  margin: 4px 0 28px;
  font-size: 18px;
  opacity: 0.95;
}
.welcome-points {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.welcome-points li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
}
.welcome-points .icon {
  flex: none;
  margin-top: 1px;
}
.welcome-actions {
  display: grid;
  gap: 10px;
}
.welcome-actions .provider-buttons {
  gap: 8px;
  margin-bottom: 4px;
}
.welcome-actions .btn {
  min-height: 46px;
}
/* With sign-in buttons on a short phone screen, keep the feature list brief. */
@media (max-height: 900px) {
  .welcome:has(.provider-buttons) .welcome-points {
    display: none;
  }
  .welcome:has(.provider-buttons) .tagline {
    margin-bottom: 0;
  }
}
.welcome-actions .btn.primary {
  background: #fff;
  color: var(--brand1);
}
.auth-form .btn {
  margin-top: 8px;
}

/* ---------- Discover ---------- */

.deck-wrap {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 10px 10px 0;
}
.deck {
  position: relative;
  flex: 1;
  min-height: 0;
}

.verify-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(43, 140, 255, 0.12);
  color: var(--verified);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.verify-banner .icon {
  flex: none;
}
.verify-banner a {
  flex: 1;
  color: inherit;
  text-decoration: none;
}
.banner-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
}
.skip-verify {
  display: block;
  margin: 16px auto 0;
}

/* Report or block, on the top card in Discover. */
.card-more {
  position: absolute;
  top: 20px;
  right: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.35);
  color: #fff;
  cursor: pointer;
}
.sheet-hint {
  margin: 4px 0 0;
  padding: 0 12px;
  font-size: 13px;
  text-align: center;
  color: var(--muted, #6b6b78);
}
.card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #ccc;
  box-shadow: var(--shadow);
  color: #fff;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  transition: transform 0.25s ease;
}
.card.behind {
  transform: scale(0.95) translateY(12px);
  filter: brightness(0.92);
  pointer-events: none;
}
.card.dragging {
  transition: none;
  cursor: grabbing;
}
.card.fly {
  transition: transform 0.35s ease-out;
}
.card.compact {
  position: relative;
  inset: auto;
  height: min(62vh, 520px);
  cursor: pointer;
  touch-action: auto;
}
.card-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.photo-bars {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
}
.photo-bars span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.4);
}
.photo-bars span.on {
  background: #fff;
}
.card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 90px 18px 18px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55) 35%, rgba(0, 0, 0, 0.82));
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.card-name {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
}
.card-age {
  font-weight: 400;
}
.card-city {
  margin-top: 2px;
  opacity: 0.9;
}
.card-nationality {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
button.card-nationality {
  cursor: help;
}
.card-nationality.unverified {
  opacity: 0.75;
  font-weight: 400;
}
.card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.card-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 13px;
  backdrop-filter: blur(4px);
}
.card-chip.shared {
  background: var(--brand);
  font-weight: 700;
}
.card-bio {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  font-size: 15px;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
}

.tick {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--verified);
  color: #fff;
  flex: none;
  text-shadow: none;
}
.tick .icon {
  stroke-width: 3;
}
.card-name .tick {
  align-self: center;
}

.stamp {
  position: absolute;
  top: 34px;
  padding: 2px 12px;
  border: 4px solid;
  border-radius: 10px;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
}
.stamp.like {
  left: 22px;
  color: #3ddc97;
  transform: rotate(-16deg);
}
.stamp.nope {
  right: 22px;
  color: var(--brand1);
  transform: rotate(16deg);
}
.card.compact .stamp {
  display: none;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 36px;
  padding: 16px 0;
}
.round {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transition: transform 0.12s;
}
.round:hover {
  transform: scale(1.06);
}
.round:active {
  transform: scale(0.94);
}
.round.pass {
  color: var(--brand1);
}
.round.like {
  color: var(--ok);
}
.round.small {
  align-self: center;
  width: 48px;
  height: 48px;
}
.round.undo {
  color: #e0a100;
}
.round:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}
.round.mini {
  width: 40px;
  height: 40px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  text-align: center;
}
.empty h2 {
  margin: 12px 0 4px;
}
.empty .btn {
  width: auto;
  margin-top: 12px;
}
.empty .text-link {
  margin-top: 16px;
  font-size: 14px;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 79, 109, 0.12);
  color: var(--brand1);
}

/* ---------- Match overlay & modals ---------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 10, 20, 0.55);
  animation: fade 0.2s ease;
}
.overlay-panel {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 20px;
  border-radius: 20px;
  background: var(--surface);
  animation: pop 0.22s ease;
}
.overlay-panel h2 {
  margin-top: 0;
}
.overlay.sheet {
  align-items: flex-end;
  padding: 0;
}
.overlay.sheet .overlay-panel {
  padding: 8px;
  border-radius: 20px 20px 0 0;
  animation: slide-up 0.22s ease;
}

.match-overlay {
  background: linear-gradient(160deg, var(--brand1), var(--brand2));
}
.match-overlay .overlay-panel {
  background: none;
  color: #fff;
  text-align: center;
}
.match-inner {
  display: grid;
  gap: 12px;
}
.match-title {
  margin: 0;
  font-size: 40px;
  font-style: italic;
  letter-spacing: -0.03em;
}
.match-avatars {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}
.match-avatars img {
  width: 120px;
  height: 120px;
  border: 4px solid #fff;
  border-radius: 50%;
  object-fit: cover;
}
.match-avatars img + img {
  margin-left: -18px;
}
.match-shared {
  margin: 0 auto 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 700;
}
.match-overlay .btn.primary {
  background: #fff;
  color: var(--brand1);
}

.action-sheet {
  display: grid;
}
.action-sheet button {
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  cursor: pointer;
}
.action-sheet .cancel {
  border: 0;
  font-weight: 700;
}
.danger-text {
  color: var(--bad) !important;
}
.action-sheet.inline {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.profile-modal {
  display: grid;
  gap: 12px;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    transform: scale(0.94);
    opacity: 0;
  }
}
@keyframes slide-up {
  from {
    transform: translateY(100%);
  }
}

/* ---------- Likes, passed & blocked ---------- */

.section-hint {
  margin: -6px 0 12px;
}
.like-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.like-tile {
  display: grid;
  gap: 8px;
}
.like-photo {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 3 / 4;
  padding: 10px;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.like-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.like-photo::after {
  content: '';
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}
.like-name,
.like-town {
  position: relative;
  z-index: 1;
}
.like-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.like-name .tick {
  width: 16px;
  height: 16px;
}
.like-name .tick .icon {
  width: 11px;
  height: 11px;
}
.like-town {
  font-size: 13px;
  opacity: 0.9;
}
.like-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.person-list {
  display: grid;
  margin-top: 12px;
}
.person-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.person-row img {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
}
.person-placeholder {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}
.person-text {
  flex: 1;
  min-width: 0;
}
.person-name {
  font-weight: 700;
}
.person-row .btn {
  flex: none;
  padding: 0 14px;
}

/* ---------- Matches & chat ---------- */

.section-title {
  margin: 4px 0 12px;
  color: var(--brand1);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.new-matches {
  display: flex;
  gap: 14px;
  margin: 0 -16px 20px;
  padding: 0 16px 4px;
  overflow-x: auto;
}
.new-match {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.new-match img {
  width: 76px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
}
.new-match span,
.convo-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.new-match .tick,
.convo-name .tick,
.chat-title .tick {
  width: 16px;
  height: 16px;
}
.new-match .tick .icon,
.convo-name .tick .icon,
.chat-title .tick .icon {
  width: 11px;
  height: 11px;
}
.convo-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.convo {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.convo img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.convo-text {
  min-width: 0;
}
.convo-name {
  font-weight: 700;
}
.convo-preview {
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.chat-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.chat-title img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding: 16px;
}
.chat-intro {
  margin-bottom: 12px;
  text-align: center;
}
.chat-intro img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}
.chat-intro p {
  margin: 6px 0 0;
}
.bubble {
  max-width: 78%;
  padding: 9px 14px;
  border-radius: 20px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.bubble.mine {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: var(--brand);
  color: #fff;
}
.bubble.theirs {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: var(--surface-2);
}
.composer {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.composer input {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
}
.composer-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 46px;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.composer-btn:hover {
  color: var(--brand1);
}

/* Photos in chat */
.bubble.has-photo {
  display: grid;
  gap: 6px;
  max-width: min(268px, 78%);
  padding: 4px;
}
.bubble.has-photo .bubble-text {
  contain: inline-size;
  padding: 2px 10px 4px;
}
.bubble.unsent {
  font-style: italic;
  opacity: 0.7;
}
.muted-text {
  opacity: 0.75;
}
.bubble-photo {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  overflow: hidden;
  border-radius: 16px;
}
/* Photos they send stay blurred until tapped. */
.bubble-photo.veiled {
  cursor: pointer;
}
/* Flagged by the automatic check: blurred harder, with a warning. */
.bubble-photo.veiled.warn img {
  filter: blur(48px) grayscale(0.6);
}
.bubble-photo.veiled img {
  width: 220px;
  height: 220px;
  max-width: 100%;
  filter: blur(28px);
  transform: scale(1.1);
}
.veil-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgb(0 0 0 / 0.3);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
}
.bubble-photo img {
  display: block;
  max-width: min(260px, 100%);
  max-height: 320px;
  border-radius: 16px;
  object-fit: cover;
}
.photo-viewer {
  display: grid;
  gap: 12px;
}
.photo-viewer img,
.photo-preview {
  display: block;
  width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  object-fit: contain;
  background: var(--surface-2);
}
.photo-preview {
  max-height: 50vh;
  margin-bottom: 12px;
}
.camera-preview {
  display: block;
  width: 100%;
  max-height: 60vh;
  border-radius: 12px;
  background: #000;
  transform: scaleX(-1);
}

/* Sent / delivered / read */
.ticks {
  margin-left: 6px;
  font-size: 12px;
  letter-spacing: -3px;
  opacity: 0.7;
  white-space: nowrap;
}
.bubble.has-photo .ticks {
  justify-self: end;
  padding: 0 8px 4px;
}
.ticks[data-state='read'] {
  padding: 0 6px 0 3px;
  border-radius: 8px;
  background: #fff;
  color: var(--verified);
  font-weight: 700;
  opacity: 1;
}
.receipt-line {
  align-self: flex-end;
  margin-top: -2px;
  color: var(--muted);
  font-size: 12px;
}
.convo.unread .convo-name,
.convo.unread .convo-preview {
  color: var(--text);
  font-weight: 700;
}
.convo .unread-count {
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 6px;
  flex: none;
  border-radius: 999px;
  background: var(--brand1);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}
.send {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  flex: none;
  cursor: pointer;
}

/* ---------- Profile & verification ---------- */

.preview-wrap {
  max-width: 340px;
  margin: 0 auto;
}
.preview-wrap .card.compact {
  height: 440px;
}
.status-link {
  text-decoration: none;
}
.verify-status {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}
.verify-status .icon {
  flex: none;
  color: var(--muted);
}
.verify-status.ok {
  background: rgba(43, 140, 255, 0.1);
}
.verify-status.ok .icon {
  color: var(--verified);
}
.verify-status strong {
  display: block;
  font-size: 15px;
}

.menu-list {
  display: grid;
  margin: 8px 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.menu-list a,
.menu-list button {
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-list > :last-child {
  border-bottom: 0;
}

.explainer {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 14px;
}
.explainer p {
  margin: 0 0 8px;
  font-weight: 600;
}
.explainer ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.demo-box {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1.5px dashed var(--brand2);
  border-radius: var(--radius);
}
.demo-box p {
  margin: 4px 0 10px;
}
.demo-row {
  display: flex;
  gap: 8px;
}
.demo-row select {
  min-width: 0;
}
textarea.mrz {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: pre;
  overflow-x: auto;
}
.verify-result h3 {
  margin: 20px 0 8px;
}
.checklist {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
}
.checklist .detail {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.check-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}
.checklist .ok .check-icon {
  background: var(--ok);
}
.checklist .bad .check-icon {
  background: var(--bad);
}
/* Recommended, not done yet */
.checklist .warn .check-icon {
  background: #c98a00;
}

/* ---------- Toasts ---------- */

.toast {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 100;
  width: fit-content;
  max-width: min(420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 12px;
  background: #22222b;
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.error {
  background: var(--bad);
}
.boot-splash {
  display: grid;
  place-items: center;
  min-height: 100%;
  background: var(--brand);
}
.boot-splash img {
  border-radius: 26px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  animation: boot-pulse 1.4s ease-in-out infinite;
}
@keyframes boot-pulse {
  50% {
    transform: scale(1.06);
  }
}
@media (prefers-reduced-motion: reduce) {
  .boot-splash img {
    animation: none;
  }
}
.boot-error {
  padding: 24px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Location & filters ---------- */

.country-picker {
  display: grid;
  gap: 8px;
}
.chip.empty {
  border-style: dashed;
  color: var(--muted);
  cursor: default;
}
.location-current {
  margin: 12px 0;
}
.location-pill {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.location-pill > span {
  font-size: 22px;
}
.place-results {
  display: grid;
  margin-top: 6px;
  border-radius: 12px;
  overflow: hidden;
}
.place-option {
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.place-option:hover,
.place-option:focus-visible {
  background: rgba(255, 79, 109, 0.08);
}
.radius-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.radius-row input {
  max-width: 120px;
}
.form-section + .form-section {
  margin-top: 28px;
}

/* ---------- Email confirmation & goals ---------- */

.stack {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.center-block {
  margin: 8px auto 16px;
  font-size: 36px;
}
.error-text {
  color: var(--bad);
}
.card-goals {
  margin-top: 6px;
  font-size: 14px;
  opacity: 0.95;
}

.needs-attention {
  padding: 10px 12px;
  border: 2px solid var(--brand1);
  border-radius: var(--radius);
  background: rgba(255, 79, 109, 0.06);
}
.update-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 100;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px 10px 16px;
  border-radius: 999px;
  background: #22222b;
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  white-space: nowrap;
}
.update-bar .btn {
  min-height: 34px;
  background: #fff;
  color: #22222b;
}
.ok-text {
  color: var(--ok);
  font-weight: 600;
}

/* ---------- Sign in with Google, Apple, Facebook, Microsoft ---------- */

.provider-buttons {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.btn.provider {
  gap: 10px;
  border: 1px solid transparent;
  font-weight: 600;
}
.btn.provider svg {
  flex: none;
}
/* Colours follow each provider's button guidelines. */
.btn.provider.google {
  border-color: #747775;
  background: #fff;
  color: #1f1f1f;
}
.btn.provider.apple {
  background: #000;
  color: #fff;
}
/* Apple's guidelines: a black button isn't used on a dark background. */
@media (prefers-color-scheme: dark) {
  .btn.provider.apple {
    background: #fff;
    color: #000;
  }
}
.btn.provider.facebook {
  background: #1877f2;
  color: #fff;
}
.btn.provider.microsoft {
  border-color: #8c8c8c;
  background: #fff;
  color: #5e5e5e;
}
.or-divider {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--line);
}
.provider-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-2);
}

/* ---------- Notifications ---------- */

.hint.block {
  display: block;
  margin-top: 2px;
}
.push-banner {
  margin-bottom: 16px;
}
.oauth-message {
  margin: 0 0 14px;
}

/* Owner tools: reports */
.segmented {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2, rgb(0 0 0 / 0.06));
}
.segmented a {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}
.segmented a.on {
  background: var(--brand1);
  color: #fff;
}
.report-item.urgent {
  border-left: 4px solid #d93025;
}
.report-photos {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 8px 0;
}
.report-photos img {
  width: 72px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
}
.report-quote {
  margin: 6px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.report-evidence {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 12px;
}

/* Policy pages shown inside the app */
.policy {
  max-height: 70vh;
  overflow-y: auto;
  line-height: 1.55;
}
.policy h1 {
  margin: 0 0 4px;
  font-size: 22px;
}
.policy h2 {
  margin: 20px 0 6px;
  font-size: 17px;
}
.policy .updated {
  color: var(--muted);
  font-size: 13px;
}
.policy .warning {
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff3cd;
  color: #664d03;
}
.policy li {
  margin: 4px 0;
}
.welcome-legal {
  margin: 4px 0 0;
  font-size: 13px;
  text-align: center;
  color: rgb(255 255 255 / 0.85);
}
.welcome-legal a {
  color: #fff;
}
.menu-heading {
  margin: 24px 4px 8px;
  font-size: 15px;
  color: var(--muted);
}
.forgot-link {
  margin: -4px 0 0;
  text-align: right;
  font-size: 14px;
}
.launch-check summary {
  font-weight: 700;
  cursor: pointer;
}
.launch-check.urgent {
  border-left: 4px solid #d93025;
}

/* Owner tools: notes for the app reviewer */
textarea.review-notes {
  width: 100%;
  font: 0.85rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin: 8px 0;
  white-space: pre-wrap;
}

/* Heritage: "Prefer not to say" sits apart from the groups */
.chips.prefer-not {
  margin-top: 12px;
}

/* ---------- Subscription ---------- */

.paywall-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand1) 8%, var(--surface));
  font-size: 14px;
}
.paywall-bar p {
  flex: 1;
  margin: 0;
}
.paywall-bar .btn {
  flex: none;
  width: auto;
}
.plans {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
.plan,
.plan-current {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.plan-name {
  font-weight: 700;
}
.plan-price {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.plan .btn {
  margin-top: 6px;
}
.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
}
.notice.ok {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
}
.stats {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}
.stats > div {
  flex: 1;
  display: grid;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
}
.stats strong {
  font-size: 24px;
}
.stats span {
  color: var(--muted);
  font-size: 13px;
}
.plan-editor {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.plan-edit {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.plan-edit-price {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ---------- Wide screens: computers and landscape tablets ----------
   Phones keep the app layout above. From 900px wide the app fills the
   window: a sidebar replaces the tab bar, pages sit in a readable column,
   and sheets become dialogs. From 1100px Matches opens chats beside the
   list (app.js adds .split then). */

.tabs .nav-brand,
.tabs.wide-only {
  display: none;
}

@media (min-width: 900px) {
  body {
    padding: 0;
  }
  .shell {
    max-width: none;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg);
  }

  /* Sidebar | (list) | page */
  .screen.with-nav {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      'nav header'
      'nav main';
  }
  .screen.with-nav:not(:has(> .topbar)) {
    grid-template-areas:
      'nav main'
      'nav main';
  }
  .screen.split {
    grid-template-columns: 240px 360px minmax(0, 1fr);
    grid-template-areas:
      'nav aside header'
      'nav aside main';
  }
  .screen.split:not(:has(> .topbar)) {
    grid-template-areas:
      'nav aside main'
      'nav aside main';
  }
  .screen > .topbar {
    grid-area: header;
    background: var(--surface);
  }
  .screen > main {
    grid-area: main;
    min-height: 0;
    background: var(--surface);
  }
  .screen.with-nav > main.content {
    overflow-y: auto;
  }

  .tabs,
  .tabs.wide-only {
    grid-area: nav;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 14px;
    border-top: 0;
    border-right: 1px solid var(--line);
    background: var(--surface);
  }
  .tabs .nav-brand {
    display: block;
    flex: none;
    padding: 4px 12px 20px;
    color: transparent;
    font-size: 30px;
  }
  .tabs a:not(.nav-brand) {
    flex: none;
    flex-direction: row;
    gap: 14px;
    padding: 11px 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
  }
  .tabs a:not(.nav-brand):hover {
    background: var(--surface-2);
    color: var(--text);
  }
  .tabs a.active,
  .tabs a.active:hover {
    background: color-mix(in srgb, var(--brand1) 12%, transparent);
    color: var(--brand1);
  }
  .tab-badge {
    position: static;
    margin-left: auto;
  }
  /* The sidebar shows the name, so the Discover header doesn't repeat it. */
  .screen.with-nav > .topbar .brand {
    visibility: hidden;
  }

  /* Pages in a readable column, centred in the space beside the sidebar. */
  main.content {
    padding: 28px max(28px, calc((100% - 680px) / 2));
  }
  /* Save bars stick to the bottom edge of the wider padding. */
  .sticky-actions {
    bottom: -28px;
    margin-bottom: -28px;
    padding-bottom: 28px;
  }
  .screen > .topbar {
    padding-inline: max(16px, calc((100% - 712px) / 2));
  }
  .screen.with-nav > .topbar {
    padding-inline: 20px;
  }

  /* Discover: a portrait card in the middle, not stretched across the window. */
  main.deck-wrap {
    padding: 24px max(24px, calc((100% - 460px) / 2)) 8px;
  }
  .deck {
    max-height: 760px;
  }

  /* Matches beside the chat */
  .match-pane {
    grid-area: aside;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--line);
    background: var(--surface);
  }
  .match-pane-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
  }
  .match-pane .convo {
    margin: 0 -8px;
    padding: 10px 8px;
    border-radius: 12px;
  }
  .match-pane .convo:hover,
  .match-pane .new-match:hover img {
    background: var(--surface-2);
  }
  .match-pane .convo.active {
    background: color-mix(in srgb, var(--brand1) 12%, transparent);
  }
  .match-pane .new-match.active img {
    outline: 3px solid var(--brand1);
    outline-offset: 2px;
  }
  .screen.split .back-btn {
    display: none;
  }
  /* The list's header lines up with the chat's. */
  .screen.split > .topbar,
  .match-pane > .topbar {
    height: 60px;
  }

  /* Chat: messages and composer in a column, full-width scroll area. */
  main.chat .messages {
    padding-inline: max(24px, calc((100% - 760px) / 2));
  }
  main.chat .composer {
    padding-inline: max(16px, calc((100% - 776px) / 2));
  }
  .bubble {
    max-width: min(78%, 520px);
  }

  /* Sheets and dialogs float in the middle of the window. */
  .overlay {
    position: fixed;
  }
  .overlay-panel {
    max-width: 480px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
  }
  .overlay.sheet {
    align-items: center;
    padding: 20px;
  }
  .overlay.sheet .overlay-panel {
    max-width: 400px;
    border-radius: 20px;
    animation: pop 0.22s ease;
  }
  .overlay-panel:has(.photo-viewer),
  .overlay-panel:has(.camera-preview),
  .overlay-panel:has(.policy) {
    max-width: 760px;
  }
  .action-sheet button:hover {
    background: var(--surface-2);
  }

  /* Welcome: the pitch on the left, sign-in on the right. */
  .welcome {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(48px, 8vw, 120px);
    padding: 48px;
    /* More of the photo shows on a big screen: the colours fade in from the right. */
    background:
      linear-gradient(100deg, rgba(255, 79, 109, 0.62) 0%, rgba(255, 98, 92, 0.78) 45%, rgba(255, 138, 61, 0.9) 100%),
      url('/images/welcome-couple.jpg') center 28% / cover no-repeat,
      var(--brand1);
  }
  .welcome-hero {
    flex: 0 1 520px;
    text-align: left;
  }
  .welcome h1 {
    font-size: 64px;
  }
  .welcome:has(.provider-buttons) .welcome-points {
    display: grid;
  }
  .welcome:has(.provider-buttons) .tagline {
    margin-bottom: 28px;
  }
  .welcome-actions {
    flex: 0 0 380px;
    padding: 28px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
  }
}
