/* ==========================================================================
   LoveOli — modern design system
   Light/dark themes, responsive (mobile → tablet → desktop), component styles.
   Colours are driven by CSS variables so the whole app re-themes in one place.
   ========================================================================== */

:root {
  --brand-1: #38bdf8;   /* sky blue */
  --brand-2: #6ac4fd;   /* blue     */
  --brand-3: #3b82f6;   /* blue     */

  --bg:        #f5f6fb;
  --bg-soft:   #eef0f7;
  --slider-soft:   #ebebeb;
  --surface:   #ffffff;
  --surface-2: #f8f9fd;
  --text:      #1b1e2b;
  --muted:     #6b7280;
  --border:    #e6e8f0;
  --ring:      rgba(59, 130, 246, .35);

  --success:   #22c55e;
  --danger:    #ef4444;
  --warning:   #f59e0b;
  --online:    #22c55e;
  --offline:   #9aa3b2;

  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 6px 24px rgba(20, 20, 50, .08);
  --shadow-lg: 0 18px 50px rgba(20, 20, 50, .16);

  --header-h:  64px;
  --footer-h:  75px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Poppins', var(--font-body);
}

[data-theme="dark"] {
  --bg:        #0e1020;
  --bg-soft:   #141830;
  --surface:   #181c30;
  --surface-2: #1f2438;
  --text:      #eceefb;
  --muted:     #9aa3b8;
  --border:    #2a3050;
  --ring:      rgba(59, 130, 246, .5);
  --shadow:    0 6px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .5);
  --offline:   #5c6479;
}

/* Respect OS preference when the user hasn't chosen a theme manually. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0e1020; --bg-soft:#141830; --surface:#181c30; --surface-2:#1f2438;
    --text:#eceefb; --muted:#9aa3b8; --border:#2a3050; --ring:rgba(59, 130, 246, .5);
    --shadow:0 6px 24px rgba(0,0,0,.35); --shadow-lg:0 18px 50px rgba(0,0,0,.5);
    --offline:#5c6479;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-y: scroll; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.brand-text {
  background: none;
  -webkit-background-clip: initial; background-clip: initial;
  -webkit-text-fill-color: currentColor; color: var(--brand-2);
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.page { padding: 28px 0 64px; min-height: calc(100vh - var(--header-h)); }
.page-narrow { max-width: 760px; }
.section-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 20px; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h); min-height: var(--header-h); flex: 0 0 var(--header-h);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-head); font-weight: 800; font-size: 1.15rem;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .heart {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: block;
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a.navlink,
.nav #chat a {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: none;
  transition: background .15s, color .15s;
}
.nav a.navlink:hover, .nav #chat a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.nav a.navlink.active, .nav #chat a.active { color: var(--text); background: color-mix(in srgb, var(--brand-2) 14%, transparent); }
.nav a.navlink.active::after, .nav #chat a.active:after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px;
  border-radius: 2px; background: var(--brand-2);
}

/* Unread chat badge (populated by the pollers as data-badge) */
.nav #chat a[data-badge]::after {
  content: attr(data-badge);
  position: absolute; top: 1px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--brand-1); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; display: grid; place-items: center; line-height: 18px;
  box-shadow: 0 0 0 2px var(--surface);
}

.icon-btn {
  width: 40px; height: 40px; flex: none; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); border-radius: 11px;
  display: grid; place-items: center; cursor: pointer; font-size: 17px;
  transition: background .15s, transform .1s;
}
.icon-btn:hover { background: var(--bg-soft); }
.icon-btn:active { transform: scale(.94); }

/* Hamburger: hidden on desktop; on mobile it sits flush right in the header. */
.nav-toggle { display: none; margin-left: auto; }

/* Mobile nav */
@media (max-width: 860px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px; box-shadow: var(--shadow-lg);
    transform: translateY(-140%); transition: transform .28s cubic-bezier(.4,0,.2,1);
    max-height: calc(100vh - var(--header-h)); overflow: auto;
  }
  .nav.open { transform: translateY(0); }
  .nav a.navlink, .nav #chat a { padding: 13px 14px; font-size: 1rem; }
  .nav a.navlink.active::after { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem; line-height: 1;
  cursor: pointer; text-decoration: none; transition: transform .08s, box-shadow .15s, opacity .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-2); color: #fff; box-shadow: none; }
.btn-primary:hover { color: #fff; background: color-mix(in srgb, var(--brand-2) 88%, black); box-shadow: none; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; border-radius: 14px; }
.btn-sm { padding: 8px 13px; font-size: .85rem; border-radius: 10px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field > label, .form-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 7px; color: var(--text); }
.input, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--ring); }
textarea { resize: vertical; min-height: 110px; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.help-block, .field-error { display: block; font-size: .82rem; margin-top: 6px; color: var(--danger); }
.field-hint { display: block; font-size: .82rem; margin-top: 6px; color: var(--muted); }
.input-wrap { position: relative; }
.input-wrap .toggle-pw {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px; font-size: 15px;
}
.input-wrap .toggle-pw:hover { background: var(--bg-soft); }

/* Auth pages */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: 32px 18px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card-pad { padding: 30px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head p { color: var(--muted); margin: 6px 0 0; }
.auth-alt { text-align: center; margin-top: 18px; color: var(--muted); font-size: .92rem; }
.auth-alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 600;
}
.auth-alert a {
  font-weight: 800;
}
.auth-alert.success {
  color: color-mix(in srgb, var(--success) 72%, var(--text));
  border-color: color-mix(in srgb, var(--success) 38%, var(--border));
}
.auth-alert.error {
  color: color-mix(in srgb, var(--danger) 72%, var(--text));
  border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
}

/* Generic settings/detail form used by match & update_profile */
.form-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.profile-form { display: grid; gap: 18px; }
.form-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}
.form-section h2 {
  margin: 0 0 14px;
  font-size: 1rem;
}
.section-fields {
  display: grid;
  gap: 25px;
  align-items: start;
}
@media (min-width: 720px) {
  .section-fields.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-fields.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section-fields.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.profile-form .field { margin-bottom: 0; }
.section-fields + .toggle-grid {
  margin-top: 16px;
}
.radio-row, .toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 600;
}
.radio-row input { width: auto; margin: 0; }
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.toggle-grid .switch-toggle {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin: 0;
}
.range-field {
  min-width: 0;
}
.range-field .slidecontainer,
.range-field .ui-slider {
  margin-top: 10px;
}

/* ---------- Profile / user card grid (matches, favourites, blocked) ---------- */
.card-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}


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

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

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


.ucard {
  position: relative; display: block; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: var(--text);
  transition: transform .15s, box-shadow .15s;
}
.ucard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.ucard .thumb { aspect-ratio: 1/1; width: 100%; object-fit: cover; background: var(--bg-soft); }
.ucard .ucard-body { padding: 12px 14px 14px; }
.ucard .uname { font-weight: 700; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.ucard .umeta { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.status-dot.on { background: var(--online); box-shadow: 0 0 0 3px color-mix(in srgb, var(--online) 25%, transparent); }
.status-dot.off { background: var(--offline); }
.pill {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  color: #fff; background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
  display: inline-flex; align-items: center; gap: 6px;
}
.pill.on { background: color-mix(in srgb, var(--online) 88%, black); }

/* Toolbar above listings */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.toolbar .grow { flex: 1 1 auto; }
.toolbar .match-preferences-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  min-height: 49px; padding: 0 16px; color: var(--text); font-weight: 700;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: background .15s, transform .08s;
}
.toolbar .match-preferences-btn:hover { background: var(--bg-soft); text-decoration: none; }
.toolbar .match-preferences-btn:active { transform: translateY(1px); }
.sort-select { max-width: 260px; }

/* Empty state */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 44px; margin-bottom: 8px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 28px 0; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .9rem; text-decoration: none;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
}
.pagination a:hover { background: var(--bg-soft); text-decoration: none; }
.pagination span.current { background: var(--brand-2); color: #fff; border-color: transparent; }
.pagination span.disabled { color: var(--muted); opacity: .5; }

/* ---------- Profile detail page ---------- */
.profile-hero { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.profile-hero .avatar {
  width: 128px; height: 128px; 
/*   border-radius: 24px; */
  border-radius: 50%;
  corner-shape: superellipse(1.32);
  clip-path: polygon(100% 50%, 99.8% 57.8%, 99.2% 63.5%, 98.3% 68.6%, 96.9% 73.2%, 95.2% 77.4%, 93.1% 81.2%, 90.7% 84.7%, 87.9% 87.9%, 84.7% 90.7%, 81.2% 93.1%, 77.4% 95.2%, 73.2% 96.9%, 68.6% 98.3%, 63.5% 99.2%, 57.8% 99.8%, 50% 100%, 42.2% 99.8%, 36.5% 99.2%, 31.4% 98.3%, 26.8% 96.9%, 22.6% 95.2%, 18.8% 93.1%, 15.3% 90.7%, 12.1% 87.9%, 9.3% 84.7%, 6.9% 81.2%, 4.8% 77.4%, 3.1% 73.2%, 1.7% 68.6%, 0.8% 63.5%, 0.2% 57.8%, 0% 50%, 0.2% 42.2%, 0.8% 36.5%, 1.7% 31.4%, 3.1% 26.8%, 4.8% 22.6%, 6.9% 18.8%, 9.3% 15.3%, 12.1% 12.1%, 15.3% 9.3%, 18.8% 6.9%, 22.6% 4.8%, 26.8% 3.1%, 31.4% 1.7%, 36.5% 0.8%, 42.2% 0.2%, 50% 0%, 57.8% 0.2%, 63.5% 0.8%, 68.6% 1.7%, 73.2% 3.1%, 77.4% 4.8%, 81.2% 6.9%, 84.7% 9.3%, 87.9% 12.1%, 90.7% 15.3%, 93.1% 18.8%, 95.2% 22.6%, 96.9% 26.8%, 98.3% 31.4%, 99.2% 36.5%, 99.8% 42.2%);
  
  object-fit: cover;
  border: 1px solid var(--surface); box-shadow: var(--shadow); background: var(--bg-soft);
  
}
.profile-hero .who h1 { margin: 0 0 4px; }
.profile-hero .who .sub { color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.profile-alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
}
.profile-alert.success {
  color: color-mix(in srgb, var(--success) 72%, var(--text));
  border-color: color-mix(in srgb, var(--success) 38%, var(--border));
}
.profile-alert.error {
  color: color-mix(in srgb, var(--danger) 72%, var(--text));
  border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
}
.report-panel {
  max-width: 520px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.report-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}
.report-panel[open] summary {
  margin-bottom: 12px;
  color: var(--text);
}
.report-panel form,
.report-grid {
  display: grid;
  gap: 10px;
}
.report-grid label {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 700;
}
.report-grid textarea {
  min-height: 86px;
}
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.meta-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.meta-item .k { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.meta-item .v { font-weight: 700; margin-top: 2px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.gallery .gitem { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.gallery .gitem img { aspect-ratio: 1/1; object-fit: cover; cursor: pointer; transition: transform .2s; width: 100%; }
.gallery .gitem:hover img { transform: scale(1.05); }
.gallery .gitem.is-profile { outline: 3px solid var(--brand-2); outline-offset: -3px; }
.sortable-gallery .gitem { user-select: none; }
.sortable-gallery .gitem.dragging {
  box-shadow: var(--shadow-lg);
  cursor: grabbing;
  opacity: .92;
}
.photo-drop-placeholder {
  border: 2px dashed color-mix(in srgb, var(--brand-2) 62%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand-2) 8%, transparent);
}
.photo-drag-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 38%;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(0,0,0,.58);
  color: #fff;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
}
.photo-drag-handle:active { cursor: grabbing; }
.img-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 8px; font-size: .8rem; }
.img-actions form { display: inline-flex; margin: 0; }
.img-actions a,
.img-actions button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.img-actions a:hover,
.img-actions button:hover { text-decoration: underline; }
.img-actions button:disabled { color: var(--muted); cursor: not-allowed; opacity: .55; text-decoration: none; }

@media (max-width: 560px) {
  .profile-hero { grid-template-columns: 1fr; text-align: center; }
  .profile-hero .who .sub { justify-content: center; }
  .profile-hero .avatar { margin: 0 auto; }
  .profile-actions { justify-content: center; }
}

/* ---------- Danger zone ---------- */
.danger-zone { border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border)); border-radius: var(--radius); padding: 18px 20px; }
.danger-zone h3 { margin: 0 0 4px; color: var(--danger); }

/* ---------- Fullscreen image viewer (profile/account galleries) ---------- */
.modal2 { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(8,8,20,.93); }
.modal2.open { display: block; }
.modal2-content { position: absolute; inset: 0; margin: 0; padding: 0; max-width: none; }

/* Each slide fills the screen and centres its image (which is contained, never scrolled). */
.modal2 .mySlides { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 58px 64px 104px; box-sizing: border-box; touch-action: none; }
.modal2 .mySlides.is-active { display: flex; }
.modal2 .mySlides img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,.55); touch-action: none; -webkit-user-drag: none; user-select: none; }

.modal2 .numbertext { position: fixed; top: 18px; left: 20px; color: #e6e8f5; font-size: .9rem; font-weight: 600; z-index: 3; }

.modal2 .close {
  position: fixed; top: 10px; right: 16px; z-index: 4; width: 46px; height: 46px;
  display: grid; place-items: center; color: #fff; font-size: 34px; line-height: 1; cursor: pointer;
  border-radius: 50%; background: rgba(255,255,255,.08);
}
.modal2 .close:hover { background: rgba(255,255,255,.2); }

.modal2 .prev, .modal2 .next {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 3; width: 48px; height: 48px;
  display: grid; place-items: center; color: #fff; font-size: 24px; cursor: pointer; user-select: none;
  border-radius: 50%; background: rgba(255,255,255,.1);
}
.modal2 .prev:hover, .modal2 .next:hover { background: rgba(255,255,255,.22); }
.modal2 .prev { left: 16px; } .modal2 .next { right: 16px; }

.modal2 .lb-thumbs { position: fixed; left: 0; right: 0; bottom: 14px; z-index: 3; display: flex; gap: 8px; justify-content: center; padding: 0 16px; overflow-x: auto; }
.modal2 .demo { width: 58px; height: 58px; object-fit: cover; border-radius: 9px; opacity: .5; cursor: pointer; border: 2px solid transparent; flex: none; }
.modal2 .demo:hover, .modal2 .demo.active { opacity: 1; border-color: #fff; }

@media (max-width: 640px) {
  .modal2 .mySlides { padding: 52px 14px 92px; }
  .modal2 .prev, .modal2 .next { display: none; } /* use swipe on touch screens */
  .modal2 .demo { width: 46px; height: 46px; }
}

.cursor { cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.site-footer .container { padding: 26px 20px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; justify-content: center; color: var(--muted); font-size: .9rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer .sep { opacity: .4; }

/* ---------- Static content (terms, privacy) ---------- */
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.prose h1 { margin-top: 0; }
.prose h2 { margin-top: 1.6em; }
.prose p, .prose li { color: var(--text); }

/* ---------- Utilities ---------- */
.stack { display: grid; gap: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }

/* jQuery UI slider theming (match.php) */
.ui-slider { position: relative; height: 8px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; margin: 14px 0 22px; }
.ui-slider .ui-slider-range { position: absolute; height: 100%; background: var(--brand-2); border-radius: 999px; }
.ui-slider .ui-slider-handle {
  position: absolute; top: -7px; width: 22px; height: 22px; margin-left: -11px;
  background: var(--surface); border: 2px solid var(--brand-2); border-radius: 50%;
  box-shadow: var(--shadow); cursor: grab; outline: none;
}
.ui-slider .ui-slider-handle:focus { box-shadow: 0 0 0 4px var(--ring); }

/* ==========================================================================
   UI polish — ambient background, hero, action tiles, chips, animations
   ========================================================================== */

/* Soft ambient glow behind the whole app (fixed, sits under content). */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42rem 30rem at 78% -8%, color-mix(in srgb, var(--brand-1) 22%, transparent), transparent 70%),
    radial-gradient(34rem 26rem at 8% 4%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 70%),
    radial-gradient(30rem 30rem at 50% 112%, color-mix(in srgb, var(--brand-1) 12%, transparent), transparent 70%);
}
[data-theme="dark"] body::before { opacity: .5; }

/* Entrance animation used by home page sections/tiles. */
@keyframes sol-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { opacity: 0; animation: sol-rise .5s cubic-bezier(.22,.7,.28,1) forwards; }
.rise-1 { animation-delay: .04s; } .rise-2 { animation-delay: .1s; }
.rise-3 { animation-delay: .16s; } .rise-4 { animation-delay: .22s; } .rise-5 { animation-delay: .28s; }

/* ---------- Hero (home page) ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 26px; padding: clamp(28px, 5vw, 52px); color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.28), transparent 45%),
    linear-gradient(135deg, var(--brand-1), var(--brand-2) 70%, color-mix(in srgb, var(--brand-2) 70%, #7c3aed));
  box-shadow: 0 26px 60px -20px color-mix(in srgb, var(--brand-2) 60%, transparent);
}
/* decorative floating orbs */
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%;
  background: rgba(255,255,255,.14); filter: blur(2px);
}
.hero::before { width: 320px; height: 320px; right: -80px; top: -120px; }
.hero::after  { width: 190px; height: 190px; right: 120px; bottom: -110px; background: rgba(255,255,255,.1); }
.hero .eyebrow { margin: 0 0 6px; font-weight: 600; letter-spacing: .01em; opacity: .95; }
.hero h1 { color: #fff; margin: 0 0 .35em; font-size: clamp(1.9rem, 5vw, 3rem); letter-spacing: -.02em; }
.hero .lede { color: #fff; opacity: .95; max-width: 44ch; margin: 0 0 22px; font-size: 1.04rem; }
.hero .hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .btn-on-grad { background: #fff; color: var(--brand-2); box-shadow: 0 10px 24px rgba(0,0,0,.16); }
.hero .btn-on-grad:hover { color: var(--brand-2); transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.22); }
.hero .btn-outline-light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.45); backdrop-filter: blur(4px); }
.hero .btn-outline-light:hover { background: rgba(255,255,255,.24); }
.hero .hero-badge {
  position: absolute; right: clamp(24px, 5vw, 52px); top: 50%; transform: translateY(-50%);
  width: 120px; height: 120px; border-radius: 34px; display: grid; place-items: center;
  font-size: 58px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35);
  box-shadow: inset 0 1px 12px rgba(255,255,255,.25); animation: sol-float 5s ease-in-out infinite;
}
@keyframes sol-float { 0%,100% { transform: translateY(-50%); } 50% { transform: translateY(calc(-50% - 10px)); } }
@media (max-width: 720px) { .hero .hero-badge { display: none; } }

/* ---------- Action tiles ---------- */
.tile-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile {
  position: relative; display: flex; align-items: center; gap: 15px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); text-decoration: none; color: var(--text);
  transition: transform .18s cubic-bezier(.22,.7,.28,1), box-shadow .18s, border-color .18s;
}
.tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand-2) 45%, var(--border)); text-decoration: none; }
.tile .tile-ic {
  width: 52px; height: 52px; flex: none; border-radius: 15px; display: grid; place-items: center;
  font-size: 26px; color: #fff; background: var(--brand-2);
  box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--brand-2) 65%, transparent);
}
.tile .tile-body { min-width: 0; }
.tile .tile-body h3 { margin: 0 0 2px; font-size: 1.08rem; }
.tile .tile-body p { margin: 0; color: var(--muted); font-size: .9rem; }
.tile .tile-arrow { margin-left: auto; color: var(--muted); font-size: 1.25rem; transition: transform .18s, color .18s; }
.tile:hover .tile-arrow { transform: translateX(4px); color: var(--brand-2); }

/* ---------- Feature chips ---------- */
/* "Preview as others see me" banner (profile.php in preview mode) */
.preview-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between;
  margin-bottom: 18px; padding: 12px 18px; border-radius: var(--radius);
  color: #fff; background: var(--brand-2);
  box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--brand-2) 60%, transparent);
}
.preview-banner .btn-ghost { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.4); }
.preview-banner .btn-ghost:hover { background: rgba(255,255,255,.26); }

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.feature-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-weight: 600; font-size: .9rem; color: var(--text);
}
.feature-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-2); flex: none; }

/* ---------- Interest / hobby tags ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block; padding: 6px 13px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-weight: 600; font-size: .84rem; color: var(--text);
}

/* Interest picker on the edit-profile form */
.interest-picker .interest-hint { color: var(--muted); font-size: .82rem; margin: 0 0 12px; font-weight: 500; }
.interest-options { display: flex; flex-wrap: wrap; gap: 10px; }
.interest-option { display: inline-flex; margin: 0; cursor: pointer; }
.interest-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.interest-option span {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-weight: 600; font-size: .88rem; color: var(--text);
  transition: background .15s, border-color .15s, color .15s;
}
.interest-option input:checked + span {
  background: var(--brand-2); border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand-2) 70%, transparent);
}
.interest-option input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.interest-option input:disabled + span { opacity: .4; cursor: not-allowed; }

/* Google Places autocomplete dropdown — keep it above headers/modals. */
.pac-container { z-index: 10001; border-radius: 10px; margin-top: 4px; box-shadow: var(--shadow-lg); }

/* ---------- Sort/filter toolbar controls ---------- */
.sort-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 14px; }
.switch-toggle {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: .9rem; font-weight: 600; color: var(--text); white-space: nowrap; user-select: none;
}
.switch-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-toggle .track {
  position: relative; width: 42px; height: 24px; border-radius: 999px; flex: none;
  background: var(--slider-soft); border: 1px solid var(--border); transition: background .15s, border-color .15s;
}
.switch-toggle .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); transition: transform .15s;
}
.switch-toggle input:checked + .track { background: var(--brand-2); border-color: transparent; }
.switch-toggle input:checked + .track::after { transform: translateX(18px); }
.switch-toggle input:focus-visible + .track { outline: 2px solid var(--ring); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .rise, .hero .hero-badge { animation: none; opacity: 1; transform: none; }
  .tile, .tile .tile-arrow { transition: none; }
  .interest-option span, .switch-toggle .track, .switch-toggle .track::after { transition: none; }
}
