/* FreeDatingNow – single lean stylesheet. Sections: tokens, base, layout, components, site, members, admin. */

/* ---------- Tokens ---------- */
:root {
  --brand: #c2185b; --brand-d: #9c1049; --brand-l: #fde7ef;
  --ink: #241b2b; --muted: #6f6577; --line: #e9e3ec; --bg: #ffffff; --bg-alt: #faf6f9;
  --ok: #157f4c; --ok-bg: #e7f6ee; --err: #b3261e; --err-bg: #fdecea; --info-bg: #eef2fb; --warn: #8a5a00; --warn-bg: #fff4dc;
  --radius: 14px; --shadow: 0 1px 2px rgba(36,27,43,.06), 0 6px 24px rgba(36,27,43,.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--sans); color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1, h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-d); }
img { max-width: 100%; display: block; }
code { background: var(--bg-alt); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid rgba(194,24,91,.4); outline-offset: 2px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.pre { white-space: pre-line; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.grid-3 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.split { display: grid; gap: 40px; grid-template-columns: 1.3fr 1fr; align-items: center; }
.row-2, .row-3 { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 720px) { .split, .row-2, .row-3 { grid-template-columns: 1fr; } .section { padding: 48px 0; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 22px; border-radius: 999px; border: 2px solid var(--brand);
  background: var(--brand); color: #fff; font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s, transform .1s; }
.btn:hover { background: var(--brand-d); border-color: var(--brand-d); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 14px; font-size: .9rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-l); color: var(--brand-d); }
.btn-light { background: #fff; border-color: #fff; color: var(--brand); }
.btn-light:hover { background: var(--brand-l); border-color: var(--brand-l); color: var(--brand-d); }
.btn-outline-light { background: transparent; border-color: #fff; color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.15); border-color: #fff; }
.btn-danger { background: var(--err); border-color: var(--err); }
.btn-danger:hover { background: #8c1c16; border-color: #8c1c16; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1em; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link.danger, .danger { color: var(--err); }
.cta-group { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-group.center { justify-content: center; }

/* ---------- Forms ---------- */
.form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]), .form select, .form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 13px; font: 400 1rem/1.4 var(--sans); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px; transition: border-color .15s; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(194,24,91,.12); }
.form input:disabled { background: var(--bg-alt); color: var(--muted); }
.form small { display: block; font-weight: 400; margin-top: 4px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.form .check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.form-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.form-row .check { margin: 0; }
.field-error { color: var(--err); font-size: .85rem; font-weight: 500; margin: 4px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.seg { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.seg legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; width: 100%; }
.form .seg label { margin: 0; flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg label { display: block; text-align: center; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; }
.seg label:has(input:checked) { border-color: var(--brand); background: var(--brand-l); color: var(--brand-d); }
.seg label:has(input:focus-visible) { outline: 3px solid rgba(194,24,91,.4); }

/* ---------- Components ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.alert { padding: 12px 16px; border-radius: 10px; margin: 16px 0; font-size: .95rem; }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-info { background: var(--info-bg); color: #283a66; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--line); }
.tag-warn, .tag-suspended { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag-banned { background: var(--err-bg); color: var(--err); border-color: transparent; }
.tag-active { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; }
.badge-muted { background: var(--line); color: var(--muted); }
details > summary { cursor: pointer; font-weight: 600; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; float: right; color: var(--brand); font-weight: 700; }
details[open] > summary::after { content: "–"; }
.narrow > details, .section details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.narrow > details p, .section details p { margin: 10px 0 0; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table-wrap { overflow-x: auto; padding: 0; }
.row-open { background: #fffaf2; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }
.pagination { display: flex; justify-content: center; gap: 6px; margin: 28px 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; }
.pagination span { background: var(--brand); color: #fff; border-color: var(--brand); }
.empty { text-align: center; padding: 48px 24px; }
.simple-list { list-style: none; padding: 0; margin: 0; }
.simple-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 500; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 640px; margin: 0 auto; z-index: 50; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.15); padding: 18px; font-size: .9rem; }
.cookie-banner p { margin-bottom: 12px; }
.cookie-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Logo & site header ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-size: 1.2rem; letter-spacing: -.01em; }
.logo svg { color: var(--brand); }
.logo strong { color: var(--brand); }
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--brand); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { position: absolute; left: 11px; width: 22px; height: 2px; background: var(--ink); content: ""; transition: .2s; }
.nav-toggle span { top: 21px; } .nav-toggle span::before { top: -7px; left: 0; } .nav-toggle span::after { top: 7px; left: 0; }
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-header .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 12px 20px 20px; gap: 4px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .site-header .nav a { padding: 10px 0; }
  .nav.open { display: flex; }
}

/* ---------- Site: hero & sections ---------- */
.hero { position: relative; color: #fff; padding: 110px 0 120px; overflow: hidden;
  background: linear-gradient(100deg, rgba(36,10,40,.86) 0%, rgba(120,16,64,.62) 55%, rgba(194,24,91,.35) 100%), var(--hero-img, none) center/cover no-repeat,
    radial-gradient(circle at 80% 20%, #f48fb1 0, transparent 40%), radial-gradient(circle at 70% 90%, #e0a96d 0, transparent 35%), linear-gradient(135deg, #3b0f3f, #c2185b); }
.hero::after { content: ""; position: absolute; right: -80px; top: 50%; width: 520px; height: 520px; transform: translateY(-50%); opacity: .14;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23fff' d='M16 29s-11.5-7.1-11.5-15.2C4.5 9.4 7.8 6 11.8 6c2 0 3.4.9 4.2 2.1C16.8 6.9 18.2 6 20.2 6c4 0 7.3 3.4 7.3 7.8C27.5 21.9 16 29 16 29z'/%3E%3C/svg%3E") center/contain no-repeat; }
.hero-inner { position: relative; z-index: 1; }
.hero-copy { max-width: 620px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin-bottom: 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700; opacity: .9; }
.lead { font-size: 1.15rem; opacity: .95; }
.hero .lead { margin-bottom: 28px; }
.hero-note { margin-top: 18px; font-size: .9rem; opacity: .85; }
.feature { padding: 28px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-l); color: var(--brand); display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 16px; }
.steps { list-style: none; padding: 0; margin: 0 0 36px; display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: s; }
.steps li { text-align: center; padding: 8px 12px; }
.steps span { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: #fff; font: 700 1.3rem var(--serif); margin-bottom: 14px; }
.checks { list-style: none; padding: 0; }
.checks li { padding-left: 30px; position: relative; margin-bottom: 8px; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.quote-card { background: linear-gradient(135deg, #3b0f3f, var(--brand)); color: #fff; border-radius: 20px; padding: 40px; font: italic 1.35rem/1.45 var(--serif); }
.quote-card span { display: block; margin-top: 16px; font: 600 .9rem var(--sans); opacity: .85; }
.cta-band { background: linear-gradient(135deg, #3b0f3f, var(--brand)); color: #fff; }
.page-hero { background: var(--bg-alt); padding: 56px 0 36px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.page-hero .lead { color: var(--muted); }
.prose { padding-bottom: 56px; }
.site-footer { background: #1d1422; color: #cfc6d4; padding: 56px 0 24px; margin-top: 56px; font-size: .92rem; }
.home .site-footer { margin-top: 0; }
.site-footer .logo { color: #fff; }
.site-footer h3 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.site-footer a, .site-footer .link { color: #cfc6d4; text-decoration: none; display: block; padding: 3px 0; }
.site-footer a:hover, .site-footer .link:hover { color: #fff; }
.site-footer .muted { color: #a197a8; margin-top: 12px; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 2fr 1fr 1fr 1fr; }
.footer-bottom { border-top: 1px solid #3a2d40; margin-top: 36px; padding-top: 20px; font-size: .85rem; color: #a197a8; }
@media (max-width: 720px) { .hero::after { display: none; } .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } .hero { padding: 72px 0 80px; } }

/* ---------- Auth pages ---------- */
.auth-page { background: linear-gradient(180deg, var(--bg-alt), #fff 60%); }
.auth-header { padding: 20px; }
.auth-main { padding: 12px 16px 48px; }
.auth-card { max-width: 480px; margin: 12px auto; padding: 32px; }
.auth-card h1 { font-size: 1.8rem; }
.auth-main .alert { max-width: 480px; margin: 12px auto; }
.auth-main > .container { padding: 0; }
.auth-footer { padding: 20px; text-align: center; font-size: .85rem; color: var(--muted); }
.auth-footer a { color: var(--muted); }

/* ---------- Members app ---------- */
.app { background: var(--bg-alt); }
.app-header { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--line); }
.app-nav { display: flex; gap: 6px; }
.app-nav a { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; }
.app-nav a.active, .app-nav a:hover { color: var(--brand); background: var(--brand-l); }
.app-nav svg { width: 22px; height: 22px; fill: currentColor; }
.app-nav .badge { margin-left: -2px; }
.nav-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.app-main { padding: 20px 0 40px; }
.app-footer { text-align: center; font-size: .85rem; color: var(--muted); padding: 20px 20px 96px; }
.app-footer a { color: var(--muted); }
.page-title { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 16px; }
.page-title h1 { margin: 0; font-size: 1.8rem; }
.page-title p { margin: 0; }
.verify-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 720px) {
  .app-header .logout-form { display: none; }
  .app-header .nav-wrap { height: 56px; justify-content: center; }
  .app-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 45; }
  .app-nav a { flex-direction: column; gap: 2px; font-size: .72rem; padding: 6px 10px; border-radius: 12px; }
  .app-nav .badge { position: absolute; top: 0; right: 6px; margin: 0; }
}
.filters { padding: 16px 20px; }
.filter-form { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-end; margin-top: 14px; }
.filter-form label { flex: 1 1 140px; }
.filter-form .check { flex: 0 0 auto; align-self: center; }
.filter-form .btn { margin-bottom: 14px; }
details.filters > summary::after { margin-left: 8px; }
.profile-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
@media (max-width: 480px) { .profile-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
.profile-card { display: block; background: #fff; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.profile-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(36,27,43,.12); color: var(--ink); }
.pc-photo { position: relative; aspect-ratio: 1; background: var(--line); }
.pc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; }
.pc-body .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online { position: absolute; left: 8px; bottom: 8px; background: rgba(21,127,76,.92); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.online-dot { color: var(--ok); font-weight: 600; }
.online-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22b36b; margin-right: 5px; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; }
.avatar-sm { width: 48px; height: 48px; }
.avatar-md { width: 72px; height: 72px; }
.avatar-fill { width: 100%; height: 100%; border-radius: 0; }
.avatar-xl { width: 100%; aspect-ratio: 1; border-radius: var(--radius); font-size: 6rem !important; }
.avatar-ph { display: grid; place-items: center; color: #fff; font: 700 1.3rem var(--serif); background: linear-gradient(135deg, hsl(var(--h) 55% 55%), hsl(calc(var(--h) + 40) 60% 40%)); }
.avatar-fill.avatar-ph { font-size: 3.5rem; }
.profile-page { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: start; }
@media (max-width: 820px) { .profile-page { grid-template-columns: 1fr; } }
.gallery-main { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); background: var(--line); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery-thumbs button { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; flex: none; width: 64px; height: 64px; background: none; }
.gallery-thumbs button.active, .gallery-thumbs button:hover { border-color: var(--brand); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.profile-info h1 { margin-bottom: 4px; }
.profile-info section { margin-top: 28px; }
.profile-info h2 { font-size: 1.2rem; }
.headline { font: italic 1.2rem var(--serif); margin: 16px 0; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.fav .fav-on, .fav.is-fav .fav-off { display: none; }
.fav.is-fav .fav-on { display: inline; }
.fav.is-fav { background: var(--brand-l); }
.safety-actions { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .92rem; }
.safety-actions > summary { color: var(--muted); }
.safety-actions form { margin-top: 14px; }
.inbox { list-style: none; padding: 0; overflow: hidden; }
.inbox li + li { border-top: 1px solid var(--line); }
.inbox a { display: flex; align-items: center; gap: 14px; padding: 14px 20px; text-decoration: none; color: var(--ink); }
.inbox a:hover { background: var(--bg-alt); }
.inbox li.unread strong { color: var(--brand-d); }
.inbox-body { flex: 1; min-width: 0; }
.inbox-top { display: flex; align-items: center; gap: 8px; }
.inbox-top time { margin-left: auto; white-space: nowrap; }
.inbox .card, ul.inbox.card { padding: 0; }
/* Chat page is an exact-viewport app layout: the page never scrolls, only the message log does. */
body.is-chat { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.is-chat .app-main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 0; }
.is-chat .app-footer { display: none; }
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat > * { flex: none; }
@media (max-width: 720px) { .is-chat .app-main { padding: 10px 0 calc(74px + env(safe-area-inset-bottom)); } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 12px; }
.chat-head .back { font-size: 2rem; line-height: 1; text-decoration: none; padding: 0 6px; }
.chat-who { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.chat-who small { display: block; }
.chat > .chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 16px; margin-bottom: 12px; }
.chat-log > :first-child { margin-top: auto; } /* newest messages sit just above the composer, like any messenger */
.chat-empty { margin: auto; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 18px; }
.msg p { margin: 0; overflow-wrap: anywhere; }
.msg time { display: block; font-size: .7rem; opacity: .7; margin-top: 3px; }
.msg.theirs { background: var(--bg-alt); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.mine { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.chat-form { padding: 10px; margin-bottom: 0; }
.chat .chat-head, .chat .chat-log { margin-bottom: 10px; }
.chat-previews { max-height: 140px; overflow-y: auto; }
.chat-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea, .composer textarea { flex: 1; min-width: 0; resize: none; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font: 1rem/1.4 var(--sans); color: var(--ink); background: #fff; min-height: 44px; max-height: 200px; overflow-y: hidden; field-sizing: content; }
.chat-form textarea.scroll, .composer textarea.scroll { overflow-y: auto; }
.chat-form textarea:focus, .composer textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(194,24,91,.12); }
.chat-attach { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--muted); cursor: pointer; }
.chat-attach:hover { background: var(--brand-l); color: var(--brand); }
.chat-attach svg { width: 22px; height: 22px; fill: currentColor; }
.chat-attach input, .composer-add input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.chat-send { flex: none; height: 44px; }
.chat-hint { font-size: .75rem; margin: 6px 4px 0; }
@media (pointer: coarse), (max-width: 720px) { .chat-hint { display: none; } }
@media (max-width: 720px) { .chat-send { padding: 0 16px; } .chat-row { gap: 4px; } }
.chat-form.drag, .composer.drag { outline: 2px dashed var(--brand); outline-offset: -4px; }
.previews, .chat-previews, .composer-previews { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.preview { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--bg-alt); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: var(--muted); text-align: center; }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.msg-files { display: grid; gap: 4px; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 300px; max-width: 100%; margin: -4px -8px 6px; }
.msg-files:last-child { margin-bottom: -4px; }
.msg-img { display: block; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.06); }
.msg-img { aspect-ratio: 1; }
.msg-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.msg-files:has(> :only-child) .msg-img { aspect-ratio: auto; }
.msg-files:has(> :only-child) .msg-img img { height: auto; max-height: 340px; }
.msg-files:has(> :only-child) { grid-template-columns: 1fr; }
.msg-doc { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.9); color: var(--ink); text-decoration: none; }
.msg-doc small { display: block; color: var(--muted); }
.msg-doc span:last-child { min-width: 0; overflow-wrap: anywhere; }
.msg-doc-icon { flex: none; display: grid; place-items: center; width: 38px; height: 44px; border-radius: 6px; background: var(--err); color: #fff; font-size: .7rem; font-weight: 800; }
.msg.theirs .msg-doc { background: #fff; border: 1px solid var(--line); }

/* Feed & posts */
.composer { padding: 16px; }
.composer-row { display: flex; gap: 12px; align-items: flex-start; }
.composer-row textarea { min-height: 64px; }
.composer .field-error { margin: 8px 0 0 60px; }
.composer-previews { margin: 12px 0 0 60px; }
.composer-actions { display: flex; align-items: center; gap: 12px; margin: 12px 0 0 60px; }
.composer-actions .btn:last-child { margin-left: auto; }
.composer-add { position: relative; cursor: pointer; }
.post { padding: 16px 18px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-author { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.post-author a { color: var(--ink); text-decoration: none; }
.post-author a.muted { color: var(--muted); }
.post-author a:hover { text-decoration: underline; }
.post-menu { margin-left: auto; position: relative; }
.post-menu > summary { list-style: none; cursor: pointer; padding: 2px 10px; border-radius: 999px; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.post-menu > summary::-webkit-details-marker { display: none; }
.post-menu > summary::after { content: none; }
.post-menu > summary:hover { background: var(--bg-alt); }
.post-menu-body { position: absolute; right: 0; top: 100%; z-index: 20; width: 260px; padding: 14px; margin: 4px 0 0; font-size: .9rem; }
.post-body { margin: 12px 0 0; overflow-wrap: anywhere; }
.post-photos { display: grid; gap: 4px; margin: 12px -18px 0; }
.post-photos a { display: block; background: var(--line); overflow: hidden; }
.post-photos img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-photos.n1 img { max-height: 560px; height: auto; }
.post-photos.n2, .post-photos.n4 { grid-template-columns: 1fr 1fr; }
.post-photos.n2 a { aspect-ratio: 1; }
.post-photos.n4 a { aspect-ratio: 4 / 3; }
.post-photos.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 3 / 2; }
.post-photos.n3 a:first-child { grid-row: 1 / 3; }
.post-foot { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.post-foot form { display: inline; }
.like-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff;
  color: var(--muted); font: 600 .9rem var(--sans); cursor: pointer; transition: .15s; }
.like-btn:hover { border-color: var(--brand); color: var(--brand); }
.like-btn .heart::before { content: "♡"; font-size: 1.1rem; }
.like-btn.is-liked { background: var(--brand-l); border-color: var(--brand); color: var(--brand); }
.like-btn.is-liked .heart::before { content: "♥"; }
.like-btn.is-static { cursor: default; border-color: transparent; padding-left: 0; }
.like-btn.pop .heart { animation: pop .3s; }
@keyframes pop { 50% { transform: scale(1.4); } }
.profile-posts .post { box-shadow: none; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(10,5,12,.88); }
.lightbox img { display: block; max-width: 96vw; max-height: 94vh; object-fit: contain; border-radius: 8px; }
.lightbox button { position: fixed; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 1.6rem; cursor: pointer; }
.admin-post-body { margin: 0 0 6px; max-width: 520px; }
.admin-post-photos { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-post-photos img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
@media (max-width: 480px) {
  .composer-previews, .composer-actions, .composer .field-error { margin-left: 0; }
  .post { padding: 14px; } .post-photos { margin: 12px -14px 0; }
}
.account-title { align-items: center; }
.upload-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.upload-drop { display: block; width: 100%; border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; cursor: pointer; }
.upload-drop:hover, .upload-drop.drag { border-color: var(--brand); background: var(--brand-l); }
.upload-drop input { display: block; margin: 0 auto 10px; }
.photo-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 16px 0; }
.photo-item { margin: 0; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.photo-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-item figcaption { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 8px 10px; font-size: .85rem; align-items: center; }
.photo-item form { display: inline; }

/* ---------- Admin ---------- */
.admin { background: var(--bg-alt); }
.admin-header { display: flex; align-items: center; gap: 10px; padding: 0 20px; height: 58px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.admin-header .nav-toggle { margin-left: auto; }
.admin-wrap { display: grid; grid-template-columns: 220px 1fr; flex: 1; }
.admin-nav { flex-direction: column; align-items: stretch; gap: 2px; padding: 16px 12px; background: #fff; border-right: 1px solid var(--line); }
.admin-nav a, .admin-nav .link { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); text-align: left; width: 100%; }
.admin-nav a.active, .admin-nav a:hover { background: var(--brand-l); color: var(--brand-d); }
.admin-nav form { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.admin-main { padding: 24px; min-width: 0; }
.admin-main h1 { font-size: 1.7rem; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.admin-cols > .card { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { margin: 0; padding: 16px; display: flex; flex-direction: column; }
.stat-n { font: 700 1.7rem var(--serif); color: var(--brand-d); }
@media (max-width: 900px) {
  .admin-wrap, .admin-cols { grid-template-columns: 1fr; }
  .admin-nav { display: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav.open { display: flex; }
  .admin-header .nav-toggle { display: block; }
  .admin-main { padding: 16px; }
}
