/* Connect the Dot — modern & minimal */

:root {
  --bg: #FBFAF6;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --muted: #6B6963;
  --border: #E8E4DC;
  --accent: #C75E48;
  --accent-soft: #F4E3DE;
  --sage: #8A9A8B;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.04);
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 246, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color .15s ease;
}

.nav-links a:hover, .nav-links a.active { color: var(--text); }

/* ---------- Mobile hamburger ---------- */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
header.site.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
header.site.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
header.site.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Small-screen polish (under ~520px) ---------- */
@media (max-width: 520px) {
  .container { padding: 0 16px; }

  .hero { padding: 40px 0 24px; }
  .hero .lede { font-size: 1.05rem; }
  .hero .cta-row { gap: 8px; }
  .hero .meta { margin-left: 0; flex-basis: 100%; }

  section.block { padding: 48px 0; }
  .section-head { margin-bottom: 24px; }
  .section-head h2 { font-size: 1.6rem; }

  .page-head { padding: 32px 0 16px; }
  .page-head h1 { font-size: 1.7rem; }

  .auth-wrap { padding: 24px 16px; min-height: auto; }
  .auth-card { padding: 28px 22px; }
  .auth-card h1 { font-size: 1.6rem; }

  .featured-card { padding: 18px; gap: 18px; }
  .featured-body h2 { font-size: 1.5rem; }

  .group-card { padding: 18px; }
  .group-card h3 { font-size: 1.05rem; }

  .profile { padding: 32px 0 48px; gap: 20px; }
  .profile-info h1 { font-size: 1.7rem; }
  .profile-info h2 { font-size: 1rem; margin-top: 16px; }

  .about-hero { padding: 56px 0 16px; }
  .about-hero h1 { font-size: 2rem; }
  .step { padding: 16px 0; gap: 16px; grid-template-columns: 56px 1fr; }
  .step .marker { font-size: 1.1rem; }
  .step h3 { font-size: 1.15rem; }

  footer.site { padding: 32px 0 40px; }
  footer.site .row { gap: 8px; font-size: 0.85rem; }

  /* Bigger chip touch targets on phones (thumbs > mouse precision). */
  .chip-interest { padding: 8px 14px; font-size: 0.9rem; }
  .pill-option span { padding: 10px 16px; font-size: 0.92rem; }
  .tag { padding: 5px 12px; font-size: 0.82rem; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  header.site .nav-links {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 20px;
    z-index: 49;
    box-shadow: var(--shadow);
  }
  header.site.nav-open .nav-links {
    display: flex;
  }
  header.site .nav-links a {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    color: var(--text);
  }
  header.site .nav-links a:last-child {
    border-bottom: 0;
  }
  header.site .nav-links a.btn-accent {
    margin-top: 14px;
    align-self: flex-start;
    border-bottom: 0;
    color: #fff;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, color .15s ease, border-color .15s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { background: #000; }

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: #B14F3B; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--text); }

.btn:active { transform: translateY(1px); }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 64px;
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
  max-width: 14ch;
}

.hero h1 .accent {
  color: var(--accent);
  font-style: italic;
}

.hero p.lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 32px;
}

.hero .cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: 8px;
}

.hero-art {
  position: absolute;
  right: -40px;
  top: 80px;
  width: 420px;
  max-width: 40vw;
  opacity: 0.95;
  pointer-events: none;
}

@media (max-width: 880px) {
  .hero-art { display: none; }
  .hero { padding: 56px 0 32px; }
}

/* ---------- Sections ---------- */
section.block {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin-bottom: 40px;
}
.section-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.15;
}
.section-head p {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card .num {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--accent);
  font-size: 1.05rem;
  font-style: italic;
  margin-bottom: 12px;
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.card p {
  color: var(--muted);
  margin: 0;
  font-size: 0.97rem;
}

/* ---------- Footer ---------- */
footer.site {
  border-top: 1px solid var(--border);
  padding: 48px 0 64px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

footer.site .row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

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

/* ---------- Forms (sign in / up) ---------- */
.auth-wrap {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
  padding: 48px 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}
.auth-card p.sub {
  color: var(--muted);
  margin: 0 0 28px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 28px;
}

.tab {
  border: 0;
  background: transparent;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: inherit;
  font-size: 0.97rem;
  color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.form-foot {
  margin-top: 8px;
}

.form-foot .btn { width: 100%; }

.form-foot .note {
  text-align: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}
.form-foot .note a { color: var(--accent); }

/* ---------- Browse (matches) ---------- */
.page-head {
  padding: 56px 0 24px;
}
.page-head h1 {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  margin-bottom: 8px;
}
.page-head p {
  color: var(--muted);
  margin: 0;
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 80px;
}
@media (max-width: 900px) { .match-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .match-grid { grid-template-columns: 1fr; } }

.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.match-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.match-card .photo {
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, var(--accent-soft), #EFE7DF);
  position: relative;
  overflow: hidden;
}
.match-card .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.match-card .body {
  padding: 18px 20px 22px;
}

.match-card h3 {
  font-size: 1.15rem;
  margin: 0 0 4px;
}
.match-card h3 .age {
  color: var(--muted);
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  margin-left: 4px;
  font-style: normal;
}
.match-card .loc {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 14px;
}
.match-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ---------- Profile detail ---------- */
.profile {
  padding: 56px 0 80px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
}
@media (max-width: 820px) {
  .profile { grid-template-columns: 1fr; gap: 24px; }
}

.profile-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), #EFE7DF);
  overflow: hidden;
  position: relative;
}
.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-info h1 {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  margin-bottom: 4px;
}
.profile-info .meta {
  color: var(--muted);
  margin-bottom: 24px;
}

.profile-info h2 {
  font-size: 1.1rem;
  margin: 24px 0 8px;
  letter-spacing: 0;
}

.profile-info p { color: var(--text); margin: 0 0 12px; }

.profile-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.prompt-list {
  display: grid;
  gap: 14px;
  margin: 8px 0 0;
}
.prompt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.prompt .q {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 6px;
}
.prompt .a {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.1rem;
}

/* ---------- About / How it works ---------- */
.about-hero {
  padding: 96px 0 32px;
  max-width: 760px;
}
.about-hero h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  line-height: 1.1;
}
.about-hero p {
  font-size: 1.15rem;
  color: var(--muted);
}

.steps {
  display: grid;
  gap: 24px;
  margin: 32px 0;
}

.step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}
.step:last-child { border-bottom: 1px solid var(--border); }

.step .marker {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  font-style: italic;
  color: var(--accent);
}

.step h3 {
  font-size: 1.35rem;
  margin: 0 0 6px;
}
.step p {
  margin: 0;
  color: var(--muted);
}

/* ---------- Featured: today's match ---------- */
.featured-wrap { padding: 8px 0 40px; }
.featured-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  align-items: center;
  box-shadow: var(--shadow);
}
.featured-photo {
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-soft), #EFE7DF);
}
.featured-photo img { width:100%; height:100%; object-fit:cover; display:block; }
.featured-body h2 { font-size: 1.8rem; margin: 8px 0 4px; }
.featured-body p.meta { color: var(--muted); margin: 0 0 12px; }
.empty-card {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
}

.match-reason {
  margin: 6px 0 10px;
  font-size: 0.85rem;
  color: var(--accent);
  font-style: italic;
  font-family: 'Fraunces', Georgia, serif;
  line-height: 1.4;
}
.match-reason-featured {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--accent);
  line-height: 1.4;
  margin: 8px 0 12px;
}
@media (max-width: 760px) {
  .featured-card { grid-template-columns: 1fr; }
}

/* ---------- Messages page ---------- */
.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 32px 0 80px;
}
@media (max-width: 820px) {
  .messages-layout {
    grid-template-columns: 1fr;
    padding: 20px 0 48px;
    gap: 14px;
  }
  /* Cap the list so the thread is still reachable in the same scroll pane. */
  .match-list { max-height: 260px; }
  .thread { min-height: 55vh; scroll-margin-top: 76px; }
  .thread-body { max-height: 50vh; }
}
.match-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  max-height: 70vh;
  overflow-y: auto;
}
.match-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background .15s ease;
}
.match-row:hover { background: var(--bg); }
.match-row.active { background: var(--accent-soft); }
.match-row img {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
}
.match-row-name { font-weight: 500; }
.match-row-meta { font-size: 0.85rem; color: var(--muted); }

.thread {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 60vh;
}
.thread-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.thread-head-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.thread-head img {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.thread-head-name { font-weight: 500; }
.thread-head-meta { font-size: 0.85rem; color: var(--muted); }

.thread-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 55vh;
}
.bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.97rem;
}
.bubble.mine {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.bubble.theirs {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 6px;
}
.bubble-sender {
  font-size: 0.72rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--accent);
}
.bubble-time {
  font-size: 0.7rem;
  opacity: 0.65;
  margin-top: 4px;
  text-align: right;
}

.group-thread { margin-top: 8px; }
.group-thread .thread-body { max-height: 50vh; }
.bubble.theirs .bubble-time { text-align: left; }

.thread-empty {
  margin: auto;
  text-align: center;
  padding: 24px;
}

.thread-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.thread-form input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.97rem;
  background: var(--bg);
}
.thread-form input:focus { outline: none; border-color: var(--accent); background: var(--surface); }

/* ---------- Interest chips ---------- */
.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-interest {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .08s ease;
}
.chip-interest:hover:not(:disabled) { border-color: var(--text); }
.chip-interest.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chip-interest:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.chip-interest:active:not(:disabled) { transform: translateY(1px); }
.chip-cloud.view-only .chip-interest { cursor: default; }
.chip-emoji { font-size: 1rem; line-height: 1; }
.chip-status {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1em;
}

/* ---------- Groups list ---------- */
.create-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.create-group summary {
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  color: var(--accent);
}
.create-group summary::-webkit-details-marker { display: none; }
.create-group[open] summary { margin-bottom: 16px; }
.create-group-form .field { margin-bottom: 14px; }

.group-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding-bottom: 80px;
}
@media (max-width: 720px) { .group-grid { grid-template-columns: 1fr; } }

.group-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease;
}
.group-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.group-card h3 {
  font-size: 1.2rem;
  margin: 0 0 4px;
}
.group-meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 8px;
}
.group-desc {
  color: var(--text);
  margin: 0 0 4px;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ---------- Group detail members ---------- */
.member-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 720px) { .member-grid { grid-template-columns: repeat(2, 1fr); } }
.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text);
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.member-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.member-card img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  display: block;
}
.member-name { font-weight: 500; font-size: 0.95rem; }
.member-role { color: var(--accent); font-weight: 400; font-style: italic; font-size: 0.85rem; }
.member-loc {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}
.badge-creator {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
}

/* ---------- Photo & video gallery ---------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 480px) { .media-grid { grid-template-columns: repeat(3, 1fr); } }

.media-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.media-tile img, .media-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  background: rgba(0,0,0,0.65);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}
.media-badge-primary {
  background: var(--accent);
  color: #fff;
}
.media-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  display: grid;
  place-items: center;
  transition: background .15s ease, transform .08s ease;
}
.media-delete:hover { background: var(--accent); }
.media-delete:active { transform: scale(0.95); }
.media-delete:disabled { opacity: 0.5; cursor: default; }

.media-add {
  aspect-ratio: 1 / 1;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
  text-align: center;
  padding: 8px;
}
.media-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.media-add-plus { font-size: 1.6rem; line-height: 1; font-family: 'Fraunces', Georgia, serif; }
.media-add-label { font-size: 0.78rem; }

.media-status {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1em;
}

.media-grid.view-only .media-tile { aspect-ratio: 1 / 1; }
.media-grid.view-only { margin-top: 8px; }

/* ---------- Location row (profile edit) ---------- */
.loc-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.loc-row input { flex: 1; min-width: 0; }
.loc-row .btn {
  white-space: nowrap;
  padding: 10px 14px;
  font-size: 0.88rem;
}
.loc-status {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1em;
}
@media (max-width: 520px) {
  .loc-row { flex-direction: column; }
}

/* ---------- Preference pills (profile edit) ---------- */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill-option {
  position: relative;
  cursor: pointer;
}
.pill-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pill-option span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9rem;
  color: var(--text);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pill-option:hover span { border-color: var(--text); }
.pill-option input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pill-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Preference list (profile view) ---------- */
.pref-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 0 0 16px;
  font-size: 0.95rem;
}
.pref-list > div { display: contents; }
.pref-list dt { color: var(--muted); }
.pref-list dd { margin: 0; color: var(--text); }

/* ---------- Auth error box ---------- */
.auth-error {
  display: none;
  background: #FDECE7;
  color: #B14F3B;
  border: 1px solid #F4C7BC;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
