/* sintrivo. — mobile-first PWA styles (iPhone safe areas, bottom tabs; left rail on desktop) */
:root {
  --bg: #120d16;
  --bg-2: #19111d;
  --surface: #231924;
  --surface-2: #302032;
  --line: #503748;
  --text: #f8edf0;
  --muted: #c3abb9;
  --faint: #b398aa;
  --accent: #f3adc3;
  --accent-2: #ad3b69;
  --accent-ink: #210f1b;
  --good: #63d4a6;
  --warn: #ffc76b;
  --danger: #ff5d6c;
  --grad: linear-gradient(135deg, #7e244e, #b13a68);
  --primary-ink: #fff5f8;
  --page-glow: rgba(160, 45, 96, .15);
  --radius: 20px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --tabbar-h: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fbf4ef; --bg-2: #f3e7e1; --surface: #fffdfb; --surface-2: #f5e9e4; --line: #dfc7c3;
  --text: #351a29; --muted: #735362; --faint: #80606d; --accent: #9d2851; --accent-2: #a62e59;
  --accent-ink: #ffffff; --good: #176849; --warn: #86500c; --danger: #b92745;
  --grad: linear-gradient(135deg, #7f1c42, #ad345c); --primary-ink: #ffffff;
  --page-glow: rgba(193, 111, 116, .11); --shadow: 0 12px 34px rgba(75, 27, 43, .08);
  color-scheme: light;
}
:root[data-theme="swingers"] {
  --bg: #10080d; --bg-2: #1b0b13; --surface: #24121b; --surface-2: #361722; --line: #654234;
  --text: #fff1df; --muted: #d0b5a7; --faint: #bba193; --accent: #e8c57a; --accent-2: #a1284b;
  --accent-ink: #21120c; --good: #9ad8b2; --warn: #f2ca83; --danger: #ff94a6;
  --grad: linear-gradient(135deg, #6f1735, #a3284e); --primary-ink: #fff2df;
  --page-glow: rgba(158, 27, 63, .23); --shadow: 0 16px 42px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at 80% 0%, var(--page-glow), transparent 55%), var(--bg); background-attachment: fixed;
  color: var(--text); font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
svg:not([width]) { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.pill svg:not([width]) { width: 14px; height: 14px; }
.notice svg:not([width]) { width: 16px; height: 16px; vertical-align: -3px; }
.locked svg:not([width]) { width: 28px; height: 28px; margin: 0 auto; color: var(--muted); }
.list-item > svg:not([width]) { width: 22px; height: 22px; color: var(--muted); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.brand { font-family: var(--serif); font-style: italic; font-size: 26px; color: var(--text); letter-spacing: -.5px; }
.brand .dot { color: var(--accent); font-style: normal; }
.topbar-actions { display: flex; gap: 6px; align-items: center; }
.view { flex: 1; padding: 16px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 24px); width: 100%; max-width: 760px; margin: 0 auto; outline: none; }
.view.wide { max-width: 1100px; }
.view.flush { padding: 0; max-width: none; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(7, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--bg-2) 92%, transparent); border-top: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 10.5px; font-weight: 600; position: relative; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] svg { color: var(--accent); }
.tab .badge-dot { position: absolute; top: 8px; left: calc(50% + 8px); }

@media (min-width: 900px) {
  .app { padding-left: 220px; }
  .tabs {
    top: 0; right: auto; width: 220px; height: 100%; grid-template-columns: 1fr; grid-auto-rows: 52px; align-content: start;
    padding: 84px 12px 12px; border-top: 0; border-right: 1px solid var(--line);
  }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; border-radius: 12px; font-size: 15px; }
  .tab[aria-current="page"] { background: var(--surface); }
  .tab .badge-dot { position: static; }
  .topbar { position: fixed; left: 0; top: 0; width: 220px; border: 0; background: transparent; backdrop-filter: none; }
  .topbar-actions { display: flex; position: fixed; right: 24px; top: 12px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
  .view { padding-top: 92px; padding-bottom: 40px; }
}

/* ---------- home & activity ---------- */
.activity-icons { display: flex; align-items: center; gap: 4px; }
.activity-icons .icon-btn { position: relative; }
.activity-icons .badge-dot { position: absolute; top: 0; right: -2px; }
.home-welcome { padding: 12px 0 22px; max-width: 720px; }
.home-welcome h1 { font-size: clamp(30px, 4vw, 44px); overflow-wrap: anywhere; }
.home-eyebrow { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.home-activity { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-stat { display: grid; grid-template-columns: 1fr auto; gap: 6px; color: var(--text); transition: border-color .15s; }
.home-stat:hover { border-color: var(--accent); }
.home-stat-icon { color: var(--accent); }
.home-stat-icon svg { width: 26px; height: 26px; }
.home-stat-count { font-size: 30px; font-weight: 700; line-height: 1; }
.home-stat-label { grid-column: 1 / -1; font-size: 14px; font-weight: 700; }
.home-stat-hint { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.home-columns { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; }
.home-news h3 { margin-top: 14px; font-size: 21px; font-family: var(--serif); }
.home-news p { font-size: 14px; line-height: 1.65; }
.home-text-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.home-about-intro { font-family: var(--serif); font-size: 24px; margin: 0; }
.home-about-item { display: flex; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.home-about-item > svg { color: var(--accent); margin-top: 2px; }
.home-about-item h3 { font-size: 14px; }
.home-about-item p { margin: 0; line-height: 1.6; }
@media (max-width: 600px) {
  .home-columns { grid-template-columns: 1fr; gap: 0; }
  .home-activity { gap: 8px; }
  .home-stat { padding: 12px 10px; }
  .home-stat-label { font-size: 12px; }
  .home-stat-count { font-size: 26px; }
  .home-stat-hint { font-size: 10px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar-actions, .activity-icons { gap: 2px; }
}
@media (max-width: 380px) { .tab { font-size: 9px; } }

/* ---------- selectable atmospheres ---------- */
.home-welcome h1 { font-weight: 500; letter-spacing: -.035em; }
.home-welcome .home-eyebrow { letter-spacing: .16em; }
:root[data-theme="swingers"] .brand, :root[data-theme="swingers"] .home-welcome h1 { color: var(--accent); }
:root[data-theme="swingers"] .home-stat { background: linear-gradient(145deg, #30131f, #1b0e15); border-color: #78513c; }
:root[data-theme="swingers"] .home-welcome { padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
:root[data-theme="swingers"] .home-welcome h1 { font-style: italic; }
.theme-intro { margin: 28px 0 22px; }
.theme-intro h2 { font-family: var(--serif); font-size: clamp(25px, 4vw, 34px); font-weight: 500; }
.theme-options { display: grid; gap: 16px; }
.theme-option { display: block; text-align: left; border: 1px solid var(--line); padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); overflow: hidden; cursor: pointer; }
.theme-option:hover { border-color: var(--accent); }
.theme-option[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-option:disabled { cursor: wait; }
.theme-preview { display: grid; gap: 12px; padding: 20px; background: var(--preview-bg); color: var(--preview-accent); border-bottom: 1px solid var(--line); }
.theme-preview-brand { font-family: var(--serif); font-style: italic; font-size: 28px; }
.theme-preview-line { display: block; width: 34%; height: 3px; border-radius: 4px; background: var(--preview-accent); opacity: .5; }
.theme-preview-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-preview-cards i { display: block; height: 34px; border-radius: 8px; background: var(--preview-surface); border-top: 2px solid var(--preview-detail); box-shadow: 0 5px 12px rgba(0, 0, 0, .08); }
.theme-option-title { display: flex; align-items: center; gap: 8px; padding: 16px 16px 8px; }
.theme-option-title > svg { color: var(--accent); }
.theme-selected { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--accent); font-size: 12px; }
.theme-selected svg { width: 16px; height: 16px; }
.theme-option-description { display: block; color: var(--muted); padding: 0 16px 18px; font-size: 13px; line-height: 1.6; }
@media (min-width: 650px) { .theme-options { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: no-preference) {
  .theme-option { transition: border-color .2s, box-shadow .2s; }
}

/* ---------- typography & layout ---------- */
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: -.3px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.stack.lg { gap: 20px; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.section { margin-top: 24px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 10px; }
.section-title h2 { margin: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-head h1 { margin: 0; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.tight { padding: 12px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--text); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item:active { background: var(--surface-2); }
.list-item .chev { color: var(--faint); margin-left: auto; }
.list-item .grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty .big { font-size: 40px; margin-bottom: 6px; }
.notice { border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer;
  transition: transform .08s ease, opacity .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--grad); border: 0; color: var(--primary-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent-2) 25%, transparent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: transparent; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 44px; padding: 0; }
.btn.on { border-color: var(--accent); color: var(--accent); }
.icon-btn { background: none; border: 0; color: var(--text); width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; cursor: pointer; position: relative; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn svg { width: 24px; height: 24px; }

label.field { display: grid; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-size: 16px; font-weight: 400; /* 16px stops iOS zoom */
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--text); font-weight: 400; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent-2); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { color: var(--danger); font-size: 14px; min-height: 0; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--accent-2); }
.switch input:checked + span::after { transform: translateX(20px); }

/* chips & segmented */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--text); cursor: default; }
button.chip { cursor: pointer; }
.chip.sel { background: color-mix(in srgb, var(--accent-2) 22%, var(--surface-2)); border-color: var(--accent-2); }
.chip.reason { background: color-mix(in srgb, var(--good) 14%, var(--surface)); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); font-size: 12.5px; }
.segmented { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.segmented button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 8px 12px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

.badge-dot { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-2); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.good { color: var(--good); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--danger); }

/* profile type badge */
.ptype { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ptype svg { width: 22px; height: 18px; color: var(--accent); flex: none; }
.ptype.compact .ptype-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.verified { color: #7fc8ff; display: inline-flex; vertical-align: -3px; }
.verified svg { width: 17px; height: 17px; }

/* ---------- discover grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.pcard { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); color: #fff; display: block; box-shadow: var(--shadow); }
.pcard img { width: 100%; height: 100%; object-fit: cover; }
.pcard .ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 46px; color: var(--faint); }
.pcard .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 10px 10px; background: linear-gradient(transparent, rgba(10, 2, 8, .85)); }
.pcard .name { font-weight: 700; font-size: 15.5px; display: flex; align-items: center; gap: 4px; }
.pcard .sub { font-size: 12px; opacity: .85; display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.pcard .ptype { color: #f3dce6; }
.pcard .ptype svg { color: #fff; }
.pcard .type-chip { position: absolute; top: 8px; left: 8px; background: rgba(10, 2, 8, .55); backdrop-filter: blur(6px); padding: 4px 8px; border-radius: 999px; }
.profile-view-status { position: absolute; top: 46px; right: 8px; padding: 4px 9px; border-radius: 999px; background: var(--surface); color: var(--text); border: 1px solid var(--line); font-size: 11px; font-weight: 700; }

/* ---------- profile ---------- */
.hero { position: relative; margin: -16px -16px 0; }
.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 5; max-height: 70vh; background: var(--surface-2); }
.carousel::-webkit-scrollbar { display: none; }
.carousel img, .carousel .ph { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.carousel .ph { display: grid; place-items: center; font-family: var(--serif); font-size: 80px; color: var(--faint); }
.hero .back { position: absolute; top: 10px; left: 10px; background: rgba(10, 2, 8, .5); color: #fff; backdrop-filter: blur(8px); }
.hero .dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.hero .dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.profile-head { padding-top: 16px; }
.profile-head h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.action { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.action svg { width: 22px; height: 22px; }
.action.on { color: var(--accent); border-color: var(--accent); }
.action:disabled { opacity: .45; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 0; padding: 0; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .tag { position: absolute; top: 5px; left: 5px; font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(10, 2, 8, .65); color: #fff; }
.thumb .tag.right { left: auto; right: 5px; }
.thumb.add { display: grid; place-items: center; border: 1.5px dashed var(--line); color: var(--muted); background: transparent; font-size: 30px; }
.blurred img { filter: blur(18px) saturate(.8); transform: scale(1.1); }
.locked { display: grid; place-items: center; text-align: center; gap: 10px; padding: 24px; }

/* ---------- messages ---------- */
.avatar { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: var(--surface-2); flex: none; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.chat { display: flex; flex-direction: column; height: calc(100dvh - var(--safe-top) - 58px - var(--tabbar-h) - var(--safe-bottom)); margin: -16px -16px 0; }
@media (min-width: 900px) { .chat { height: calc(100dvh - 28px); margin: -28px -16px 0; } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; -webkit-overflow-scrolling: touch; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; word-wrap: break-word; white-space: pre-wrap; position: relative; cursor: pointer; }
.bubble.mine { align-self: flex-end; background: var(--grad); border: 0; color: #fff; }
.bubble.system { align-self: center; background: none; border: 0; color: var(--faint); font-size: 12.5px; padding: 2px; cursor: default; }
.bubble.unsent { font-style: italic; opacity: .6; }
.bubble .who { font-size: 11.5px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.bubble .time { font-size: 10.5px; opacity: .65; margin-top: 3px; text-align: right; }
.bubble .pic { width: 200px; max-width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; margin: 2px 0; background: rgba(0, 0, 0, .2); }
.bubble .pic img { width: 100%; height: 100%; object-fit: cover; }
.seen { align-self: flex-end; font-size: 11px; color: var(--faint); margin-top: -2px; }
.typing { font-size: 12.5px; color: var(--faint); padding: 0 14px 6px; min-height: 20px; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--bg); }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; border-radius: 22px; padding: 11px 16px; resize: none; }

/* ---------- posts / events ---------- */
.post { padding: 14px; border-bottom: 1px solid var(--line); display: block; color: var(--text); }
.post:last-child { border-bottom: 0; }
.post .title { font-weight: 700; margin-bottom: 4px; }
.post .body { color: var(--muted); font-size: 14.5px; white-space: pre-wrap; }
.post .meta { font-size: 12.5px; color: var(--faint); margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.datehead { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; margin: 18px 0 8px; }
.event { display: flex; gap: 14px; padding: 14px; color: var(--text); border-bottom: 1px solid var(--line); }
.event:last-child { border-bottom: 0; }
.cal { flex: none; width: 54px; text-align: center; border-radius: 12px; background: var(--surface-2); padding: 6px 0; }
.cal .m { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.cal .d { font-size: 22px; font-weight: 700; line-height: 1.1; }

/* ---------- sheet / modal ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(5, 0, 4, .6); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 22px 22px 0 0; padding: 10px 18px calc(18px + var(--safe-bottom)); animation: up .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { margin-bottom: 14px; }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: var(--safe-top) 0 var(--safe-bottom); }
.lightbox img { max-width: 100vw; max-height: 86dvh; object-fit: contain; }
.lightbox .cap { color: #ddd; text-align: center; padding: 10px; font-size: 14px; }
.lightbox .close { position: absolute; top: calc(var(--safe-top) + 10px); right: 10px; color: #fff; }

.profile-cover { display: block; width: 100%; padding: 0; border: 0; aspect-ratio: 4 / 5; max-height: 65dvh; overflow: hidden; background: var(--surface-2); cursor: pointer; }
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover.ph { display: grid; place-items: center; font-family: var(--serif); font-size: 80px; color: var(--faint); cursor: default; }
.profile-photo-count { position: absolute; bottom: 14px; right: 14px; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid #ffffff40; border-radius: 999px; background: #140c15c9; color: #fff; cursor: pointer; }
.profile-photo-count svg { width: 18px; height: 18px; }
.profile-gallery { gap: 8px; }
.profile-gallery .thumb { aspect-ratio: 4 / 5; }
.profile-gallery .thumb:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gallery-viewer { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; background: #100c12f8; color: #fff; padding: var(--safe-top) 0 var(--safe-bottom); }
.gallery-toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 60px; }
.gallery-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.gallery-counter { white-space: nowrap; color: #ddd; font-variant-numeric: tabular-nums; }
.gallery-viewer .icon-btn { color: #fff; flex-shrink: 0; background: #ffffff18; }
.gallery-main { position: relative; flex: 1; min-height: 0; }
.gallery-stage { height: 100%; display: grid; place-items: center; padding: 0 54px; touch-action: pan-y pinch-zoom; }
.gallery-stage img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; user-select: none; }
.gallery-prev, .gallery-next { position: absolute; top: 50%; transform: translateY(-50%); }
.gallery-prev { left: 8px; } .gallery-next { right: 8px; }
.gallery-caption { text-align: center; color: #ddd; padding: 8px 16px; margin: 0; max-height: 70px; overflow-y: auto; }
.gallery-strip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px 14px; flex-shrink: 0; }
.gallery-mini { flex: 0 0 58px; height: 66px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; opacity: .5; cursor: pointer; }
.gallery-mini img { width: 100%; height: 100%; object-fit: cover; }
.gallery-mini[aria-pressed="true"] { opacity: 1; border-color: #fff; }
.gallery-viewer button:focus-visible { outline: 3px solid #f4c976; outline-offset: 2px; }
.gallery-error { text-align: center; color: #ddd; }
@media (max-width: 600px) { .gallery-stage { padding: 0; } .gallery-prev, .gallery-next { background: #100c1280 !important; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 200; max-width: calc(100vw - 32px); text-align: center; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- auth ---------- */
.auth {
  color: var(--text);
  min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 24px);
  background: radial-gradient(120% 70% at 50% 0%, var(--page-glow), transparent 65%), var(--bg);
}
.auth-inner { width: 100%; max-width: 420px; }
.auth .logo { font-family: var(--serif); font-style: italic; font-size: 56px; text-align: center; letter-spacing: -1px; color: var(--text); }
.auth .logo .dot { color: var(--accent); font-style: normal; }
.auth .tagline { text-align: center; color: var(--muted); margin-bottom: 28px; font-family: var(--serif); font-size: 18px; }
.type-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-pick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.type-pick button svg { width: 34px; height: 26px; color: var(--accent); }
.type-pick button[aria-pressed="true"] { border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 18%, var(--surface)); }
.install-hint { display: flex; gap: 10px; align-items: center; }

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- photo crop & scale editor ---------- */
.cropper { display: grid; gap: 12px; }
.crop-stage { display: flex; justify-content: center; }
.crop-frame { position: relative; border-radius: 14px; overflow: hidden; background: #000; touch-action: none; }
.crop-canvas { display: block; cursor: grab; touch-action: none; }
.crop-canvas:active { cursor: grabbing; }
.crop-grid {
  position: absolute; inset: 0; pointer-events: none; border: 1.5px solid rgba(255, 255, 255, .7); border-radius: 14px;
  background:
    linear-gradient(rgba(255, 255, 255, .28), rgba(255, 255, 255, .28)) 33.33% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(255, 255, 255, .28), rgba(255, 255, 255, .28)) 66.66% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(255, 255, 255, .28), rgba(255, 255, 255, .28)) 0 33.33% / 100% 1px no-repeat,
    linear-gradient(rgba(255, 255, 255, .28), rgba(255, 255, 255, .28)) 0 66.66% / 100% 1px no-repeat;
}
.crop-zoom { flex: 1; accent-color: var(--accent-2); height: 28px; }
.drop-zone {
  display: grid; justify-items: center; gap: 12px; text-align: center; padding: 28px 16px; border-radius: var(--radius);
  border: 1.5px dashed var(--line); color: var(--muted);
}
.drop-zone > svg:not([width]) { width: 34px; height: 34px; color: var(--accent); }
a.pill-link { text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
a.pill-link:not(.good) { color: var(--accent); }
