:root {
  --red: #E63946;
  --burgundy: #8B1E3F;
  --accent: #FF5C75;
  --bg: #FFF7F8;
  --card: #ffffff;
  --ink: #2A1218;
  --muted: #7A5A62;
  --line: #F0D5DB;
  --shadow: 0 16px 40px rgba(139, 30, 63, 0.08);
  --side: 248px;
  --tab: 64px;
  --radius: 22px;
  --font: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #171217;
  --card: #241C22;
  --ink: #FFF7F8;
  --muted: #C9B3B8;
  --line: #3A2A32;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  min-height: var(--vvh, 100dvh);
}
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; }
button { cursor: pointer; }
a { color: var(--burgundy); }
html[data-theme="dark"] a { color: var(--accent); }
img { max-width: 100%; }
.shell { display: flex; height: 100dvh; max-height: 100dvh; overflow: hidden; }
.side {
  width: var(--side);
  flex: none;
  padding: 22px 16px calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 88%, var(--bg));
  position: sticky;
  top: 0;
  height: 100dvh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; text-decoration: none; color: inherit; }
.mark { width: 36px; height: 36px; flex: none; }
.brand b { font-size: 20px; letter-spacing: -0.04em; }
.nav-btn, .tab-btn {
  display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; border-radius: 14px;
  padding: 12px; text-align: left; position: relative; min-height: 44px;
}
.nav-btn.active, .tab-btn.active { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); font-weight: 700; }
.nav-btn svg, .tab-btn svg { width: 22px; height: 22px; flex: none; }
.nav-extra { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.side-spacer { flex: 1; }
.btn, .chip, .icon-btn {
  border-radius: 999px; border: 0;
}
.stage { flex: 1; min-width: 0; min-height: 0; height: 100%; overflow-x: clip; overflow-y: auto; padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); }
.stage:has(.thread-wrap) { display: flex; flex-direction: column; overflow: hidden; }
.stage:has(.thread-wrap) > .page-head,
.stage:has(.thread-wrap) > .support-box { flex: none; }
.support-box { margin-bottom: 12px; }
.avatar.support { display: grid; place-items: center; background: var(--red); color: white; font-weight: 700; }
.stage:has(.thread-wrap) .split { flex: 1; min-height: 0; }
.tabbar { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; position: relative; }
.filter-open { flex: none; align-self: center; }
.filter-open.on { color: var(--red); border-color: var(--red); }
.filter-sheet {
  position: absolute; z-index: 8; top: calc(100% + 8px); right: 0; width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 12px; padding: 16px; margin: 0; max-height: min(70dvh, 640px); overflow: hidden;
.filter-fields { display: grid; gap: 12px; min-height: 0; overflow: auto; }
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.filter-sheet[hidden] { display: none !important; }
h1 { font-size: 32px; letter-spacing: -0.04em; margin: 0; min-width: 0; overflow-wrap: anywhere; }
h2 { margin: 22px 0 10px; letter-spacing: -0.03em; min-width: 0; overflow-wrap: anywhere; }
.page-head { min-width: 0; }
.page-head h1 { flex: 1 1 auto; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.people > .muted { grid-column: 1 / -1; }
.card, .panel, .modal, .auth-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.person {
  overflow: hidden; text-decoration: none; color: inherit; display: block; position: relative;
  border: 0; padding: 0; width: 100%; text-align: left; background: var(--card);
}
.person img, .ph {
  aspect-ratio: 3/4; width: 100%; object-fit: cover; background: linear-gradient(160deg, #ffd0d6, #fff);
  display: block;
}
html[data-theme="dark"] .ph { background: linear-gradient(160deg, #3a222a, #241C22); }
.person .meta, .overlay {
  padding: 10px 12px 12px;
}
.person .name, .person .meta .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .name { font-size: 15px; }
.overlay {
  position: absolute; left: 0; right: 0; bottom: 0; color: white;
  background: linear-gradient(transparent, rgba(23, 18, 23, 0.82));
}
.name { font-weight: 750; font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.person .meta, .muted, .fact { min-width: 0; overflow-wrap: anywhere; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #b9a4aa; margin-right: 6px; }
.dot.online { background: #2fbf71; }
.dot.recent { background: #e6b325; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filters .lbl { flex: 1 1 180px; min-width: 0; }
.filters .row { flex-wrap: nowrap; }
.filters .row .field { min-width: 0; }
.filters .btn { align-self: end; }
.field, select.field, textarea.field {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-height: 44px;
  width: 100%; min-width: 0; max-width: 100%;
}
input.field[type="date"],
input.field[type="time"],
input.field[type="datetime-local"],
input.field[type="month"],
input.field[type="week"] {
  display: block;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  appearance: none;
  -webkit-appearance: none;
}
input.field[type="date"]::-webkit-date-and-time-value,
input.field[type="datetime-local"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
  font-size: 16px;
}
input.field[type="date"]::-webkit-datetime-edit,
input.field[type="datetime-local"]::-webkit-datetime-edit {
  min-width: 0;
  padding: 0;
  font-size: 16px;
}
textarea.field { min-height: 96px; resize: vertical; }
label.lbl, .stack, .panel, form, .auth-card { display: block; min-width: 0; max-width: 100%; }
label.lbl { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
label.lbl > * { min-width: 0; max-width: 100%; }
.btn {
  min-height: 44px; padding: 10px 16px; background: var(--red); color: white; font-weight: 700;
  max-width: 100%; white-space: normal; overflow-wrap: break-word; line-height: 1.2; text-align: center;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.soft { background: color-mix(in srgb, var(--accent) 18%, var(--card)); color: var(--burgundy); }
.btn.wide { width: 100%; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; min-width: min(100%, 9rem); padding: 0 12px; font-size: 14px; }
.profile-links { margin-top: 16px; }
.photo-form { margin-top: 4px; }
.photo-pick {
  position: relative; display: grid; place-items: center; gap: 6px; text-align: center;
  min-height: 148px; padding: 20px; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
}
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-pick b { font-size: 16px; }
.photo-pick .muted { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.upload { display: grid; gap: 8px; }
.upload[hidden] { display: none !important; }
.upload progress { width: 100%; height: 12px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); }
.upload progress::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
.upload progress::-webkit-progress-value { background: var(--red); border-radius: 99px; }
.upload progress::-moz-progress-bar { background: var(--red); }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.photo-grid:empty, .photos:empty, .admin-photos:empty { display: none; }
.photo-tile { position: relative; min-width: 0; }
.photo-tile.off img { opacity: .45; }
.photo-flag { position: absolute; left: 8px; top: 8px; background: var(--burgundy); color: white; border-radius: 999px; padding: 4px 8px; font-size: 12px; }
.admin-photos { display: flex; gap: 10px; overflow: auto; padding-bottom: 6px; }
.admin-photo { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.admin-photo button { position: relative; }
.history-item { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: 0; }
.history-item .row { justify-content: space-between; }
.chip.off { background: color-mix(in srgb, var(--line) 70%, var(--card)); }
.admin-photo img { width: 120px; height: 156px; object-fit: cover; border-radius: 16px; display: block; }
.admin-photo.off img { opacity: .45; }
.admin-photo .btn { font-size: 13px; min-height: 36px; padding: 0 10px; }
.hour-picks .check.on { border-color: var(--red); background: color-mix(in srgb, var(--accent) 24%, var(--card)); }
.photo-tile img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 16px; display: block; }
.photo-tools { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.mark-btn {
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: rgba(23, 18, 23, .55); color: white;
}
.mark-btn svg { width: 18px; height: 18px; }
.mark-btn.star svg { fill: none; stroke: white; }
.mark-btn.star.on svg { fill: #f5c518; stroke: #f5c518; }
.photo-tile progress {
  position: absolute; left: 8px; bottom: 8px; width: calc(100% - 16px); height: 8px;
  border: 0; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .4);
}
.photo-tile progress[hidden] { display: none !important; }
.photo-tile progress::-webkit-progress-bar { background: rgba(255, 255, 255, .4); border-radius: 99px; }
.photo-tile progress::-webkit-progress-value { background: var(--red); border-radius: 99px; }
.photo-tile progress::-moz-progress-bar { background: var(--red); }
.age-line { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.age-line b { min-width: 1.8em; font-size: 14px; color: var(--ink); flex: none; }
.age-range { position: relative; flex: 1; min-width: 0; height: 28px; }
.age-range input[type="range"] {
  position: absolute; left: 0; width: 100%; height: 28px; margin: 0;
  background: transparent; pointer-events: none; appearance: none;
}
.age-range input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--line); border-radius: 99px; }
.age-range input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto; appearance: none; width: 18px; height: 18px; margin-top: -7px;
  border: 0; border-radius: 50%; background: var(--red);
}
.age-range input[type="range"]::-moz-range-track { height: 4px; background: var(--line); border: 0; border-radius: 99px; }
.age-range input[type="range"]::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--red); }
.age-range input[name="age_max"] { z-index: 2; }
form[data-friend-search] { margin-bottom: 14px; }
.icon-btn {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.icon-btn.like { background: var(--red); color: white; border: 0; }
.icon-btn.tiny { width: 40px; height: 40px; flex: none; }
.icon-btn.tiny svg { width: 20px; height: 20px; }
.row.phone-bar, .city-sheet { display: none; }
.phone-bar .seg { flex: 1; min-width: 0; }
.phone-bar .seg button { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { display: grid; gap: 10px; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; color: inherit; background: var(--card);
  border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; min-height: 64px;
}
.menu-item > span { min-width: 0; overflow-wrap: anywhere; }
.menu-item b, .menu-item small { display: block; overflow-wrap: anywhere; }
.menu-item small { margin-top: 2px; }
.chev { color: var(--muted); font-size: 22px; line-height: 1; }
.icon-btn.pass { color: var(--muted); }
.badge {
  position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; background: var(--red); color: white; font-size: 11px; display: grid; place-items: center;
}
.badge[hidden] { display: none !important; }
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(460px, 100%); padding: 28px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.row > span { min-width: 0; flex: 1 1 140px; overflow-wrap: anywhere; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.choices .check { align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--card); }
.discover { max-width: 460px; margin: 0 auto; display: grid; gap: 16px; }
.swipe {
  position: relative; border-radius: 28px; overflow: hidden; min-height: 62dvh; background: var(--card);
  box-shadow: var(--shadow); touch-action: pan-y; user-select: none;
}
.swipe img { width: 100%; height: 68dvh; object-fit: cover; display: block; }
.swipe-actions { display: flex; justify-content: center; gap: 18px; }
.deck-empty { text-align: center; padding: 48px 12px; }
.split { display: grid; grid-template-columns: 320px 1fr; gap: 14px; min-height: 70dvh; margin-top: 12px; }
.list, .thread-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.list { overflow: auto; }
.conv, .note, .friend {
  display: flex; gap: 10px; padding: 12px; border: 0; background: transparent; width: 100%; text-align: left; color: inherit;
  border-bottom: 1px solid var(--line); align-items: flex-start; position: relative;
}
.note.click { cursor: pointer; }
.note-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.note-text { line-height: 1.4; overflow-wrap: anywhere; }
.note-time { font-size: 12px; color: var(--muted); }
.conv[hidden] { display: none !important; }
.conv-main { min-width: 0; flex: 1; }
.conv-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  overflow-wrap: anywhere; line-height: 1.35;
}
.list .empty { margin: auto; text-align: center; padding: 32px 16px; }
.conv.active { background: color-mix(in srgb, var(--red) 8%, transparent); }
.avatar, .avatar img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: #ffd5dc; flex: none; }
.conv .avatar[data-profile] { cursor: pointer; }
.thread { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.toolbar, .typing, .composer, .thread-wrap > .btn, .thread-wrap > .warn { flex: none; }
.bubble { max-width: min(78%, 520px); padding: 10px 12px; border-radius: 18px; animation: rise .28s ease; overflow-wrap: anywhere; min-width: 0; }
.bubble.in { background: color-mix(in srgb, var(--line) 70%, var(--card)); align-self: flex-start; }
.bubble.out { background: linear-gradient(135deg, var(--red), var(--accent)); color: white; align-self: flex-end; }
.bubble .time { display: block; opacity: .75; font-size: 11px; margin-top: 4px; }
.bubble a { color: inherit; }
.composer { display: grid; gap: 6px; padding: 12px; border-top: 1px solid var(--line); }
.composer-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.composer-row .btn { flex: none; white-space: nowrap; }
.count { margin: 0; text-align: right; font-size: 12px; color: var(--muted); }
.count.max { color: var(--accent); font-weight: 700; }
.pad { padding: 16px; }
.pad-sm { padding: 12px; }
.toolbar { padding: 8px 12px; }
.typing { padding: 0 12px; }
.city-results { max-height: 50dvh; overflow: auto; }
.scroll { overflow: auto; max-width: 100%; }
.lift { margin-top: 12px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 12px; }
.tabs .btn.on { background: var(--red); color: white; border-color: transparent; }
.coin-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.coin-bar .field { width: 120px; flex: none; min-height: 40px; }
.admin-pane { max-height: min(60dvh, 640px); overflow: auto; }
.bubble .text-btn { padding: 0; min-height: 0; font-weight: 700; }
.composer-row input { flex: 1; min-width: 0; }
.city-msg { display: flex; gap: 8px; max-width: min(82%, 520px); align-self: flex-start; animation: rise .28s ease; }
.city-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.city-msg .avatar, .city-msg .avatar img { width: 36px; height: 36px; }
.city-body { min-width: 0; }
.city-msg .who { font-weight: 700; display: block; margin-bottom: 4px; }
.city-msg.mine .who, .city-msg.mine .time { text-align: right; }
.city-text { padding: 10px 12px; border-radius: 18px; background: color-mix(in srgb, var(--line) 70%, var(--card)); overflow-wrap: anywhere; }
.city-msg.mine .city-text { background: linear-gradient(135deg, var(--red), var(--accent)); color: white; }
.city-msg .time { display: block; margin-top: 4px; }
.seg { display: flex; gap: 6px; background: color-mix(in srgb, var(--line) 55%, transparent); padding: 4px; border-radius: 999px; }
.seg button { border: 0; background: transparent; border-radius: 999px; min-height: 36px; padding: 0 12px; }
.seg button.on { background: var(--card); box-shadow: var(--shadow); }
.modal-back {
  position: fixed; inset: 0; background: rgba(23, 18, 23, .46); display: grid; place-items: center; padding: 18px; z-index: 20;
}
.modal { width: min(440px, 100%); max-width: 100%; padding: 22px; min-width: 0; overflow-wrap: anywhere; }
.heart { font-size: 42px; animation: pop .45s ease; }
.facts { display: grid; gap: 12px; margin: 14px 0 6px; }
.fact { display: grid; gap: 2px; }
.fact .muted { font-size: 12px; }
.about { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border-radius: 999px; padding: 4px 10px; background: color-mix(in srgb, var(--accent) 16%, var(--card)); font-size: 13px; max-width: 100%; overflow-wrap: anywhere; }
.photos { display: flex; gap: 8px; overflow: auto; padding-bottom: 6px; }
.photos button { border: 0; padding: 0; background: transparent; border-radius: 16px; overflow: hidden; position: relative; }
.photos img { width: 92px; height: 120px; object-fit: cover; display: block; }
.skel { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--line) 80%, white), transparent); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 16px; min-height: 180px; }
.conn { font-size: 12px; }
.conn.off { color: var(--accent); }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.warn { background: color-mix(in srgb, var(--accent) 16%, var(--card)); border-radius: 16px; padding: 12px; overflow-wrap: anywhere; min-width: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ua { word-break: break-word; font-size: 12px; margin: 0; }
.login-list { display: flex; flex-direction: column; }
.visit { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.visit p { margin: 0; }
.visit b { overflow-wrap: anywhere; }
.email-log { margin: 8px 0 0; padding-left: 18px; }
.email-log li { overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.admin-find { margin-bottom: 22px; }
.admin-find .lbl { flex: 1 1 180px; min-width: 0; }
.text-btn { background: none; border: 0; padding: 0; min-height: 0; color: var(--burgundy); font-weight: 700; text-align: left; max-width: 100%; overflow-wrap: anywhere; }
.bubble .who { display: block; font-weight: 700; font-size: 12px; margin-bottom: 4px; }
.stat { padding: 14px; }
.stat b { display: block; font-size: 26px; }
dialog { border: 0; padding: 0; background: transparent; max-width: 100vw; }
dialog::backdrop { background: rgba(0,0,0,.72); }
dialog img { max-height: 86dvh; border-radius: 16px; }
dialog.gallery { width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; overflow: hidden; }
dialog.gallery::backdrop { background: rgba(0, 0, 0, .92); }
.gallery-stage { position: relative; width: 100%; height: 100dvh; display: grid; place-items: center; }
dialog.gallery img { max-width: min(92%, 960px); max-height: 82dvh; object-fit: contain; touch-action: none; user-select: none; }
.gallery-nav, .gallery-close {
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 247, 248, .92); color: #171217; font-size: 28px; line-height: 1;
}
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.gallery-nav[hidden] { display: none !important; }
.gallery-close { position: absolute; top: 16px; right: 16px; }
.gallery-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: white; font-size: 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 50% { transform: scale(1.2); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 900px) {
  .side { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    border-top: 1px solid var(--line);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    justify-content: space-around;
    backdrop-filter: blur(12px);
  }
  .tab-btn { flex-direction: column; gap: 2px; font-size: 10px; padding: 6px 2px; min-width: 0; flex: 1; overflow: hidden; }
  .tab-btn span.label { display: block; width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
  .stage { padding: 14px 12px calc(var(--tab) + 18px + env(safe-area-inset-bottom)); }
  .split { grid-template-columns: 1fr; }
  .split.chat-open .list { display: none; }
  .split:not(.chat-open) .thread-wrap { display: none; }
  .split.city-room .list { display: none; }
  .split.city-room .thread-wrap { display: flex; position: relative; min-height: 0; }
  .split.city-room { grid-template-rows: minmax(0, 1fr); }
  .row.phone-bar { display: flex; }
  .city-sheet {
    position: absolute; z-index: 6; left: 8px; right: 8px; top: 58px;
    max-height: min(52dvh, 420px); overflow: auto; background: var(--card);
    border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .city-sheet:not([hidden]) { display: block; }
  .stage:has(.split.chat-open) > .support-box { display: none; }
  h1 { font-size: 26px; }
  .page-head { flex-wrap: wrap; align-items: center; }
  .page-head .actions { flex: 1 1 100%; }
  .actions .btn { font-size: 13px; padding: 0 8px; min-height: 40px; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .person .meta { padding: 8px; }
  .person .name { font-size: 14px; }
  .filters .lbl { flex-basis: calc(50% - 10px); }
  .filters .btn { flex: 1 1 100%; }
  .swipe img { height: 58dvh; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 901px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, 180px); justify-content: start; }
}
