/* bestied beta: "Baby Tee" brand */
:root {
  --white: #ffffff;
  --pink: #F7B6CB;
  --pink-soft: #FCE3EB;
  --black: #111111;
  --cream: #FFF4F6;
  --grey: #6b6366;
  --line: #f1d9e1;
  --danger: #b3261e;
  --ok: #1e6b3a;
  --radius: 20px;
  --tabbar-h: 64px;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--black);
  font-family: var(--sans); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: fixed; left: -9999px; opacity: 0; }
.muted { color: var(--grey); margin: 4px 0 0; }
.small { font-size: 13px; }
.noscript { text-align: center; padding: 40px; }

/* Wordmark */
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 26px; letter-spacing: -0.5px; text-decoration: none; color: var(--black); text-transform: lowercase; }
.wordmark.big { font-size: 52px; letter-spacing: -1.5px; }
.beta-pill { display: inline-block; background: var(--pink); color: var(--black); font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }

/* Splash */
.splash { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--pink-soft); border-top-color: var(--black); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none; font-weight: 600; transition: transform .08s ease, opacity .15s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.pill { background: var(--black); color: var(--white); border-radius: 999px; padding: 13px 22px; font-size: 15px; }
.pill.small { padding: 8px 14px; font-size: 13px; }
.pill.block { width: 100%; }
.pill.outline { background: var(--white); color: var(--black); box-shadow: inset 0 0 0 1.5px var(--black); }
.pill.ghost { background: var(--pink); color: var(--black); }
.btn svg.g { width: 18px; height: 18px; }
.linkish { background: none; border: 0; padding: 6px; color: var(--grey); text-decoration: underline; cursor: pointer; font-size: 14px; align-self: center; }
.code-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(255,255,255,.18); padding: 1px 7px; border-radius: 6px; letter-spacing: .5px; }

/* Auth */
.auth { min-height: 100vh; min-height: 100dvh; padding: 56px 22px 32px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.tagline { margin: 4px 0 12px; color: var(--grey); }
.auth-card { width: 100%; margin-top: 22px; background: var(--white); border-radius: 26px; padding: 22px 18px; box-shadow: 0 10px 30px rgba(247, 182, 203, .35); text-align: left; }
.auth-card h2 { font-family: var(--serif); font-size: 24px; }
.auth-card > .btn { margin-top: 18px; }
.fine { font-size: 12px; color: var(--grey); max-width: 320px; margin-top: 20px; }
.seg { display: flex; background: var(--cream); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--grey); }
.seg button.on { background: var(--black); color: var(--white); }
.or { display: flex; align-items: center; gap: 10px; color: var(--grey); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-weight: 600; font-size: 13px; }
.hint { font-size: 12px; color: var(--grey); }
.field input, .field textarea, .bio-input {
  width: 100%; background: var(--white); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .15s;
}
.field textarea, .bio-input { resize: vertical; min-height: 64px; }
.field input:focus, .field textarea:focus, .bio-input:focus { border-color: var(--black); }
.auth-card .field input { background: var(--cream); border-color: transparent; }
.auth-card .field input:focus { border-color: var(--black); }
.at-wrap { position: relative; }
.at-wrap .at { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--grey); }
.at-wrap input { padding-left: 30px; }
.form-error { color: var(--danger); font-size: 14px; margin: 0; min-height: 0; }
.form-error:empty, .form-ok:empty { display: none; }
.form-ok { color: var(--ok); font-size: 14px; margin: 0; }
.heart-input { display: flex; gap: 6px; }
.heart-btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--white); color: var(--line); font-size: 22px; line-height: 1; cursor: pointer; padding: 0; }
.heart-btn.on { color: var(--black); background: var(--pink); border-color: var(--pink); }

/* Shell */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 18px 10px; background: rgba(255, 244, 246, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.view { padding: 14px 14px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
.page-head { padding: 6px 4px 14px; }
.page-head h1 { font-family: var(--serif); font-size: 28px; letter-spacing: -.5px; }
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: center;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--white); border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--grey); font-size: 11px; font-weight: 500; -webkit-tap-highlight-color: transparent; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--black); }
.tab.active svg { stroke-width: 2.4; }
.tab.center .tab-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--black); color: var(--white); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(17,17,17,.2); }
.tab.center.active .tab-icon { background: var(--black); box-shadow: 0 0 0 3px var(--pink); }
.tab.center svg { stroke-width: 2.6; }

/* Cards */
.list { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--white); border-radius: var(--radius); padding: 14px 16px 16px; box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(247, 182, 203, .18); overflow-wrap: anywhere; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.author { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; min-width: 0; }
div.author { cursor: default; }
.who { display: flex; flex-direction: column; min-width: 0; }
.author-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time { font-size: 12px; color: var(--grey); }
.ad { font-size: 11px; font-weight: 600; color: var(--grey); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; flex-shrink: 0; }
.card-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.card-body { margin: 8px 0 0; white-space: pre-line; }
.hearts { margin-top: 4px; font-size: 16px; letter-spacing: 2px; }
.hearts .on { color: var(--pink); }
.hearts .off { color: #f6e4ea; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.city, .tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.city { background: var(--black); color: var(--white); }
.city svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.tag { background: var(--pink-soft); color: var(--black); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* Avatars */
.avatar { position: relative; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--pink); color: var(--black); font-weight: 700; overflow: hidden; font-family: var(--serif); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.md { width: 38px; height: 38px; font-size: 16px; }
.avatar.xl { width: 92px; height: 92px; font-size: 38px; box-shadow: 0 0 0 4px var(--white), 0 0 0 6px var(--pink); }

/* Profile */
.profile { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 8px 8px; }
.profile-name { font-family: var(--serif); font-size: 26px; margin-top: 14px; }
.handle { margin: 2px 0 0; color: var(--grey); }
.bio { margin: 10px 0 0; max-width: 340px; }
.bio-edit { width: 100%; margin-top: 14px; }
.bio-input { text-align: center; }
.bio-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; min-height: 34px; }
.signout { margin-top: 8px; }
.section-title { font-family: var(--serif); font-size: 20px; margin: 18px 4px 12px; }
.back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 0; cursor: pointer; font-weight: 600; }
.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.profile-skel { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }

/* Search */
.search-bar, .city-bar { position: relative; margin-bottom: 10px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--grey); display: flex; }
.search-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.search-input, .city-input { width: 100%; border: 1.5px solid var(--line); background: var(--white); border-radius: 999px; padding: 12px 16px 12px 40px; font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; }
.city-input { padding-top: 9px; padding-bottom: 9px; font-size: 15px; }
.search-input:focus, .city-input:focus { border-color: var(--black); }
.city-input::-webkit-calendar-picker-indicator { display: none !important; opacity: 0; }
.search-input::-webkit-search-cancel-button { cursor: pointer; }
.result-count { margin: 4px 4px 10px; }

/* Empty / error / skeleton */
.empty { text-align: center; background: var(--white); border-radius: var(--radius); padding: 32px 20px; }
.empty h3 { font-family: var(--serif); font-size: 21px; margin-top: 6px; }
.empty p { color: var(--grey); margin: 6px 0 16px; }
.empty-heart { font-size: 34px; color: var(--pink); line-height: 1; }
.empty.error h3 { color: var(--black); }
.skel { display: flex; flex-direction: column; gap: 10px; }
.skel-row { display: flex; align-items: center; gap: 10px; }
.skel-dot { width: 38px; height: 38px; border-radius: 50%; background: var(--pink-soft); display: block; }
.skel-dot.big { width: 92px; height: 92px; }
.skel-line { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--pink-soft), #fff 50%, var(--pink-soft)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.w40 { width: 40%; } .w60 { width: 60%; } .w70 { width: 70%; } .w90 { width: 90%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--black); color: var(--white); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 520px) { body { background: var(--pink-soft); } #app { background: var(--cream); box-shadow: 0 0 40px rgba(0,0,0,.05); } }
