:root {
  --brand: #5b4cf0;
  --brand-2: #1fb6ff;
  --brand-soft: #ecebff;
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1c1e21;
  --muted: #65676b;
  --line: #e4e6eb;
  --hover: #f2f2f2;
  --danger: #e0245e;
  --like: #5b4cf0;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; }
[hidden] { display: none !important; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; font-weight: 600; background: #e4e6eb; transition: background .15s, transform .05s;
}
.btn:hover { background: #d8dadf; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: #4a3be0; }
.btn.primary:disabled { background: #b8b2f7; cursor: not-allowed; }
.btn.block { width: 100%; padding: 11px; font-size: 16px; }
.btn.success { background: #31a24c; color: #fff; }
.input {
  width: 100%; padding: 12px 14px; border: 1px solid #dddfe2; border-radius: 8px; font-size: 16px; background: #fff; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { resize: vertical; min-height: 90px; }
.icon { width: 20px; height: 20px; flex: none; }

/* ---------- Avatar ---------- */
.avatar {
  border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, #8b80ff, #4fc8ff);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; overflow: hidden;
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.md { width: 40px; height: 40px; font-size: 16px; }
.avatar.lg { width: 168px; height: 168px; font-size: 60px; border: 4px solid #fff; }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 64px; padding: 40px 20px; flex-wrap: wrap;
}
.auth-brand { max-width: 480px; }
.logo-text {
  font-weight: 700; letter-spacing: -1px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-brand .logo-text { font-size: 64px; line-height: 1; }
.auth-brand p { font-size: 24px; line-height: 1.35; margin: 14px 0 0; }
.auth-card {
  background: var(--card); width: 400px; max-width: 100%; padding: 20px; border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,.1), 0 8px 16px rgba(0,0,0,.1);
}
.auth-card form { display: grid; gap: 12px; }
.auth-card .divider { border-top: 1px solid var(--line); margin: 8px 0; }
.auth-card .center { text-align: center; }
.form-error { color: var(--danger); font-size: 14px; min-height: 1em; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 56px; background: var(--card); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px;
}
.topbar .left { display: flex; align-items: center; gap: 10px; }
.topbar .logo { display: flex; align-items: center; gap: 8px; }
.topbar .logo img { width: 40px; height: 40px; }
.topbar .logo-text { font-size: 26px; }
.topnav { display: flex; gap: 6px; }
.topnav a {
  width: 110px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--muted);
  border-bottom: 3px solid transparent;
}
.topnav a:hover { background: var(--hover); }
.topnav a.active { color: var(--brand); border-bottom-color: var(--brand); border-radius: 8px 8px 0 0; }
.topnav .icon { width: 26px; height: 26px; }
.topbar .right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; position: relative; }
.chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; font-weight: 600; }
.chip:hover { background: var(--hover); }
.round-btn { width: 40px; height: 40px; border-radius: 50%; background: #e4e6eb; display: flex; align-items: center; justify-content: center; }
.round-btn:hover { background: #d8dadf; }
.menu {
  position: absolute; right: 0; top: 48px; background: var(--card); border-radius: 10px; padding: 8px; width: 300px;
  box-shadow: 0 12px 28px rgba(0,0,0,.2), 0 2px 4px rgba(0,0,0,.1);
}
.menu a, .menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 8px; font-weight: 600; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--hover); }

/* ---------- Layout ---------- */
.home { display: grid; grid-template-columns: 300px minmax(0, 590px) 300px; justify-content: space-between; gap: 24px; padding: 16px; }
.sidebar { position: sticky; top: 72px; align-self: start; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; font-weight: 600; }
.side-link:hover { background: #e4e6eb; }
.side-title { color: var(--muted); font-weight: 600; font-size: 16px; margin: 8px 8px; }
.feed { display: grid; gap: 16px; align-content: start; }
.foot { color: var(--muted); font-size: 13px; padding: 12px 8px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Composer ---------- */
.composer { padding: 12px 16px; }
.composer .row { display: flex; gap: 8px; align-items: center; }
.composer .fake-input {
  flex: 1; text-align: left; background: var(--bg); padding: 10px 14px; border-radius: 999px; color: var(--muted); font-size: 16px;
}
.composer .fake-input:hover { background: #e4e6eb; }
.composer .actions { display: flex; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.composer .actions button { flex: 1; display: flex; gap: 8px; align-items: center; justify-content: center; padding: 8px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.composer .actions button:hover { background: var(--hover); }

/* ---------- Post ---------- */
.post-head { display: flex; gap: 10px; align-items: center; padding: 12px 16px 0; }
.post-head .meta { flex: 1; min-width: 0; }
.post-head .name { font-weight: 600; }
.post-head .name:hover { text-decoration: underline; }
.post-head .time { color: var(--muted); font-size: 13px; }
.post-text { padding: 4px 16px 12px; white-space: pre-wrap; word-wrap: break-word; }
.post-text.big { font-size: 22px; padding-bottom: 16px; }
.post-image { width: 100%; max-height: 700px; object-fit: contain; background: #000; cursor: zoom-in; }
.post-stats { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; color: var(--muted); font-size: 14px; }
.post-stats .likes { display: flex; align-items: center; gap: 6px; cursor: default; }
.like-badge { width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: inline-flex; align-items: center; justify-content: center; }
.like-badge svg { width: 11px; height: 11px; fill: #fff; }
.post-stats button:hover { text-decoration: underline; }
.post-actions { display: flex; margin: 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 0; }
.post-actions button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px; border-radius: 6px; color: var(--muted); font-weight: 600; }
.post-actions button:hover { background: var(--hover); }
.post-actions button.liked { color: var(--like); }
.post-actions button.liked svg { fill: var(--like); stroke: var(--like); }
.post-actions button.pop svg { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.4); } }
.comments { padding: 8px 16px 12px; display: grid; gap: 8px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment .bubble { background: var(--bg); border-radius: 18px; padding: 8px 12px; max-width: 100%; word-wrap: break-word; white-space: pre-wrap; }
.comment .bubble .name { font-weight: 600; font-size: 13px; display: block; }
.comment .bubble .name:hover { text-decoration: underline; }
.comment .sub { font-size: 12px; color: var(--muted); padding: 2px 12px; display: flex; gap: 12px; }
.comment .sub button { font-size: 12px; color: var(--muted); font-weight: 600; padding: 0; }
.comment .sub button:hover { text-decoration: underline; }
.comment-form { display: flex; gap: 8px; align-items: center; }
.comment-form input { flex: 1; background: var(--bg); border: 0; border-radius: 999px; padding: 9px 14px; outline: none; }
.comment-form input:focus { box-shadow: 0 0 0 2px var(--brand-soft); }
.comment-form .send { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--brand); }
.comment-form .send:hover { background: var(--hover); }
.more-btn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--muted); position: relative; }
.more-btn:hover { background: var(--hover); }
.post { position: relative; }
.post .menu { top: 52px; right: 12px; width: 220px; z-index: 5; }
.danger { color: var(--danger); }

/* ---------- Profile ---------- */
.profile-top { background: var(--card); box-shadow: var(--shadow); }
.profile-inner { max-width: 1100px; margin: 0 auto; }
.cover {
  position: relative; height: 400px; border-radius: 0 0 12px 12px; overflow: hidden;
  background: linear-gradient(135deg, #cfcaff 0%, #a9e4ff 100%);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .cover-btn { position: absolute; right: 24px; bottom: 20px; background: #fff; }
.cover .cover-btn:hover { background: #f0f0f0; }
.profile-head { display: flex; align-items: flex-end; gap: 18px; padding: 0 32px 16px; margin-top: -84px; position: relative; flex-wrap: wrap; }
.profile-head { pointer-events: none; z-index: 2; }
.profile-head .avatar-wrap, .profile-head .acts, .profile-head .bio { pointer-events: auto; }
.profile-head .avatar-wrap { position: relative; }
.profile-head .cam {
  position: absolute; right: 8px; bottom: 12px; width: 38px; height: 38px; border-radius: 50%; background: #e4e6eb;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.profile-head .cam:hover { background: #d8dadf; }
.profile-head .info, .profile-head .acts { margin-top: 92px; }
.tiny { width: 12px; height: 12px; vertical-align: -1px; }
.profile-head .info { flex: 1; padding-bottom: 8px; min-width: 220px; }
.profile-head h1 { margin: 0; font-size: 32px; line-height: 1.2; }
.profile-head .sub { color: var(--muted); font-weight: 600; }
.profile-head .bio { margin-top: 4px; }
.profile-head .acts { display: flex; gap: 8px; padding-bottom: 12px; }
.profile-tabs { border-top: 1px solid var(--line); margin: 0 32px; display: flex; gap: 4px; }
.profile-tabs span { padding: 14px 16px; color: var(--brand); font-weight: 600; border-bottom: 3px solid var(--brand); }
.profile-body { max-width: 1100px; margin: 16px auto; padding: 0 16px; display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 16px; align-items: start; }
.profile-body .side { position: sticky; top: 72px; display: grid; gap: 16px; }
.intro { padding: 16px; }
.intro h3 { margin: 0 0 12px; font-size: 20px; }
.intro .bio { text-align: center; padding-bottom: 12px; white-space: pre-wrap; }
.intro .line { display: flex; gap: 10px; align-items: center; color: var(--text); padding: 6px 0; }
.intro .line .icon { color: var(--muted); }
.photos { padding: 16px; }
.photos h3 { margin: 0 0 12px; font-size: 20px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 8px; overflow: hidden; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; }

.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.people { display: grid; gap: 2px; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(244,244,244,.8); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--card); border-radius: 10px; width: 500px; max-width: 100%; max-height: 92vh; overflow: auto; box-shadow: 0 12px 28px rgba(0,0,0,.2), 0 2px 4px rgba(0,0,0,.1); }
.modal-head { position: relative; text-align: center; padding: 16px; border-bottom: 1px solid var(--line); font-size: 20px; font-weight: 700; }
.modal-head .close { position: absolute; right: 12px; top: 10px; }
.modal-body { padding: 16px; display: grid; gap: 12px; }
.modal-body .who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.modal textarea.plain { border: 0; outline: none; resize: none; font-size: 22px; min-height: 120px; width: 100%; }
.preview { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.preview img { width: 100%; max-height: 360px; object-fit: contain; border-radius: 6px; background: #f7f7f7; }
.preview .x { position: absolute; top: 14px; right: 14px; background: #fff; }
.addbar { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font-weight: 600; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 60; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 95vw; max-height: 95vh; object-fit: contain; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 70; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .home { grid-template-columns: minmax(0, 590px) 280px; justify-content: center; }
  .home .left-side { display: none; }
}
@media (max-width: 900px) {
  .home { grid-template-columns: minmax(0, 590px); }
  .home .right-side { display: none; }
  .profile-body { grid-template-columns: 1fr; }
  .profile-body .side { position: static; }
  .cover { height: 220px; border-radius: 0; }
  .profile-head { flex-direction: column; align-items: center; text-align: center; margin-top: -70px; }
  .profile-head .info, .profile-head .acts { margin-top: 0; }
  .avatar.lg { width: 140px; height: 140px; font-size: 50px; }
  .profile-head .acts { justify-content: center; }
  .topnav a { width: 64px; }
  .chip .chip-name { display: none; }
}
@media (max-width: 560px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .topbar .logo-text { display: none; }
  .home { padding: 8px 0; }
  .card { border-radius: 0; }
  .auth-brand { text-align: center; }
  .auth-brand .logo-text { font-size: 48px; }
  .auth-brand p { font-size: 18px; }
}

/* ---------- Confirm image changes ---------- */
.avatar.xl { width: 200px; height: 200px; font-size: 72px; }
.avatar-preview { display: flex; justify-content: center; padding: 12px 0; }
.avatar-preview .avatar { box-shadow: 0 0 0 4px var(--brand-soft); }
.confirm-note { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.danger-btn { color: var(--danger); }
.cover .cover-menu { right: 24px; top: auto; bottom: 64px; width: 220px; z-index: 3; }
.cover.previewing { box-shadow: inset 0 0 0 3px var(--brand); }
.confirm-bar {
  position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: rgba(0,0,0,.55); flex-wrap: wrap;
}
.confirm-bar .confirm-note { color: #fff; }
.confirm-bar .btn { position: static; }
.cover .confirm-bar .btn.ghost { background: rgba(255,255,255,.2); color: #fff; }
.cover .confirm-bar .btn.ghost:hover { background: rgba(255,255,255,.3); }
.cover .confirm-bar .btn.primary { background: var(--brand); color: #fff; }

/* ---------- Profile/cover update posts ---------- */
.kind-label { color: var(--muted); font-weight: 400; }
.avatar-post {
  height: 360px; display: flex; align-items: center; justify-content: center; cursor: zoom-in;
  background: linear-gradient(135deg, #e9e6ff 0%, #d6f1ff 100%);
}
.avatar-post img { width: 300px; height: 300px; border-radius: 50%; object-fit: cover; border: 6px solid #fff; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
@media (max-width: 560px) { .avatar-post { height: 280px; } .avatar-post img { width: 230px; height: 230px; } }

/* ---------- Cover drag ---------- */
.cover img.dragging-img { cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none; }
.cover img.dragging-img:active { cursor: grabbing; }
.drag-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
  background: rgba(0,0,0,.5); color: #fff; padding: 8px 14px; border-radius: 8px; display: flex; gap: 8px; align-items: center; font-weight: 600;
}

/* ---------- Photo viewer ---------- */
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 60; display: flex; flex-direction: column; }
.viewer-top { display: flex; justify-content: space-between; padding: 12px 16px; }
.viewer-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; display: flex; align-items: center; justify-content: center; }
.viewer-btn:hover { background: rgba(255,255,255,.28); }
.viewer-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 16px 24px; min-height: 0; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .viewer-menu { right: 0; top: 48px; width: 240px; }

/* ---------- Badges ---------- */
.topnav a, .round-btn { position: relative; }
.badge {
  position: absolute; top: 2px; right: 22px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: #e41e3f; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1;
}
.round-btn .badge { top: -4px; right: -4px; }
.side-badge { background: #e41e3f; color: #fff; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }

/* ---------- Left nav ---------- */
.side-ic { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.side-svg { width: 36px; height: 36px; }
.side-link.current { background: #e4e6eb; }
.side-link .avatar.md { flex: none; }

/* ---------- Generic page with left nav ---------- */
.page { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; padding: 16px; max-width: 1400px; margin: 0 auto; }
.page-main { display: grid; gap: 24px; align-content: start; min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 20px; }
.section-head .count { color: var(--danger); }
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.person-grid.groups { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.person-card, .group-card { overflow: hidden; display: flex; flex-direction: column; }
.pc-photo { display: block; aspect-ratio: 1; background: #e4e6eb; }
.pc-photo img, .pc-photo .ph { width: 100%; height: 100%; object-fit: cover; }
.ph { display: flex; align-items: center; justify-content: center; font-size: 64px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #8b80ff, #4fc8ff); }
.pc-body { padding: 10px 12px 12px; display: grid; gap: 6px; }
.pc-name { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-name:hover { text-decoration: underline; }
.pc-sub { color: var(--muted); font-size: 13px; }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.soft:hover { background: #dedbff; }
.gc-cover { display: block; aspect-ratio: 16/8; background: #e4e6eb; }
.gc-cover img { width: 100%; height: 100%; object-fit: cover; }
.gc-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #e9e6ff, #d6f1ff); }
.gc-ic { width: 64px; height: 64px; }
.card-title-row { display: flex; justify-content: space-between; align-items: baseline; }
.card-title-row h3 { margin: 0 0 12px; font-size: 20px; }
.link { color: var(--brand); }
.link:hover { text-decoration: underline; }
.friend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.friend-grid a { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.friend-grid img, .friend-grid .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; font-size: 32px; }
.friend-grid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-cover-prev { border: 1px dashed #ccd0d5; border-radius: 8px; aspect-ratio: 16/6; display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; }
.group-cover-prev img { width: 100%; height: 100%; object-fit: cover; }
.group-cover { height: 340px; }
.group-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 16px 32px 20px; flex-wrap: wrap; }
.group-head h1 { margin: 0; font-size: 30px; }
.group-head .sub { color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.memories-hero { display: flex; gap: 14px; align-items: center; padding: 18px; margin-bottom: 12px; }
.mh-ic { width: 56px; height: 56px; display: flex; }
.mh-ic .side-svg { width: 56px; height: 56px; }
.mem-title { margin: 12px 0 4px; color: var(--muted); font-size: 16px; }
.feed-col { display: grid; gap: 16px; max-width: 680px; }
.page-main .card.empty { max-width: 100%; }

/* ---------- Profile relation buttons ---------- */
.profile-head .acts { flex-wrap: wrap; }

/* ---------- Messenger panel ---------- */
.msg-panel { width: 360px; max-height: 80vh; overflow: auto; padding: 8px 8px 12px; }
.panel-head h3 { margin: 4px 8px 8px; font-size: 24px; }
.chat-search-wrap { display: flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 999px; padding: 0 12px; margin: 0 4px 8px; }
.tiny-search { width: 16px; height: 16px; color: var(--muted); }
.chat-search { border: 0; background: transparent; outline: none; padding: 9px 0; flex: 1; }
.conv-list { display: grid; gap: 2px; }
.menu .conv { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; font-weight: 400; text-align: left; width: 100%; }
.conv-body { flex: 1; min-width: 0; }
.conv-name { font-weight: 600; }
.conv-last { color: var(--muted); font-size: 13px; display: flex; white-space: nowrap; }
.conv-last .ellipsis { overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.conv.unread .conv-name, .conv.unread .conv-last { color: var(--text); font-weight: 700; }
.conv .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); flex: none; }
.avatar.lg2 { width: 56px; height: 56px; font-size: 22px; }
.avatar.xs { width: 28px; height: 28px; font-size: 12px; }

/* ---------- Chat windows ---------- */
.chat-dock { position: fixed; right: 16px; bottom: 0; display: flex; gap: 10px; align-items: flex-end; z-index: 40; pointer-events: none; }
.chat-win {
  width: 330px; height: 450px; background: #fff; border-radius: 10px 10px 0 0; display: flex; flex-direction: column; pointer-events: auto;
  box-shadow: 0 12px 28px rgba(0,0,0,.2), 0 2px 4px rgba(0,0,0,.1);
}
.chat-win.min { height: auto; }
.chat-win.min .chat-list, .chat-win.min .chat-form, .chat-win.min .seen { display: none; }
.chat-head { display: flex; align-items: center; gap: 2px; padding: 6px 6px 6px 8px; border-bottom: 1px solid var(--line); }
.chat-who { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; padding: 4px; border-radius: 6px; }
.chat-who:hover { background: var(--hover); }
.chat-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-ic { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--brand); flex: none; }
.chat-ic .icon { width: 18px; height: 18px; }
.chat-ic:hover { background: var(--hover); }
.chat-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 3px; }
.chat-empty { margin: auto; display: grid; justify-items: center; gap: 6px; color: var(--muted); text-align: center; }
.chat-empty b { color: var(--text); }
.msg { display: flex; align-items: flex-end; gap: 6px; max-width: 80%; }
.msg.mine { align-self: flex-end; }
.msg-content { display: grid; gap: 3px; justify-items: start; }
.msg.mine .msg-content { justify-items: end; }
.msg .bubble { background: #f0f0f0; padding: 7px 12px; border-radius: 18px; white-space: pre-wrap; word-break: break-word; }
.msg.mine .bubble { background: linear-gradient(135deg, var(--brand), #3b82f6); color: #fff; }
.msg-img { max-width: 200px; max-height: 220px; border-radius: 14px; cursor: zoom-in; object-fit: cover; }
.seen { font-size: 11px; color: var(--muted); text-align: right; padding: 0 12px 4px; }
.chat-form { display: flex; align-items: flex-end; gap: 4px; padding: 8px; }
.chat-input { flex: 1; resize: none; border: 0; background: var(--bg); border-radius: 18px; padding: 8px 12px; outline: none; max-height: 100px; line-height: 1.35; }

@media (max-width: 1100px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .page .left-side { display: none; }
}
@media (max-width: 900px) {
  .group-cover { height: 200px; }
  .group-head { padding: 12px 16px; }
}
@media (max-width: 700px) {
  .chat-dock { left: 0; right: 0; }
  .chat-win { width: 100%; height: 75vh; }
  .msg-panel { position: fixed; left: 8px; right: 8px; width: auto; top: 60px; }
  .person-grid { grid-template-columns: repeat(2, 1fr); }
  .badge { right: 6px; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 8px; }
  .topnav { gap: 0; }
  .topnav a { width: 50px; }
  .topbar .chip { display: none; }
  .topbar .right { gap: 6px; }
}

/* ---------- Top-right buttons (Facebook-style) ---------- */
.tb-item { position: relative; }
.topbar .right .round-btn .icon { width: 20px; height: 20px; }
.me-btn { position: relative; display: block; border-radius: 50%; }
.me-btn:hover .avatar { filter: brightness(.95); }
.me-caret {
  position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border-radius: 50%; background: #e4e6eb; border: 2px solid var(--card);
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.me-caret svg { width: 12px; height: 12px; }
.topbar .menu { right: 0; top: 48px; }
.panel-head h3 { margin: 4px 8px 8px; font-size: 24px; }
.panel-head.row { display: flex; align-items: center; justify-content: space-between; }
.panel-sep { border-top: 1px solid var(--line); margin: 8px 0; }
.link-btn { color: var(--brand); font-weight: 500; padding: 4px 8px; border-radius: 6px; }
.link-btn:hover { background: var(--hover); }

.apps-panel { width: 380px; padding: 8px 8px 10px; }
.apps-grid { display: grid; gap: 2px; }
.menu .app-tile { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; font-weight: 400; }
.app-name { font-weight: 600; }
.app-desc { color: var(--muted); font-size: 13px; }
.menu .app-action { display: flex; align-items: center; gap: 12px; padding: 6px 8px; font-weight: 600; }

.notif-panel { width: 380px; max-height: 85vh; overflow: auto; padding: 8px; }
.pills { display: flex; gap: 6px; padding: 0 6px 8px; }
.pill { padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.pill:hover { background: var(--hover); }
.pill.on { background: var(--brand-soft); color: var(--brand); }
.notif { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 8px; cursor: pointer; }
.notif:hover { background: var(--hover); }
.notif-av { position: relative; flex: none; }
.notif-badge { position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; border: 2px solid var(--card); }
.notif-badge .nb-ic { width: 14px; height: 14px; }
.notif-badge svg { fill: currentColor; }
.nb-like { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.nb-comment { background: #31a24c; }
.nb-comment svg, .nb-friend svg, .nb-follow svg, .nb-group svg { fill: none; }
.nb-friend { background: #1877f2; }
.nb-follow { background: #f5533d; }
.nb-group { background: #5b4cf0; }
.notif-body { flex: 1; min-width: 0; }
.notif-text { line-height: 1.35; }
.notif-extra { color: var(--muted); }
.notif.unread .notif-extra { color: var(--text); }
.notif-time { font-size: 13px; color: var(--muted); margin-top: 2px; }
.notif-time.fresh { color: var(--brand); font-weight: 600; }
.notif .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); flex: none; }
.notif-acts { display: flex; gap: 8px; margin-top: 8px; }
.notif-acts .btn { padding: 6px 16px; }
.notif-empty { display: grid; justify-items: center; gap: 8px; color: var(--muted); padding: 32px 8px; text-align: center; }
.empty-ic { width: 48px; height: 48px; opacity: .5; }

.account-panel { width: 360px; padding: 8px 8px 12px; }
.acc-card { border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.15); padding: 6px 8px 10px; margin-bottom: 12px; background: var(--card); }
.menu .acc-me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; font-size: 17px; }
.menu .acc-all { justify-content: center; font-weight: 600; }
.menu .acc-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; font-weight: 600; width: 100%; text-align: left; }
.acc-ic { width: 36px; height: 36px; border-radius: 50%; background: #e4e6eb; display: flex; align-items: center; justify-content: center; flex: none; }
.acc-ic .icon { width: 20px; height: 20px; }
.acc-label { flex: 1; display: grid; font-weight: 600; }
.acc-sub { font-weight: 400; font-size: 13px; color: var(--muted); }
.acc-arrow { color: var(--muted); display: flex; }
.acc-arrow .icon { width: 22px; height: 22px; }
.acc-foot { color: var(--muted); font-size: 12px; padding: 10px 8px 0; }
.acc-back { display: flex; align-items: center; gap: 8px; padding: 4px; margin-bottom: 4px; }
.acc-back h3 { margin: 0; font-size: 22px; }
.acc-section { padding: 4px 4px 8px; }
.acc-sec-head { display: flex; gap: 12px; align-items: flex-start; padding: 8px 4px; }
.radio-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px 10px 56px; border-radius: 8px; cursor: pointer; }
.radio-row:hover { background: var(--hover); }
.radio-row input { width: 20px; height: 20px; accent-color: var(--brand); }

/* ---------- Settings ---------- */
.page-title { margin: 0; font-size: 26px; }
.settings-card { padding: 20px; max-width: 720px; display: grid; gap: 10px; }
.settings-card h2 { margin: 0; font-size: 19px; }
.set-field { display: grid; gap: 6px; font-weight: 600; }
.set-acts { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 4px; gap: 4px; width: max-content; }
.seg button { padding: 8px 18px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--brand); box-shadow: var(--shadow); }
.btn.danger-solid { background: #e41e3f; color: #fff; }
.btn.danger-solid:hover { background: #c8102e; }
.faq { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq div { color: var(--muted); padding-top: 8px; }

/* ---------- Large text ---------- */
html[data-fs="large"] body { font-size: 17px; }
html[data-fs="large"] .post-text { font-size: 17px; }

/* ---------- Dark mode ---------- */
html[data-theme="dark"] {
  --bg: #18191a; --card: #242526; --text: #e4e6eb; --muted: #b0b3b8; --line: #3a3b3c; --hover: #3a3b3c;
  --brand-soft: #2e2a5c; --shadow: 0 1px 2px rgba(0,0,0,.4);
  color-scheme: dark;
}
html[data-theme="dark"] .btn, html[data-theme="dark"] .round-btn, html[data-theme="dark"] .acc-ic,
html[data-theme="dark"] .me-caret, html[data-theme="dark"] .profile-head .cam, html[data-theme="dark"] .pc-photo { background: #3a3b3c; }
html[data-theme="dark"] .btn:hover, html[data-theme="dark"] .round-btn:hover { background: #4e4f50; }
html[data-theme="dark"] .btn.primary { background: var(--brand); }
html[data-theme="dark"] .btn.soft { background: var(--brand-soft); color: #b9b2ff; }
html[data-theme="dark"] .btn.danger-solid { background: #e41e3f; }
html[data-theme="dark"] .btn.success { background: #31a24c; }
html[data-theme="dark"] .input { background: #3a3b3c; border-color: #3a3b3c; }
html[data-theme="dark"] .side-link:hover, html[data-theme="dark"] .side-link.current,
html[data-theme="dark"] .composer .fake-input:hover { background: #3a3b3c; }
html[data-theme="dark"] .chat-win, html[data-theme="dark"] .cover .cover-btn { background: var(--card); color: var(--text); }
html[data-theme="dark"] .msg .bubble { background: #3a3b3c; }
html[data-theme="dark"] .msg.mine .bubble { background: linear-gradient(135deg, var(--brand), #3b82f6); }
html[data-theme="dark"] .overlay { background: rgba(0,0,0,.7); }
html[data-theme="dark"] .avatar.lg, html[data-theme="dark"] .profile-head .cam { border-color: var(--card); }
html[data-theme="dark"] .modal textarea.plain { background: transparent; }
html[data-theme="dark"] .avatar-post { background: linear-gradient(135deg, #2b2650, #173040); }
html[data-theme="dark"] .avatar-post img { border-color: var(--card); }
html[data-theme="dark"] .cover { background: linear-gradient(135deg, #3b3570 0%, #1e4a5f 100%); }
html[data-theme="dark"] .gc-ph { background: linear-gradient(135deg, #2b2650, #173040); }
html[data-theme="dark"] .acc-card { box-shadow: 0 2px 12px rgba(0,0,0,.5); }
html[data-theme="dark"] .toast { background: #e4e6eb; color: #18191a; }
html[data-theme="dark"] .preview .x { background: #3a3b3c; }
.modal textarea.plain { background: transparent; color: var(--text); }

@media (max-width: 700px) {
  .apps-panel, .notif-panel, .account-panel { position: fixed; left: 8px; right: 8px; width: auto; top: 60px; max-height: calc(100vh - 80px); overflow: auto; }
}
@media (max-width: 560px) {
  .topbar .right { gap: 4px; }
  .topbar .right .round-btn { width: 36px; height: 36px; }
  .topnav a { width: 44px; }
  .topbar .logo img { width: 34px; height: 34px; }
}
.menu .pill, .menu .link-btn, .menu .round-btn, .menu .notif-acts .btn { width: auto; display: inline-flex; justify-content: center; }
.menu .notif-acts .btn { flex: 1; }
.panel-head h3, .acc-back h3 { white-space: nowrap; }
.acc-back h3 { font-size: 20px; }
.menu .notif { width: 100%; }

/* ---------- Clickable stats & people lists ---------- */
.stats-links button, .muted-link { color: var(--muted); font-weight: 600; padding: 0; }
.stats-links button:hover, .muted-link:hover { text-decoration: underline; color: var(--text); }
.post-stats .likes { background: none; color: inherit; padding: 0; cursor: pointer; }
.post-stats .likes:hover { text-decoration: underline; }
.people-list { display: grid; gap: 2px; max-height: 60vh; overflow: auto; margin: 0 -8px; }
.person-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.person-row:hover { background: var(--hover); }
.pr-main { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.pr-name { font-weight: 600; }
.pr-name:hover { text-decoration: underline; }
.pr-you { color: var(--muted); font-weight: 400; }
.pr-sub { color: var(--muted); font-size: 13px; }
.chip-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 14px; padding: 6px 10px; }
.btn.icon-only { padding: 8px 10px; }
.chat-head .chat-ic { width: 30px; height: 30px; }

/* ---------- Call screen ---------- */
.call-screen {
  position: fixed; inset: 0; z-index: 100; background: radial-gradient(circle at 50% 30%, #3b3480 0%, #15132b 70%);
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; transition: opacity .3s; }
.call-screen.has-remote .remote-video { opacity: 1; }
.call-screen:not(.is-video) .remote-video { width: 1px; height: 1px; }
.call-info { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; margin-bottom: 120px; }
.call-info .avatar.xl { width: 128px; height: 128px; font-size: 48px; box-shadow: 0 0 0 6px rgba(255,255,255,.12); }
.call-screen.ringing .call-info .avatar { animation: ring-pulse 1.5s ease-out infinite; }
@keyframes ring-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.4); } 100% { box-shadow: 0 0 0 28px rgba(255,255,255,0); } }
.call-name { font-size: 26px; font-weight: 700; margin-top: 8px; }
.call-kind { opacity: .7; font-size: 14px; }
.call-status { font-size: 17px; opacity: .9; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.call-screen.has-remote .call-info { position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 16px; margin: 0; justify-items: start; text-align: left; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.call-screen.has-remote .call-info .avatar { display: none; }
.call-screen.has-remote .call-name { font-size: 20px; margin: 0; }
.local-video {
  position: absolute; right: 16px; top: calc(16px + env(safe-area-inset-top)); width: 120px; aspect-ratio: 3/4; object-fit: cover;
  border-radius: 12px; background: #000; box-shadow: 0 4px 16px rgba(0,0,0,.5); display: none; transform: scaleX(-1);
}
.call-screen.has-local .local-video { display: block; }
.call-controls {
  position: absolute; bottom: calc(32px + env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; padding: 0 12px;
}
.call-btn { display: grid; justify-items: center; gap: 6px; color: #fff; }
.call-btn > .icon { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; padding: 17px; backdrop-filter: blur(6px); }
.call-btn:hover > .icon { background: rgba(255,255,255,.28); }
.call-btn.off > .icon { background: #fff; color: #15132b; }
.call-btn.end > .icon { background: #e41e3f; }
.call-btn.accept > .icon { background: #31a24c; }
.call-btn.end:hover > .icon { background: #c8102e; }
.call-btn.accept:hover > .icon { background: #2a8f42; }
.call-btn-label { font-size: 12px; opacity: .85; }
.call-controls.incoming { gap: 40px; }
.call-controls.incoming .call-btn > .icon { width: 68px; height: 68px; padding: 19px; }
@media (max-width: 560px) {
  .local-video { width: 96px; }
  .call-controls { gap: 12px; }
  .call-btn > .icon { width: 54px; height: 54px; padding: 15px; }
}
.profile-head .stats-links, .profile-head h1 { pointer-events: auto; }

/* ---------- Sign-up / email verification ---------- */
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bd-row { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 8px; }
select.input { padding: 10px; appearance: auto; }
.field-label { font-size: 13px; color: var(--muted); margin-bottom: -6px; }
.field-hint { font-size: 12.5px; color: var(--muted); margin-top: -4px; }
.center-link { justify-self: center; font-size: 14px; }
.dev-note { background: #fff7e0; color: #7a5200; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.ok-note { background: #e7f7ec; color: #17642f; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.check-mail { display: grid; gap: 12px; text-align: center; padding: 8px 4px; }
.mail-ic { justify-self: center; width: 72px; height: 72px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.mail-ic .icon { width: 36px; height: 36px; }
.mail-addr { font-weight: 700; margin-top: 4px; word-break: break-all; }
.lock-note { display: flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 14px; color: var(--muted); }
.email-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.verified-tag { display: inline-flex; align-items: center; gap: 4px; color: #17642f; background: #e7f7ec; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; }
html[data-theme="dark"] .dev-note { background: #3d3214; color: #f5d27a; }
html[data-theme="dark"] .ok-note, html[data-theme="dark"] .verified-tag { background: #173a24; color: #8ee0a8; }
html[data-theme="dark"] select.input { background: #3a3b3c; color: var(--text); }
@media (max-width: 420px) { .bd-row { grid-template-columns: 1fr 1fr; } .bd-row select:last-child { grid-column: span 2; } }

/* =================== Round 9: reactions, share, search, composer, live =================== */
.modal-head.with-back { padding-left: 56px; padding-right: 56px; }
.modal-head .back { position: absolute; left: 12px; top: 10px; }

/* Reactions */
.react-wrap { position: relative; flex: 1; display: flex; }
.react-wrap > .like-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px; border-radius: 6px; color: var(--muted); font-weight: 600; }
.react-wrap > .like-btn:hover { background: var(--hover); }
.like-btn.reacted .react-emoji { font-size: 19px; line-height: 1; }
.like-btn.pop .react-emoji, .like-btn.pop .icon { animation: pop .35s ease; }
.react-picker {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 20; display: flex; gap: 4px; padding: 6px 8px;
  background: var(--card); border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.2), 0 1px 3px rgba(0,0,0,.1); animation: rp-in .18s ease-out;
}
@keyframes rp-in { from { transform: translateY(8px) scale(.9); opacity: 0; } }
.rp-item { font-size: 30px; line-height: 1; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; transition: transform .15s; position: relative; }
.rp-item:hover { transform: scale(1.35) translateY(-6px); }
.rp-item:hover::after { content: attr(data-label); position: absolute; top: -30px; left: 50%; transform: translateX(-50%) scale(.75); background: rgba(0,0,0,.75); color: #fff; font-size: 13px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.react-stack { display: inline-flex; margin-right: 4px; }
.rs-emoji { font-size: 15px; line-height: 1; width: 20px; height: 20px; border-radius: 50%; background: var(--card); display: inline-flex; align-items: center; justify-content: center; margin-left: -4px; box-shadow: 0 0 0 2px var(--card); }
.react-stack .rs-emoji:first-child { margin-left: 0; }
.stats-right { display: flex; gap: 12px; }
.react-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px -4px 0; flex-wrap: wrap; }
.rt { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.rt.on { color: var(--brand); border-bottom-color: var(--brand); }
.rt:hover { background: var(--hover); border-radius: 8px 8px 0 0; }
.rt .rs-emoji { box-shadow: none; background: none; margin: 0; }
.more-react { top: 44px; left: 0; right: auto; width: 160px; z-index: 5; }
.more-react button { gap: 10px; }
.av-react { position: relative; display: inline-flex; flex: none; }
.av-badge { position: absolute; right: -4px; bottom: -4px; font-size: 14px; line-height: 1; width: 20px; height: 20px; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; }

/* Post header extras */
.headline { line-height: 1.35; }
.hl-strong { font-weight: 600; }
.hl-emoji { font-size: 16px; }
.post-head .time a:hover { text-decoration: underline; }
.post-video { width: 100%; max-height: 640px; background: #000; display: block; }
.post-gif { max-width: 100%; margin: 0 auto; display: block; }
.post-actions > button { flex: 1; }
.place-card { display: flex; align-items: center; gap: 12px; margin: 0 16px 10px; padding: 12px; border-radius: 10px; background: var(--bg); }
.place-card:hover { background: var(--hover); }
.place-card .pc-pin .act-ic { width: 32px; height: 32px; }
.shared-embed { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; }
.shared-embed .post-image, .shared-embed .post-video { max-height: 420px; }
.shared-embed.unavailable { cursor: default; padding: 14px; background: var(--bg); display: grid; gap: 4px; }
.se-body { padding: 10px 12px; display: grid; gap: 6px; }
.se-head { display: flex; gap: 8px; align-items: center; }
.se-head .time { color: var(--muted); font-size: 12px; }
.se-text { white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.compose-preview .shared-embed { cursor: default; }
.live-block { position: relative; display: grid; justify-items: center; gap: 10px; padding: 40px 16px; cursor: pointer; color: #fff; background: radial-gradient(circle at 50% 30%, #4a3fb8, #15132b 75%); }
.live-block .avatar.xl { width: 96px; height: 96px; font-size: 36px; box-shadow: 0 0 0 4px #f02849; }
.live-title { font-weight: 700; font-size: 18px; }
.live-badge { background: #f02849; color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .5px; padding: 3px 8px; border-radius: 4px; }
.live-block > .live-badge { position: absolute; top: 12px; left: 12px; }
.live-ended { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--bg); }
.video-wrap { position: relative; }
.was-live { position: absolute; top: 10px; left: 10px; z-index: 1; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.link { color: var(--brand); word-break: break-all; }

/* Composer */
.composer .actions button { gap: 6px; }
.act-ic { width: 24px; height: 24px; }
.who-line { line-height: 1.35; }
.aud-btn { display: inline-flex; align-items: center; gap: 4px; background: #e4e6eb; border-radius: 6px; padding: 3px 8px; font-size: 13px; font-weight: 600; margin-top: 4px; }
.aud-btn:hover { background: #d8dadf; }
.aud-btn.light { background: rgba(255,255,255,.2); color: #fff; }
html[data-theme="dark"] .aud-btn:not(.light) { background: #3a3b3c; }
.compose-preview { display: grid; gap: 8px; }
.compose-preview video { width: 100%; max-height: 360px; border-radius: 6px; background: #000; }
.addbar { flex-wrap: wrap; gap: 6px; }
.add-label { font-weight: 600; padding: 4px 6px; border-radius: 6px; }
.add-label:hover { background: var(--hover); }
.add-icons { display: flex; gap: 2px; }
.add-ic { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.add-ic:hover { background: var(--hover); }
.add-ic.on { background: var(--brand-soft); }
.add-list { grid-template-columns: 1fr 1fr; }
.add-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; font-weight: 600; text-align: left; }
.add-row:hover { background: var(--hover); }
.upload-progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.upload-progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .2s; }

/* Pickers */
.aud-list { display: grid; gap: 2px; }
.aud-row, .pick-row, .place-row, .share-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; cursor: pointer; text-align: left; width: 100%; }
.aud-row:hover, .pick-row:hover, .place-row:hover, .share-row:hover { background: var(--hover); }
.aud-row.on { background: var(--brand-soft); }
.aud-ic { width: 44px; height: 44px; border-radius: 50%; background: #e4e6eb; display: flex; align-items: center; justify-content: center; flex: none; }
html[data-theme="dark"] .aud-ic { background: #3a3b3c; }
.aud-ic .icon { width: 22px; height: 22px; }
.aud-text { flex: 1; display: grid; min-width: 0; }
.aud-sub { font-size: 13px; color: var(--muted); text-align: left; }
.aud-sub.link-like { color: var(--brand); font-weight: 600; padding: 0; }
.aud-sub.link-like:hover { text-decoration: underline; }
.aud-row input, .pick-row input[type=checkbox], .aud-default input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.aud-default { display: flex; justify-content: space-between; align-items: center; color: var(--muted); padding: 4px 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-sel { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 4px 6px 4px 12px; font-weight: 600; font-size: 14px; }
.chip-sel button { font-size: 18px; line-height: 1; width: 22px; height: 22px; border-radius: 50%; color: inherit; }
.tab-line { display: flex; border-bottom: 1px solid var(--line); margin: -8px -16px 0; padding: 0 16px; }
.tab-line button { padding: 12px 16px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.tab-line button.on { color: var(--brand); border-bottom-color: var(--brand); }
.feel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; max-height: 55vh; overflow: auto; margin: 0 -8px; }
.feel-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; text-align: left; }
.feel-item:hover { background: var(--hover); }
.feel-emoji { font-size: 22px; width: 36px; height: 36px; border-radius: 50%; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.feel-emoji.big { font-size: 40px; width: 72px; height: 72px; }
.feel-ask { display: grid; justify-items: center; gap: 6px; padding: 6px; }
.gif-grid { columns: 2; column-gap: 6px; max-height: 60vh; overflow: auto; }
.gif-item { display: block; width: 100%; margin-bottom: 6px; border-radius: 6px; overflow: hidden; break-inside: avoid; background: var(--bg); }
.gif-item img { width: 100%; display: block; }
.gif-credit { font-size: 12px; color: var(--muted); text-align: right; }

/* Search */
.topbar .left { gap: 8px; position: relative; }
.tb-search { position: relative; display: flex; align-items: center; background: var(--bg); border-radius: 999px; padding: 0 12px; width: 240px; }
.tb-search-ic { display: flex; color: var(--muted); }
.tb-search-ic .icon { width: 16px; height: 16px; }
.tb-search-input { border: 0; outline: none; background: transparent; padding: 10px 8px; width: 100%; }
.tb-search-btn { display: none; }
.search-panel { left: -60px; right: auto; top: 48px; width: 340px; max-height: 70vh; overflow: auto; padding: 8px; }
.sp-title { font-weight: 700; padding: 4px 8px 8px; }
.menu .sr-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; font-weight: 400; text-align: left; width: 100%; }
.sr-all .pr-name { color: var(--brand); }
.search-person { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }

/* Friend requests list */
.req-list { padding: 4px; }
.req-row { display: flex; gap: 12px; padding: 10px; border-radius: 8px; }
.req-row:hover { background: var(--hover); }
.avatar.req { width: 80px; height: 80px; font-size: 30px; }
.req-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.req-top { display: flex; justify-content: space-between; gap: 8px; }
.req-mutual { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.mini-stack { display: inline-flex; }
.mini-stack .avatar { width: 18px; height: 18px; font-size: 9px; margin-left: -5px; box-shadow: 0 0 0 2px var(--card); }
.mini-stack .avatar:first-child { margin-left: 0; }
.req-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 420px; }

/* Privacy settings */
.privacy-rows { display: grid; gap: 4px; }
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pv-row:last-child { border-bottom: 0; }

/* Live */
.live-screen { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; overflow: hidden; }
.ls-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.live-screen:not(.viewer-mode) .ls-video { transform: scaleX(-1); }
.live-screen:not(.viewer-mode) .ls-video.no-mirror { transform: none; }
.ls-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 14px 12px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.ls-top-live { display: flex; align-items: center; gap: 8px; }
.ls-timer { font-variant-numeric: tabular-nums; background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 4px; font-size: 13px; }
.ls-viewers { display: inline-flex; align-items: center; gap: 4px; background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 4px; font-size: 13px; }
.ls-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 10px; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.ls-setup { display: grid; gap: 10px; max-width: 520px; width: 100%; margin: 0 auto; background: rgba(0,0,0,.5); padding: 14px; border-radius: 14px; backdrop-filter: blur(6px); }
.ls-who { display: flex; gap: 10px; align-items: center; }
.ls-title { background: rgba(255,255,255,.12); border: 0; border-radius: 10px; padding: 10px 12px; color: #fff; min-height: 70px; resize: none; outline: none; }
.ls-title::placeholder { color: rgba(255,255,255,.7); }
.ls-start { padding: 12px; font-size: 16px; }
.ls-ctrl { display: flex; justify-content: center; align-items: center; gap: 18px; }
.ls-ctrl .call-btn > .icon { width: 48px; height: 48px; padding: 13px; }
.live-comments { max-height: 30vh; overflow-y: auto; display: grid; gap: 6px; align-content: end; max-width: 520px; mask-image: linear-gradient(transparent, #000 30%); }
.lc { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.lc .avatar { flex: none; }
.lc-form { max-width: 520px; width: 100%; }
.lc-input { width: 100%; border: 0; border-radius: 999px; padding: 10px 14px; background: rgba(255,255,255,.18); color: #fff; outline: none; }
.lc-input::placeholder { color: rgba(255,255,255,.75); }
.lv-reacts { display: flex; gap: 6px; }
.lv-reacts button { font-size: 26px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12); }
.lv-reacts button:active { transform: scale(1.25); }
.lv-title { font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.lv-status { position: absolute; top: 45%; left: 0; right: 0; text-align: center; font-size: 18px; font-weight: 600; text-shadow: 0 1px 4px #000; }
.float-zone { position: absolute; right: 12px; bottom: 120px; width: 80px; height: 50vh; pointer-events: none; }
.float-react { position: absolute; bottom: 0; font-size: 32px; animation: float-up 2.6s ease-out forwards; }
@keyframes float-up { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-20px) scale(1.1); } 100% { transform: translateY(-45vh) scale(1); opacity: 0; } }
.nb-live { background: #f02849; }
.nb-live svg { fill: #fff; }

@media (max-width: 1100px) { .tb-search { width: 200px; } }
@media (max-width: 700px) {
  .tb-search { display: none; }
  .tb-search.open { display: flex; position: fixed; left: 8px; right: 8px; top: 8px; width: auto; z-index: 30; background: var(--card); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
  .tb-search.open .search-panel { left: 0; right: 0; width: auto; top: 46px; }
  .tb-search-btn { display: flex; }
  .add-list { grid-template-columns: 1fr; }
  .composer .act-label { font-size: 13px; }
  .req-acts { max-width: none; }
  .avatar.req { width: 64px; height: 64px; }
}
@media (max-width: 420px) { .composer .actions button { flex-direction: column; gap: 2px; font-size: 12px; } }
/* dialogs must sit above the live & call screens */
.overlay { z-index: 120; }
.toast { z-index: 130; }
@media (max-width: 560px) {
  .topnav a[title="โปรไฟล์"] { display: none; }
  .post-actions > button, .react-wrap > .like-btn { font-size: 13.5px; gap: 5px; white-space: nowrap; padding: 7px 2px; }
  .post-actions .icon { width: 18px; height: 18px; }
}

/* =================== Round 10: emoji picker & Messenger-style chat =================== */
.emoji-pop {
  position: fixed; z-index: 140; background: var(--card); border-radius: 12px; padding: 10px 10px 0; display: flex; flex-direction: column;
  box-shadow: 0 12px 28px rgba(0,0,0,.22), 0 2px 4px rgba(0,0,0,.1);
}
.emo-tabs { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.emo-tab { width: 32px; height: 32px; border-radius: 8px; font-size: 18px; line-height: 1; filter: grayscale(.6); opacity: .75; }
.emo-tab:hover, .emo-tab.on { filter: none; opacity: 1; background: var(--hover); }
.emo-body { flex: 1; overflow-y: auto; padding: 4px 0 8px; }
.emo-title { position: sticky; top: 0; background: var(--card); font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 4px; z-index: 1; }
.emo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); }
.emo { font-size: 24px; line-height: 1; height: 40px; border-radius: 8px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.emo:hover { background: var(--hover); transform: scale(1.15); }
.emo-sec[data-k="mono"] .emo { font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", sans-serif; color: var(--text); }
.emoji-btn { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.emoji-btn:hover { background: var(--hover); color: var(--brand); }
.emoji-btn .icon { width: 22px; height: 22px; }
.ta-wrap { position: relative; }
.ta-wrap .emoji-btn { position: absolute; right: 0; bottom: 0; }
.ta-wrap textarea.plain { padding-right: 36px; }
.cm-input-wrap { flex: 1; display: flex; align-items: center; background: var(--bg); border-radius: 999px; padding-right: 4px; min-width: 0; }
.cm-input-wrap input { background: transparent !important; box-shadow: none !important; }
.comment-form .cm-input-wrap input { flex: 1; min-width: 0; }

/* chat window */
.chat-win { width: 338px; height: 470px; }
.chat-form { align-items: flex-end; gap: 2px; padding: 8px 6px; }
.chat-tools { display: flex; gap: 0; transition: width .15s; }
.chat-tools.compact .chat-ic:not(:first-child) { display: none; }
.chat-ic.gif-ic { font-size: 11px; font-weight: 800; color: #fff; background: var(--brand); width: 24px; height: 20px; border-radius: 4px; margin: 6px 4px; }
.chat-input-wrap { flex: 1; display: flex; align-items: flex-end; background: var(--bg); border-radius: 18px; min-width: 0; }
.chat-input-wrap .chat-input { background: transparent; flex: 1; min-width: 0; }
.chat-input-wrap .emoji-btn { width: 32px; height: 32px; color: var(--brand); }
.send-ic .thumb-ic { font-size: 22px; line-height: 1; }
.pin-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; width: 100%; }
.pin-bar:hover { background: var(--hover); }
.pin-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-count { color: var(--muted); font-size: 12px; }
.reply-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-top: 1px solid var(--line); }
.rb-title { font-size: 13px; font-weight: 600; }
.rb-text { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-bar { display: flex; align-items: center; gap: 6px; padding: 8px; }
.rec-pill { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--brand); color: #fff; border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; }
.rec-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff4d6d; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* message rows */
.msg { position: relative; max-width: 100%; align-items: flex-end; }
.msg-main { display: grid; gap: 2px; justify-items: start; max-width: 76%; position: relative; }
.msg.mine .msg-main { justify-items: end; }
.msg-content { max-width: 100%; }
.msg .bubble { max-width: 100%; }
.msg-tools { display: none; align-items: center; gap: 0; align-self: center; }
.msg:hover .msg-tools, .msg.show-tools .msg-tools { display: flex; }
.msg.mine { flex-direction: row-reverse; align-self: flex-end; }
.msg.mine .msg-tools { flex-direction: row-reverse; }
.mt-btn { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.mt-btn:hover { background: var(--hover); }
.mt-btn .icon { width: 16px; height: 16px; }
.mr-label { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); padding: 0 6px; }
.msg-reply { cursor: pointer; display: grid; gap: 2px; justify-items: inherit; margin-bottom: -10px; }
.mr-text { background: var(--bg); color: var(--muted); border-radius: 14px; padding: 6px 12px 14px; font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.bubble.unsent { background: transparent !important; color: var(--muted) !important; border: 1px solid var(--line); font-style: italic; }
.emoji-msg { font-size: 40px; line-height: 1.1; padding: 2px 4px; }
.emoji-msg.thumb { font-size: 48px; }
.msg-reacts {
  display: inline-flex; align-items: center; gap: 2px; font-size: 13px; background: var(--card); border-radius: 999px; padding: 1px 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); margin-top: -8px; z-index: 1; position: relative; color: var(--muted);
}
.msg-reacts span { font-size: 11px; margin-left: 2px; }
.msg.flash .msg-content { animation: flash 1.6s ease; }
@keyframes flash { 20%, 60% { filter: brightness(.8); transform: scale(1.03); } }
.msg.pinned .bubble { box-shadow: 0 0 0 2px #f7b928 inset; }
.audio-bubble { display: flex; align-items: center; gap: 8px; min-width: 190px; padding: 8px 12px !important; }
.au-btn { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--brand); display: flex; align-items: center; justify-content: center; flex: none; }
.msg:not(.mine) .au-btn { background: var(--brand); color: #fff; }
.au-btn .icon { width: 14px; height: 14px; }
.au-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.35); cursor: pointer; overflow: hidden; }
.msg:not(.mine) .au-bar { background: rgba(0,0,0,.12); }
.au-fill { height: 100%; width: 0; background: currentColor; }
.au-time { font-size: 12px; font-variant-numeric: tabular-nums; }
.react-bar {
  position: fixed; z-index: 140; display: flex; gap: 2px; background: var(--card); border-radius: 999px; padding: 4px 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,.22); animation: rp-in .15s ease-out;
}
.rb-item { width: 38px; height: 38px; font-size: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform .12s; }
.rb-item:hover { transform: scale(1.25); background: var(--hover); }
.rb-item.on { background: var(--brand-soft); }
.rb-more { font-size: 22px; color: var(--muted); background: var(--bg); }
.msg-menu { z-index: 140; width: 170px; padding: 6px; }
.rm-opt { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 8px; cursor: pointer; }
.rm-opt:hover { background: var(--hover); }
.rm-opt input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.emo-big { font-size: 24px; width: 36px; text-align: center; }
@media (max-width: 700px) { .chat-win { width: 100%; } .msg-main { max-width: 70%; } }
.chat-list .msg { width: 100%; max-width: 100%; align-self: stretch; justify-content: flex-start; }
.chat-list .msg.mine { flex-direction: row-reverse; }
.chat-list .msg-main { max-width: 74%; }
.audio-bubble { min-width: 0; width: 210px; max-width: 100%; }
.composer .actions button { min-width: 0; }
.composer .act-label { white-space: normal; overflow-wrap: anywhere; text-align: center; }
.feed, .feed-list, .card { min-width: 0; }
@media (max-width: 560px) { .home { grid-template-columns: minmax(0, 1fr); } body { overflow-x: hidden; } }
.comment-form { min-width: 0; }
.comment-form .cm-input-wrap input { width: 0; flex: 1 1 auto; min-width: 0; }
@media (max-width: 560px) { .topbar { padding: 0 6px; } .topbar .right { gap: 3px; } .topbar .right .round-btn { width: 34px; height: 34px; } }

/* =====================================================================
   v1.5 — comment threads, mentions, hashtags, photo grid, saved/hidden,
   group chat, online dots, typing, stories, settings switches
   ===================================================================== */
.avatar.xxs { width: 16px; height: 16px; font-size: 8px; }
.mention, .hashtag { color: var(--brand); font-weight: 600; }
.mention:hover, .hashtag:hover { text-decoration: underline; }
.comment .bubble .mention { display: inline; font-weight: 600; font-size: inherit; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu button small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.saved-tag { color: var(--muted); }
.saved-tag .icon { width: 12px; height: 12px; }

/* mention autocomplete */
.mention-pop { position: fixed; z-index: 200; background: var(--card); border-radius: 10px; padding: 6px; max-height: 240px; overflow-y: auto;
  box-shadow: 0 12px 28px rgba(0,0,0,.2), 0 2px 4px rgba(0,0,0,.1); }
.mp-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 8px; text-align: left; }
.mp-row.on, .mp-row:hover { background: var(--hover); }
.mp-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-sub { font-size: 12px; color: var(--muted); }
.mp-empty { padding: 10px; color: var(--muted); text-align: center; }

/* comment threads */
.cm-more { text-align: left; font-weight: 600; color: var(--muted); font-size: 14px; padding: 2px 0; }
.cm-more:hover { text-decoration: underline; }
.cm-thread { display: grid; gap: 6px; }
.cm-replies { margin-left: 40px; display: grid; gap: 6px; position: relative; }
.cm-replies::before { content: ''; position: absolute; left: -24px; top: -6px; bottom: 14px; width: 2px; background: var(--line); border-radius: 2px; }
.replies-toggle { display: flex; align-items: center; gap: 6px; }
.icon.rev { transform: scaleX(-1) rotate(180deg); }
.comment.reply .bubble { padding: 6px 10px; }
.cm-main { min-width: 0; flex: 1; }
.cm-bubble-row { position: relative; display: inline-flex; max-width: 100%; }
.cm-bubble-row .bubble { min-width: 0; }
.cm-react-badge { position: absolute; right: -10px; bottom: -10px; display: inline-flex; align-items: center; gap: 2px; background: var(--card);
  border-radius: 999px; padding: 1px 5px 1px 2px; font-size: 12px; color: var(--muted); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.cm-react-badge .rs-emoji { width: 16px; height: 16px; font-size: 11px; box-shadow: none; margin-left: -3px; }
.cm-react-badge .rs-emoji:first-child { margin-left: 0; }
.comment .sub { flex-wrap: wrap; align-items: center; margin-top: 2px; }
.cm-react-wrap { position: relative; display: inline-flex; }
.cm-react-wrap .react-picker { bottom: calc(100% + 4px); left: -10px; }
.cm-react-wrap .rp-item { font-size: 24px; width: 34px; height: 34px; }
.comment .sub .cm-like { font-size: 12px; font-weight: 700; color: var(--muted); }
.comment .sub .cm-like.on { font-weight: 700; }
.cm-edited { font-size: 12px; color: var(--muted); }
.cm-edit { display: grid; gap: 4px; }
.cm-edit .cm-input-wrap { display: flex; align-items: center; background: var(--bg); border-radius: 18px; padding-right: 6px; }
.cm-edit-input { flex: 1; border: 0; background: transparent; outline: none; padding: 8px 12px; min-width: 0; }
.cm-edit-hint { font-size: 12px; color: var(--muted); padding-left: 12px; }
.cm-edit-hint button { font-size: 12px; color: var(--brand); font-weight: 600; padding: 0; }
.reply-form .avatar.xs { flex: none; }
.cm-input-wrap { flex: 1; min-width: 0; }

/* hidden post / snooze boxes */
.hidden-box { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }

/* photo grid in posts */
.media-grid { display: grid; gap: 3px; background: var(--card); }
.mg-cell { position: relative; padding: 0; overflow: hidden; background: #000; cursor: zoom-in; display: block; min-height: 0; }
.mg-cell img, .mg-cell video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.mg-play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.mg-play .icon { width: 26px; height: 26px; }
.mg-more { position: absolute; inset: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 34px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.media-grid.g2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1.2; }
.media-grid.g3 { grid-template-columns: 1fr 1fr; grid-template-rows: 2fr 1fr; aspect-ratio: 1 / 1; }
.media-grid.g3 .mg-cell:first-child { grid-column: 1 / 3; }
.media-grid.g4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1 / 1; }
.media-grid.g5 { grid-template-columns: repeat(6, 1fr); grid-template-rows: 3fr 2fr; aspect-ratio: 1 / 1; }
.media-grid.g5 .mg-cell:nth-child(-n+2) { grid-column: span 3; }
.media-grid.g5 .mg-cell:nth-child(n+3) { grid-column: span 2; }

/* gallery viewer */
.gallery .viewer-top { align-items: center; }
.gal-count { color: #fff; font-weight: 600; }
.gallery-stage video { max-width: 100%; max-height: 100%; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.gal-nav.prev { left: 16px; } .gal-nav.next { right: 16px; }
.gal-nav .icon { width: 26px; height: 26px; }

/* composer: several files */
.multi-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mp-cell { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #000; }
.mp-cell img, .mp-cell video { width: 100%; height: 100%; object-fit: cover; }
.mp-cell .round-btn.x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; background: rgba(255,255,255,.9); color: #000; }
.mp-cell .mg-play { width: 36px; height: 36px; }
.mp-cell .mg-play .icon { width: 18px; height: 18px; }
.mp-add { aspect-ratio: 1; border-radius: 8px; border: 2px dashed var(--line); color: var(--muted); font-weight: 600; font-size: 13px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; text-align: center; }
.mp-add:hover { background: var(--hover); }
.mp-add-one { margin-top: 6px; }

/* hashtag page & trends */
.tag-head { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 16px; }
.tag-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tag-ic .icon { width: 28px; height: 28px; }
.tag-ic.sm { width: 36px; height: 36px; }
.tag-ic.sm .icon { width: 18px; height: 18px; }
.trend-box { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.side-link.trend { font-weight: 600; }
.side-title.row { display: flex; align-items: center; justify-content: space-between; }
.round-btn.sm { width: 32px; height: 32px; }
.round-btn.sm .icon { width: 17px; height: 17px; }
.side-link.contact { width: 100%; text-align: left; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card.empty .empty-ic { width: 40px; height: 40px; margin: 0 auto 8px; color: var(--muted); }

/* online dot */
.av-pres { position: relative; display: inline-flex; flex: none; }
.pres-dot { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #31a24c; box-shadow: 0 0 0 2px var(--card); }
.av-pres.sm .pres-dot { width: 10px; height: 10px; }
.av-pres.lg2 .pres-dot { width: 15px; height: 15px; right: 2px; bottom: 2px; }

/* group avatar (two stacked faces) */
.group-av { position: relative; display: inline-block; flex: none; }
.group-av.md { width: 40px; height: 40px; } .group-av.sm { width: 32px; height: 32px; } .group-av.lg2 { width: 56px; height: 56px; }
.group-av .avatar { position: absolute; border: 2px solid var(--card); box-sizing: content-box; }
.group-av.md .avatar { width: 26px; height: 26px; } .group-av.sm .avatar { width: 21px; height: 21px; font-size: 10px; } .group-av.lg2 .avatar { width: 36px; height: 36px; font-size: 15px; }
.group-av .avatar:first-child { right: 0; top: 0; }
.group-av .avatar:nth-child(2) { left: 0; bottom: 0; }
.group-av .avatar:only-of-type { inset: 0; margin: auto; }
.group-av .pres-dot { right: -1px; bottom: -1px; }

/* chat window additions */
.chat-who { cursor: pointer; }
.who-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.who-sub:empty { display: none; }
.chat-head-btns { display: flex; align-items: center; }
.chat-menu { right: 0; top: 36px; width: 220px; z-index: 5; }
.msg-system { align-self: center; text-align: center; font-size: 12px; color: var(--muted); padding: 6px 10px; max-width: 90%; }
.msg-sender { font-size: 12px; color: var(--muted); padding: 0 12px 1px; }
.msg-av { align-self: flex-end; }
.chat-start { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0; }
.spinner.small { width: 20px; height: 20px; border-width: 2px; margin: 8px auto; }
.seen { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.typing-row { display: flex; align-items: center; gap: 6px; padding: 2px 12px 6px; font-size: 12px; color: var(--muted); }
.typing-row .avatar { margin-right: -10px; box-shadow: 0 0 0 2px var(--card); }
.typing-row .avatar:last-of-type { margin-right: 0; }
.typing-dots { display: inline-flex; gap: 3px; background: #e9e9eb; padding: 8px 10px; border-radius: 14px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: #90949c; animation: tdot 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .15s; } .typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes tdot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.typing-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack-avatars { display: flex; justify-content: center; }
.stack-avatars .avatar { margin-left: -10px; box-shadow: 0 0 0 3px var(--card); }
.stack-avatars .avatar:first-child { margin-left: 0; }
.panel-head.row { display: flex; align-items: center; justify-content: space-between; }

/* story reply card in chat */
.story-ref { display: grid; gap: 4px; justify-items: start; }
.story-ref.mine { justify-items: end; }
.sr-open { padding: 0; border-radius: 12px; overflow: hidden; }
.sr-thumb { width: 96px; height: 150px; object-fit: cover; border-radius: 12px; display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 11px; font-weight: 700; color: #fff; padding: 6px; overflow: hidden; word-break: break-word; }
.sr-thumb.gone { background: var(--bg); color: var(--muted); font-weight: 400; height: 60px; }

/* stories: gradients */
.story-bg-sunset { background: linear-gradient(160deg, #ff7a59, #ff3d77 55%, #7b2ff7); }
.story-bg-ocean { background: linear-gradient(160deg, #00c6ff, #0072ff); }
.story-bg-forest { background: linear-gradient(160deg, #56ab2f, #1e6f3a); }
.story-bg-grape { background: linear-gradient(160deg, #a18cd1, #6a3093); }
.story-bg-night { background: linear-gradient(160deg, #232526, #414345); }
.story-bg-peach { background: linear-gradient(160deg, #ffd3a5, #fd6585); }
.story-bg-fire { background: linear-gradient(160deg, #f83600, #f9d423); }
.story-bg-mint { background: linear-gradient(160deg, #43e97b, #38f9d7); }

/* story tray */
.story-tray { position: relative; padding: 12px; }
.story-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; }
.story-scroll::-webkit-scrollbar { display: none; }
.story-card { position: relative; flex: none; width: 112px; height: 196px; border-radius: 12px; overflow: hidden; padding: 0; background: #ccc; scroll-snap-align: start; }
.story-card .sc-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.story-card:hover .sc-bg { transform: scale(1.04); }
.sc-bg-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; color: #fff; font-weight: 700; font-size: 13px; text-align: center; word-break: break-word; overflow: hidden; }
.sc-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 30%, transparent 60%, rgba(0,0,0,.55)); }
.sc-av { position: absolute; top: 10px; left: 10px; border-radius: 50%; padding: 2px; background: var(--brand); display: flex; }
.sc-av .avatar { box-shadow: 0 0 0 2px var(--card); }
.story-card.seen .sc-av { background: #b0b3b8; }
.sc-name { position: absolute; left: 8px; right: 8px; bottom: 8px; color: #fff; font-weight: 600; font-size: 13px; text-align: left; line-height: 1.2;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.story-card.create { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.sc-me { position: absolute; left: 0; right: 0; top: 0; height: 145px; overflow: hidden; background: var(--bg); }
.sc-me img { width: 100%; height: 100%; object-fit: cover; }
.sc-initial { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 48px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #8b80ff, #4fc8ff); }
.sc-plus { position: absolute; top: 127px; left: 50%; transform: translateX(-50%); width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 4px var(--card); }
.sc-create-label { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-weight: 600; font-size: 13px; }
.story-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: var(--card); box-shadow: 0 2px 8px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; z-index: 2; }
.story-arrow.left { left: 8px; } .story-arrow.right { right: 8px; }
@media (max-width: 560px) { .story-card { width: 96px; height: 168px; } .sc-me { height: 120px; } .sc-plus { top: 102px; } .story-arrow { display: none; } }

/* story creator */
.story-create { gap: 12px; }
.story-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.story-choice { height: 260px; border-radius: 12px; color: #fff; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 12px; text-align: center; }
.story-choice.photo { background: linear-gradient(160deg, #6a82fb, #5b4cf0); }
.story-choice.text { background: linear-gradient(160deg, #ff7a59, #ff3d77); }
.story-choice:hover { filter: brightness(1.08); }
.scc-ic { width: 52px; height: 52px; border-radius: 50%; background: #fff; color: #333; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.story-preview { position: relative; height: 420px; max-height: 60vh; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #000; }
.story-preview.media img, .story-preview.media video { width: 100%; height: 100%; object-fit: contain; }
.story-text-input { width: 100%; height: 100%; background: transparent; border: 0; outline: none; resize: none; color: #fff; font-size: 26px; font-weight: 700; text-align: center;
  padding: 120px 24px 24px; }
.story-text-input::placeholder { color: rgba(255,255,255,.8); }
.bg-picks { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.bg-pick { width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.bg-pick.on { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--brand); }
.story-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.story-row .seg button { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; }
.story-caption { position: absolute; left: 16px; right: 16px; bottom: 90px; text-align: center; color: #fff; font-size: 18px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.7); word-break: break-word; }
.story-preview .story-caption { bottom: 24px; }

/* story viewer */
.story-viewer { position: fixed; inset: 0; z-index: 110; background: #111; display: flex; align-items: center; justify-content: center; }
.sv-box { position: relative; width: min(420px, 100vw); height: min(92vh, 100dvh); max-height: 100dvh; background: #000; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.sv-bars { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; z-index: 3; }
.sv-bar { flex: 1; height: 3px; background: rgba(255,255,255,.35); border-radius: 2px; overflow: hidden; }
.sv-bar i { display: block; height: 100%; background: #fff; }
.sv-head { position: absolute; top: 18px; left: 10px; right: 10px; display: flex; align-items: center; justify-content: space-between; z-index: 3; color: #fff; }
.sv-user { display: flex; align-items: center; gap: 8px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.sv-time { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 3px; }
.sv-time .icon { width: 12px; height: 12px; }
.sv-tools { display: flex; gap: 2px; }
.sv-btn { width: 36px; height: 36px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; }
.sv-btn:hover { background: rgba(255,255,255,.15); }
.sv-menu { top: 40px; right: 0; width: 200px; }
.sv-stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.sv-media { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.sv-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 40px 24px; color: #fff; font-size: 28px; font-weight: 700; text-align: center; word-break: break-word; white-space: pre-wrap; }
.sv-foot { display: flex; align-items: center; gap: 8px; padding: 10px; background: linear-gradient(transparent, rgba(0,0,0,.6)); position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; }
.sv-reply { flex: 1; min-width: 0; background: transparent; border: 1px solid rgba(255,255,255,.7); color: #fff; border-radius: 999px; padding: 9px 14px; outline: none; }
.sv-reply::placeholder { color: rgba(255,255,255,.8); }
.sv-reacts { display: flex; }
.sv-react { font-size: 24px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.sv-react:hover { transform: scale(1.25); }
.sv-viewers { color: #fff; font-weight: 600; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.15); }
.sv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.9); color: #000; display: flex; align-items: center; justify-content: center; }
.sv-nav.prev { left: calc(50% - 210px - 64px); } .sv-nav.next { right: calc(50% - 210px - 64px); }
.sv-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 4; }
.sv-fly { position: absolute; left: 50%; bottom: 80px; font-size: 64px; transform: translateX(-50%); animation: svfly 1.4s ease-out forwards; pointer-events: none; z-index: 5; }
@keyframes svfly { to { transform: translate(-50%, -260px) scale(1.4); opacity: 0; } }
@media (max-width: 560px) {
  .sv-box { width: 100vw; height: 100dvh; border-radius: 0; }
  .sv-nav { display: none; }
  .sv-close { top: 52px; right: 6px; background: transparent; }
  .sv-head { right: 48px; }
}

/* profile avatar with a story ring */
.avatar-wrap.has-story > .avatar { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--brand); }
.avatar-wrap.has-story.story-seen > .avatar { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px #b0b3b8; }
.av-choice { position: absolute; top: 100%; left: 0; width: 220px; z-index: 30; }

/* settings switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: #ccd0d5; border-radius: 999px; transition: background .2s; }
.switch .slider::before { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--brand-soft); }
.pv-row .pr-main { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* dark mode tweaks for new parts */
html[data-theme="dark"] .typing-dots { background: #3a3b3c; }
html[data-theme="dark"] .switch .slider { background: #4e4f50; }
html[data-theme="dark"] .mp-cell .round-btn.x { background: rgba(58,59,60,.95); color: #fff; }

/* =====================================================================
   v1.6 — group admin, reports, admin panel, legal, story music, group calls
   ===================================================================== */
.terms-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); text-align: left; }
.terms-check input { margin-top: 3px; flex: none; }
.terms-check .link { color: var(--brand); font-weight: 600; }
.rules-box { background: var(--bg); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.rule { display: grid; gap: 2px; }
.rules-edit { display: grid; gap: 10px; }
.rule-edit { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.rule-edit textarea.input { min-height: 60px; }
.rule-edit .btn { justify-self: start; }
.group-settings h3 { margin: 10px 0 0; font-size: 16px; }
.group-settings .seg button { display: inline-flex; align-items: center; gap: 6px; }
.admin-tools { display: grid; gap: 2px; }
.admin-tools h3 { display: flex; align-items: center; gap: 6px; }
.tool-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 8px; font-weight: 600; text-align: left; width: 100%; }
.tool-row:hover { background: var(--hover); }
.tool-row .tool-label { flex: 1; }
.tool-badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
.member-faces { display: flex; flex-wrap: wrap; gap: 6px; }
.private-wall { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; }
.private-wall h3 { margin: 0; }
.pending-tag { color: #e67e22; font-weight: 600; }
.pinned-tag { color: var(--brand); font-weight: 600; }
.req-row { display: grid; gap: 8px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.req-row .pr-main { display: flex; align-items: center; gap: 10px; }
.req-answer { background: var(--bg); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; }
.req-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.pending-list { display: grid; gap: 14px; max-height: 70vh; overflow: auto; }
.pending-item { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pending-item .post { box-shadow: 0 0 0 1px var(--line); }
.report-reason { font-size: 14px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.reason-list { display: grid; gap: 2px; max-height: 45vh; overflow: auto; }
.chip-tag.danger { background: #fde7ec; color: var(--danger); }
.acc-foot a, .left-side .foot a { color: inherit; }
.acc-foot a:hover, .left-side .foot a:hover { text-decoration: underline; }

/* legal pages */
.legal h1 { margin: 0 0 4px; font-size: 26px; }
.legal h3 { margin: 18px 0 4px; font-size: 16px; }
.legal p { margin: 0; line-height: 1.65; }
.legal-page { max-width: 760px; margin: 0 auto; padding: 24px 16px; display: grid; gap: 16px; }

/* admin panel */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { padding: 14px; }
.stat-n { font-size: 26px; font-weight: 700; }
.admin-body { display: grid; gap: 14px; margin-top: 12px; }
.admin-report { padding: 14px; display: grid; gap: 10px; }
.ar-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-user { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-user:last-child { border-bottom: 0; }
.admin-user .pr-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-user .pr-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-user.banned { opacity: .75; }

/* story music */
.music-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: var(--bg); }
.music-chip img, .song-art img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
.mc-note { width: 44px; height: 44px; border-radius: 6px; background: linear-gradient(135deg, #ff3d77, #7b2ff7); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.mc-text, .song-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mc-text b, .mc-text span, .song-text b, .song-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-text span, .song-text span { font-size: 13px; color: var(--muted); }
.song-list { display: grid; gap: 2px; max-height: 50vh; overflow: auto; margin: 0 -8px; }
.song-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.song-row:hover { background: var(--hover); }
.song-art { position: relative; padding: 0; width: 44px; height: 44px; flex: none; border-radius: 6px; overflow: hidden; }
.song-play, .song-pause { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.35); color: #fff; }
.song-pause { display: none; }
.song-row.playing .song-play { display: none; }
.song-row.playing .song-pause { display: flex; }
.music-sticker { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.95); color: #111;
  border-radius: 12px; padding: 6px 12px 6px 6px; max-width: 80%; box-shadow: 0 4px 14px rgba(0,0,0,.3); z-index: 2; pointer-events: none; }
.music-sticker img, .music-sticker .mc-note { width: 38px; height: 38px; border-radius: 6px; font-size: 18px; }
.ms-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ms-text b, .ms-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ms-text span { color: #555; font-size: 12px; }
.ms-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.ms-eq i { width: 3px; background: #ff3d77; border-radius: 2px; animation: eq 0.9s infinite ease-in-out; }
.ms-eq i:nth-child(2) { animation-delay: .2s; } .ms-eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
.sc-music { position: absolute; top: 12px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; }

/* group calls */
.call-banner { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #e7f6ea; color: #1e7b34; font-size: 13px; font-weight: 600; }
.call-banner .btn { padding: 4px 12px; }
.cb-dot { width: 8px; height: 8px; border-radius: 50%; background: #31a24c; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
html[data-theme="dark"] .call-banner { background: #1d3a24; color: #8be09c; }
.gcall-screen { position: fixed; inset: 0; z-index: 100; background: #111; color: #fff; display: flex; flex-direction: column; }
.gc-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.gc-top > div { flex: 1; min-width: 0; }
.gc-status { font-size: 13px; opacity: .8; }
.gc-min { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: flex; align-items: center; justify-content: center; }
.gc-grid { flex: 1; display: grid; gap: 8px; padding: 0 12px; min-height: 0; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
.gc-grid[data-n="2"] { grid-template-columns: 1fr 1fr; }
.gc-grid[data-n="3"], .gc-grid[data-n="4"] { grid-template-columns: 1fr 1fr; }
.gc-grid[data-n="5"], .gc-grid[data-n="6"] { grid-template-columns: repeat(3, 1fr); }
.gc-grid[data-n="7"], .gc-grid[data-n="8"], .gc-grid[data-n="9"] { grid-template-columns: repeat(3, 1fr); }
.gc-tile { position: relative; background: #222; border-radius: 12px; overflow: hidden; min-height: 0; }
.gc-tile video { width: 100%; height: 100%; object-fit: cover; }
.gc-tile.self video { transform: scaleX(-1); }
.gc-face { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: #2b2c2e; }
.gc-face .avatar.xl { width: min(120px, 40%); height: auto; aspect-ratio: 1; font-size: 40px; }
.gc-tile.cam-off .gc-face { display: flex; }
.gc-tile.cam-off video { visibility: hidden; }
.gc-name { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.55); padding: 3px 10px; border-radius: 999px; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.gc-mic .icon { width: 12px; height: 12px; color: #ff6b6b; }
.gc-conn { position: absolute; top: 8px; left: 8px; font-size: 12px; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 999px; }
.gcall-screen .call-controls { position: static; padding: 14px; display: flex; justify-content: center; gap: 18px; }
.gcall-screen .call-btn.off { background: #fff !important; color: #111 !important; }
.gcall-screen.mini { inset: auto 16px 16px auto; width: 300px; height: 230px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); overflow: hidden; }
.gcall-screen.mini .gc-grid { padding: 0 6px; gap: 4px; }
.gcall-screen.mini .call-controls { padding: 6px; gap: 8px; }
.gcall-screen.mini .call-btn-label, .gcall-screen.mini .gc-name { display: none; }
@media (max-width: 560px) {
  .gc-grid[data-n="3"], .gc-grid[data-n="4"], .gc-grid[data-n="5"], .gc-grid[data-n="6"] { grid-template-columns: 1fr 1fr; }
  .gcall-screen.mini { width: 180px; height: 240px; right: 8px; bottom: 80px; }
}
.group-head .acts { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; }

/* =====================================================================
   v1.7 — chat themes, seen heads, chat info, polls, colored posts, about, birthdays
   ===================================================================== */
.chat-win { --chat-me: linear-gradient(135deg, var(--brand), #3b82f6); --chat-accent: var(--brand); position: relative; }
.chat-win .msg.mine .bubble { background: var(--chat-me); background-attachment: fixed; }
.chat-win .chat-ic, .chat-win .send-ic { color: var(--chat-accent); }
.chat-win .chat-ic.gif-ic { background: var(--chat-accent); color: #fff; }
.chat-win.themed-bg .chat-list { background: var(--chat-bg); background-size: 90px 90px, cover; }
.chat-win.themed-bg .msg:not(.mine) .bubble { background: rgba(255,255,255,.92); color: #111; }
.chat-win.themed-bg .msg-system, .chat-win.themed-bg .chat-start { background: rgba(255,255,255,.75); border-radius: 999px; color: #333; }
.seen-heads { align-self: flex-end; display: flex; gap: 2px; margin: -1px 2px 2px; }
.seen-head .avatar { box-shadow: 0 0 0 1px var(--card); }
.emoji-rain { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.emoji-rain span { position: absolute; top: -40px; animation: rain 2s ease-in forwards; }
@keyframes rain { to { transform: translateY(560px) rotate(25deg); } }

/* chat info (Messenger-style) */
.chat-info { gap: 2px; padding-top: 0; }
.ci-head { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 4px 0 12px; }
.ci-head h2 { margin: 6px 0 0; font-size: 22px; }
.ci-head .avatar.xl { width: 96px; height: 96px; font-size: 38px; }
.ci-head .av-pres .pres-dot { width: 18px; height: 18px; right: 4px; bottom: 4px; }
.ci-circles { display: flex; justify-content: center; gap: 18px; padding-bottom: 10px; flex-wrap: wrap; }
.ci-circle { display: grid; justify-items: center; gap: 6px; font-size: 13px; }
.ci-circle-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.ci-circle-ic .aa { font-size: 17px; }
.ci-theme-dot { width: 22px; height: 22px; border-radius: 50%; display: block; }
.ci-sec { color: var(--muted); font-size: 14px; margin: 14px 4px 4px; }
.ci-row { display: flex; align-items: center; gap: 14px; padding: 10px 6px; border-radius: 8px; width: 100%; text-align: left; font-weight: 600; }
button.ci-row:hover { background: var(--hover); }
.ci-ic { width: 28px; display: flex; justify-content: center; flex: none; }
.ci-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ci-text small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.danger-row .ci-text > span, .danger-row .ci-ic { color: var(--danger); }
.ci-media { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 70px; gap: 4px; border-radius: 12px; overflow: hidden; margin: 4px 0; }
.ci-media img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.ci-media img:first-child { grid-row: span 2; }
.media-all { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-height: 60vh; overflow: auto; }
.media-all img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; border-radius: 4px; }
.link-row { text-decoration: none; }
.audio-row { display: flex; align-items: center; gap: 10px; }
.audio-row .audio-bubble { background: var(--bg); }
.nick-row { width: 100%; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: 60vh; overflow: auto; padding: 2px; }
.theme-card { display: grid; gap: 4px; text-align: left; padding: 0; }
.tc-prev { position: relative; height: 110px; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 8px; background-size: 60px 60px, cover !important; box-shadow: inset 0 0 0 1px var(--line); }
.theme-card.on .tc-prev { box-shadow: 0 0 0 3px var(--brand); }
.tc-bub { height: 14px; border-radius: 8px; width: 60%; }
.tc-bub.other { background: #e4e6eb; }
.tc-bub.me { align-self: flex-end; width: 70%; }
.tc-bub.me.short { width: 40%; }
.tc-label { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cur-emoji { display: flex; align-items: center; justify-content: center; gap: 8px; }
.big-emo { font-size: 30px; line-height: 1; }
.emo-quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.emo-quick .emo { font-size: 28px; padding: 6px; border-radius: 10px; }
.emo-quick .emo.on, .emo-quick .emo:hover { background: var(--bg); }
.fx-add { display: flex; gap: 6px; }
.fx-add .input { flex: 1; }
.emo-pick { font-size: 22px; padding: 4px 12px; }
.fx-list { display: grid; gap: 6px; }
.fx-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; background: var(--bg); }

/* colored text posts */
.post-text.bg-post { margin: 4px 0; min-height: 280px; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; font-size: 28px !important;
  font-weight: 700; padding: 30px 24px; word-break: break-word; background-size: cover; text-shadow: 0 1px 3px rgba(0,0,0,.25); }
.post-text.bg-post a { color: #fff; text-decoration: underline; }
.pbg-purple { background: linear-gradient(135deg, #7b2ff7, #f107a3); }
.pbg-sunset { background: linear-gradient(160deg, #ff7a59, #ff3d77 55%, #7b2ff7); }
.pbg-ocean { background: linear-gradient(160deg, #00c6ff, #0072ff); }
.pbg-forest { background: linear-gradient(160deg, #56ab2f, #1e6f3a); }
.pbg-fire { background: linear-gradient(160deg, #f83600, #f9d423); }
.pbg-pink { background: linear-gradient(160deg, #ff9a9e, #fecfef); color: #6b2142 !important; text-shadow: none !important; }
.pbg-night { background: linear-gradient(160deg, #0f2027, #2c5364); }
.pbg-mint { background: linear-gradient(160deg, #43e97b, #38f9d7); color: #064e3b !important; text-shadow: none !important; }
.pbg-gold { background: linear-gradient(160deg, #f7971e, #ffd200); }
.pbg-hearts { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ctext x='8' y='34' font-size='24' opacity='.5'%3E%E2%9D%A4%EF%B8%8F%3C/text%3E%3Ctext x='46' y='72' font-size='20' opacity='.4'%3E%F0%9F%92%95%3C/text%3E%3C/svg%3E"), linear-gradient(160deg, #ff5f8f, #ff2d55); background-size: 80px 80px, cover; }
.pbg-stars { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ctext x='8' y='34' font-size='22' opacity='.6'%3E%E2%9C%A8%3C/text%3E%3Ctext x='46' y='72' font-size='18' opacity='.5'%3E%E2%AD%90%3C/text%3E%3C/svg%3E"), linear-gradient(160deg, #141e30, #243b55); background-size: 80px 80px, cover; }
.pbg-party { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ctext x='8' y='34' font-size='22' opacity='.6'%3E%F0%9F%8E%89%3C/text%3E%3Ctext x='46' y='72' font-size='18' opacity='.5'%3E%F0%9F%8E%88%3C/text%3E%3C/svg%3E"), linear-gradient(160deg, #8e2de2, #4a00e0); background-size: 80px 80px, cover; }
.bg-picker { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bg-swatch { width: 30px; height: 30px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); background-size: 30px 30px, cover !important; }
.bg-swatch.none { background: var(--card); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.bg-swatch.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--brand); }
.ta-wrap.bg-on textarea.plain { min-height: 220px; text-align: center; color: #fff; font-weight: 700; font-size: 26px !important; padding: 60px 20px; border-radius: 10px; }
.ta-wrap.bg-on textarea.plain::placeholder { color: rgba(255,255,255,.85); }

/* polls */
.poll { margin: 6px 16px 10px; display: grid; gap: 8px; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; text-align: left; width: 100%; }
.poll-opt .po-fill { position: absolute; inset: 0 auto 0 0; background: var(--brand-soft); z-index: 0; transition: width .3s; }
.poll-opt > *:not(.po-fill) { position: relative; z-index: 1; }
.poll-opt .po-text { flex: 1; font-weight: 600; }
.poll-opt .po-pct { color: var(--muted); font-size: 13px; }
.poll-opt.mine { border-color: var(--brand); }
.poll-opt .po-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex: none; display: flex; align-items: center; justify-content: center; }
.poll-opt.multi .po-check { border-radius: 5px; }
.poll-opt.mine .po-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.poll-opt .po-check .icon { width: 14px; height: 14px; }
.poll-foot { font-size: 13px; color: var(--muted); }
.poll-edit { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.poll-edit .row2 { display: flex; gap: 6px; }
.poll-edit .row2 .input { flex: 1; padding: 8px 10px; }

/* birthdays + watch + profile tabs/about */
.bday-box { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.bday-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.bday-row:hover { background: var(--hover); }
.bday-ic { font-size: 26px; }
.profile-tabs { display: flex; gap: 4px; overflow-x: auto; }
.profile-tabs .ptab { padding: 14px 16px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.profile-tabs .ptab.on { color: var(--brand); border-bottom-color: var(--brand); }
.profile-tabs .ptab:hover:not(.on) { background: var(--hover); border-radius: 8px 8px 0 0; }
.about-card { padding: 16px; display: grid; gap: 4px; }
.about-line { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.about-line .icon { color: var(--muted); }
.tab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.tab-grid img, .tab-grid video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: pointer; background: #000; }
.friends-tab { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.friends-tab .ft { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); }
.friends-tab .ft img, .friends-tab .ft .ph { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; }
.admin-form { display: grid; gap: 8px; }
.admin-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .admin-form .two { grid-template-columns: 1fr; } .theme-grid { grid-template-columns: repeat(2, 1fr); } }
.profile-body.single { display: block; max-width: 940px; margin: 16px auto; padding: 0 16px; }

/* v1.8 — name policy */
.name-check { font-size: 13px; text-align: left; margin-top: -4px; }
.name-check.ok { color: #1e7b34; }
.name-check.bad { color: var(--danger); }
.name-check .icon { width: 13px; height: 13px; vertical-align: -2px; }
.name-policy { background: var(--bg); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.name-policy summary { font-weight: 600; cursor: pointer; }
.policy-list { margin: 8px 0 4px; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.name-preview { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: var(--bg); }
.np-name { font-size: 20px; font-weight: 700; }

/* =====================================================================
   v1.8 — Pages, Events, Marketplace, Reels, Games, Push
   ===================================================================== */
.fld { display: grid; gap: 4px; }
.fld-label { font-weight: 600; font-size: 14px; }
.fld-hint { font-size: 12px; color: var(--muted); }
.fld-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fld-group { display: grid; gap: 8px; }
.cover-pick, .avatar-pick { border: 2px dashed var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; overflow: hidden; background: var(--bg); font-weight: 600; gap: 6px; }
.cover-pick { aspect-ratio: 16/6; }
.avatar-pick { width: 96px; height: 96px; border-radius: 50%; }
.cover-pick img, .avatar-pick img { width: 100%; height: 100%; object-fit: cover; }
.cover-pick span, .avatar-pick span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; text-align: center; }
.nb-event { background: #e41e3f; } .nb-page { background: #f5533d; }
.nb-event svg, .nb-page svg { fill: none; color: #fff; }
.chip-tag.danger, .ev-when.danger { color: var(--danger); }
.danger-btn { color: var(--danger); }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-weight: 600; }

/* Pages */
.pg-ph { background: linear-gradient(135deg, #ffe1d6, #ffd3dc) !important; }
.page-card .pc-body { position: relative; padding-top: 36px; }
.pg-card-av { position: absolute; top: -30px; left: 12px; border: 3px solid var(--card); border-radius: 50%; display: flex; }
.page-head { display: flex; align-items: flex-end; gap: 16px; padding: 0 28px 16px; margin-top: -60px; position: relative; flex-wrap: wrap; z-index: 2; }
.page-head .big-avatar { border: 4px solid var(--card); border-radius: 50%; display: flex; background: var(--card); }
.page-head .big-avatar .avatar.xl { width: 168px; height: 168px; font-size: 64px; }
.page-head .who { flex: 1; min-width: 220px; padding-bottom: 6px; }
.page-head h1 { margin: 0; font-size: 30px; line-height: 1.2; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-weight: 600; }
.page-head .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-bottom: 8px !important; }
.page-badge { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: #f5533d; color: #fff; align-items: center; justify-content: center; }
.page-badge svg { width: 14px; height: 14px; }

/* Events */
.date-badge { display: inline-grid; place-items: center; width: 52px; min-width: 52px; border-radius: 10px; overflow: hidden; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.2); text-align: center; }
.date-badge span { display: block; width: 100%; background: #e41e3f; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 0; }
.date-badge b { font-size: 22px; line-height: 1.4; color: var(--text); }
.ev-row { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-radius: 8px; color: inherit; text-decoration: none; }
.ev-row:hover { background: var(--hover); }
.ev-card .ev-cover { display: block; aspect-ratio: 16/8; background: #e4e6eb; }
.ev-card .ev-cover img { width: 100%; height: 100%; object-fit: cover; }
.ev-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #ffd6e0, #ffe9c7); min-height: 120px; }
.ev-ph.big .date-badge { transform: scale(1.6); }
html[data-theme="dark"] .ev-ph { background: linear-gradient(135deg, #4a1e2a, #3e3220); }
.ev-when { color: #e41e3f; font-weight: 700; font-size: 13px; text-transform: uppercase; }
.ev-card.canceled { opacity: .65; }
.ev-card .pc-body { display: flex; flex-direction: column; gap: 4px; }
.rsvp { display: flex; gap: 6px; flex-wrap: wrap; }
.rsvp.compact { margin-top: 6px; }
.rsvp.compact .btn { flex: 1; justify-content: center; }
.ev-head { align-items: flex-end; }
.ev-head h1 { margin: 2px 0; }
.ev-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ev-big-cover { display: flex; align-items: center; justify-content: center; }

/* Marketplace */
.mk-search { position: relative; margin: 8px 0 10px; }
.mk-search .input { padding-left: 38px; border-radius: 999px; }
.mk-search .tiny-search { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.mk-cats { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: thin; }
.mk-cats .pill { white-space: nowrap; }
.mk-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mk-filters .input { width: auto; flex: 1 1 110px; min-width: 100px; }
.mk-h { font-size: 20px; margin: 16px 0 10px; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.mk-card { display: block; color: inherit; text-decoration: none; border-radius: 10px; }
.mk-card:hover .mk-title { text-decoration: underline; }
.mk-photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e4e6eb; }
.mk-photo img { width: 100%; height: 100%; object-fit: cover; }
.mk-status { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.mk-status.inline { position: static; margin-left: 8px; font-size: 13px; vertical-align: middle; }
.mk-card.sold .mk-photo img { filter: grayscale(.7); opacity: .7; }
.mk-price { font-weight: 700; font-size: 17px; margin-top: 6px; }
.mk-price.big { font-size: 24px; margin: 0; }
.mk-title { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-loc { font-size: 13px; color: var(--muted); }
.mk-detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.mk-gallery { background: #111; border-radius: 12px; overflow: hidden; }
.mk-stage { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.mk-big { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.mk-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.85) !important; }
.mk-nav.l { left: 10px; } .mk-nav.r { right: 10px; }
.mk-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; background: #000; }
.mk-thumb { width: 60px; height: 60px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; padding: 0; flex: none; opacity: .6; background: none; cursor: pointer; }
.mk-thumb.on { border-color: #fff; opacity: 1; }
.mk-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mk-info { padding: 16px; display: grid; gap: 8px; }
.mk-info h1 { margin: 0; font-size: 24px; line-height: 1.25; overflow-wrap: anywhere; }
.mk-info h3 { margin: 10px 0 0; font-size: 17px; }
.mk-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.mk-spec { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 14px; }
.mk-spec span { color: var(--muted); }
.mk-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; margin-top: 6px; }
.mk-photo-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.mk-photo-edit .mp-cell { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; }
.mk-photo-edit .mp-cell img { width: 100%; height: 100%; object-fit: cover; }
.mk-photo-edit .mp-add { aspect-ratio: 1; min-height: 84px; }

/* Reels */
.reels { height: calc(100vh - 140px); height: calc(100dvh - 140px); overflow-y: auto; scroll-snap-type: y mandatory; display: grid; gap: 14px; justify-content: center; scrollbar-width: none; }
.reels::-webkit-scrollbar { display: none; }
.reel { position: relative; scroll-snap-align: center; height: calc(100vh - 160px); height: calc(100dvh - 160px); aspect-ratio: 9/16; max-width: 100vw; background: #000; border-radius: 12px; overflow: hidden; }
.reel video { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.reel-mute { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,.45) !important; color: #fff; }
.reel-info { position: absolute; left: 0; right: 64px; bottom: 0; padding: 40px 14px 14px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.reel-author { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.reel-text { margin-top: 6px; font-size: 14px; max-height: 4.4em; overflow: hidden; white-space: pre-wrap; }
.reel-text a { color: #fff; font-weight: 700; }
.reel-side { position: absolute; right: 8px; bottom: 18px; display: grid; gap: 14px; }
.reel-act { display: grid; justify-items: center; gap: 2px; color: #fff; background: none; border: 0; cursor: pointer; font-size: 12px; font-weight: 600; text-decoration: none; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.reel-act .ra-ic { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 22px; }
.reel-act .ra-ic svg { width: 24px; height: 24px; }
.reel-act.on .ra-ic { background: rgba(255,255,255,.35); }
.reel-prev { aspect-ratio: 9/16; max-height: 50vh; margin: 0 auto; border: 2px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; color: var(--muted); font-weight: 600; padding: 10px; text-align: center; }
.reel-prev video { width: 100%; height: 100%; object-fit: cover; }
.reel-prev span { display: inline-flex; align-items: center; gap: 6px; }

/* Games */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.game-card { padding: 18px; display: grid; gap: 8px; justify-items: start; color: inherit; text-decoration: none; transition: transform .15s; }
.game-card:hover { transform: translateY(-2px); }
.game-emoji { font-size: 44px; line-height: 1; }
.game-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.game-main { padding: 16px; display: grid; gap: 10px; justify-items: center; }
.game-top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 10px; }
.game-top h2 { margin: 0; font-size: 20px; }
.game-status { font-weight: 700; min-height: 1.4em; text-align: center; }
.game-stage { width: 100%; display: grid; justify-items: center; gap: 10px; }
.game-canvas { width: 100%; max-width: 400px; border-radius: 10px; touch-action: none; background: var(--bg); }
.dpad { display: grid; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 48px); gap: 4px; }
.dpad .round-btn { width: 48px; height: 48px; }
.dp-up { grid-column: 2; grid-row: 1; } .dp-up svg { transform: rotate(-90deg); }
.dp-left { grid-column: 1; grid-row: 2; } .dp-left svg { transform: rotate(180deg); }
.dp-right { grid-column: 3; grid-row: 2; }
.dp-down { grid-column: 2; grid-row: 3; } .dp-down svg { transform: rotate(90deg); }
@media (hover: hover) and (pointer: fine) { .dpad { display: none; } }
.g2048 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: #bbada0; padding: 8px; border-radius: 10px; width: 100%; max-width: 380px; aspect-ratio: 1; touch-action: none; }
.t2048 { border-radius: 6px; background: #cdc1b4; display: grid; place-items: center; font-weight: 800; font-size: clamp(18px, 6vw, 32px); color: #776e65; }
.t2048.v2 { background: #eee4da; } .t2048.v4 { background: #ede0c8; } .t2048.v8 { background: #f2b179; color: #fff; } .t2048.v16 { background: #f59563; color: #fff; }
.t2048.v32 { background: #f67c5f; color: #fff; } .t2048.v64 { background: #f65e3b; color: #fff; } .t2048.v128 { background: #edcf72; color: #fff; } .t2048.v256 { background: #edcc61; color: #fff; }
.t2048.v512 { background: #edc850; color: #fff; } .t2048.v1024 { background: #edc53f; color: #fff; font-size: clamp(14px, 4.5vw, 26px); } .t2048.v2048, .t2048.v4096 { background: #3c3a32; color: #fff; font-size: clamp(14px, 4.5vw, 26px); }
.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 380px; }
.mem-card { aspect-ratio: 1; border-radius: 10px; border: 0; background: linear-gradient(135deg, var(--brand), var(--brand-2)); cursor: pointer; font-size: 34px; display: grid; place-items: center; transition: transform .2s; }
.mem-card span { visibility: hidden; }
.mem-card.open, .mem-card.done { background: var(--card); box-shadow: inset 0 0 0 2px var(--line); transform: rotateY(180deg); }
.mem-card.open span, .mem-card.done span { visibility: visible; transform: rotateY(180deg); }
.mem-card.done { opacity: .55; }
.lb-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 8px; color: inherit; text-decoration: none; }
.lb-row:hover { background: var(--hover); }
.lb-row.me { background: var(--brand-soft); }
.lb-rank { width: 26px; text-align: center; font-weight: 700; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Push card */
.push-card { display: grid; gap: 8px; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); justify-items: start; }
.push-card .pv-row { width: 100%; }

@media (max-width: 900px) {
  .mk-detail, .game-wrap { grid-template-columns: 1fr; }
  .page-head { margin-top: -48px; padding: 0 14px 12px; justify-content: center; text-align: center; }
  .page-head .big-avatar .avatar.xl { width: 120px; height: 120px; font-size: 48px; }
  .page-head h1 { justify-content: center; font-size: 24px; }
  .page-head .acts { justify-content: center; width: 100%; }
}
@media (max-width: 560px) {
  .mk-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .fld-2 { grid-template-columns: 1fr; }
  .reels { height: calc(100dvh - 120px); margin: 0 -12px; gap: 0; }
  .reel { height: calc(100dvh - 120px); border-radius: 0; width: 100vw; aspect-ratio: auto; }
  .ev-head { flex-direction: column; align-items: flex-start; }
}
.mk-controls { display: grid; gap: 8px; margin-top: 8px; }
.mk-controls .mk-search { margin: 0; }
.mk-controls .mk-cats { padding: 2px 0; }

/* =====================================================================
   v1.9 — security, feed, profile, chat extras, insights, maps
   ===================================================================== */
.row2 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row2 .input { flex: 1; min-width: 120px; }
.auth-icon { font-size: 44px; text-align: center; }
.otp-input { text-align: center; font-size: 22px; letter-spacing: 6px; font-weight: 700; }
.notice-box { background: #fff7e0; border: 1px solid #f5d77a; color: #6b5200; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
html[data-theme="dark"] .notice-box { background: #3a3220; border-color: #6b5a2a; color: #f1dc9c; }
.set-box { display: grid; gap: 10px; }
.qr-box { display: flex; justify-content: center; }
.qr-box svg { width: 210px; height: 210px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.secret-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.secret-row code { background: var(--bg); padding: 8px 10px; border-radius: 8px; font-size: 14px; letter-spacing: 1px; word-break: break-all; }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.backup-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.backup-codes code { background: var(--bg); padding: 10px; border-radius: 8px; text-align: center; font-size: 16px; font-weight: 700; letter-spacing: 1px; }
.dev-row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.dev-ic { font-size: 24px; }
.cur-dev { color: #0f9d58; font-weight: 700; }
.admin-report.closed { opacity: .65; }
.ar-preview { display: flex; gap: 10px; background: var(--bg); border-radius: 8px; padding: 10px; }
.ar-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }
.ar-text { white-space: pre-wrap; }
.feed-tabs { display: flex; gap: 6px; padding: 6px; overflow-x: auto; }
.feed-tabs .pill { white-space: nowrap; flex: 1; justify-content: center; }
.pymk { padding: 12px; overflow: hidden; }
.pymk h3 { margin: 0; }
.pymk-row { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 4px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.pymk-card { position: relative; flex: 0 0 180px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; scroll-snap-align: start; background: var(--card); display: flex; flex-direction: column; }
.pymk-photo { display: block; aspect-ratio: 1; background: #e4e6eb; }
.pymk-photo img { width: 100%; height: 100%; object-fit: cover; }
.pymk-photo .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 56px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.pymk-body { padding: 8px; display: grid; gap: 6px; }
.pymk-name { font-weight: 700; color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pymk-mutual { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; min-height: 20px; }
.mf-faces { display: inline-flex; margin-right: 6px; }
.mf-faces .avatar { margin-right: -6px; border: 2px solid var(--card); }
.pymk-x { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.55) !important; color: #fff; z-index: 1; }
.pymk-body .btn { justify-content: center; }
.compose-more { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--card); color: inherit; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip-btn:hover { background: var(--hover); }
.sched-chip { background: var(--brand-soft); border-radius: 8px; padding: 8px 10px; font-size: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.compose-link .link-edit { position: relative; }
.compose-link .link-edit .round-btn.x { position: absolute; top: 6px; right: 6px; }
.link-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; color: inherit; text-decoration: none; background: var(--bg); }
.link-card:hover .lc-title { text-decoration: underline; }
.lc-img { aspect-ratio: 1.91/1; background: #e4e6eb; overflow: hidden; }
.lc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-body { padding: 10px 12px; display: grid; gap: 2px; }
.lc-site { font-size: 12px; color: var(--muted); letter-spacing: .3px; }
.lc-title { font-weight: 700; font-size: 16px; line-height: 1.3; }
.lc-desc { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.edited-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.edited-btn:hover { text-decoration: underline; }
.edit-hist { gap: 10px; }
.eh-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; white-space: pre-wrap; }
.eh-item.cur { border-color: var(--brand); }
.sens-wrap { position: relative; overflow: hidden; }
.sens-wrap:not(.shown) > :first-child { filter: blur(28px); pointer-events: none; }
.sens-cover { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; background: rgba(0,0,0,.35); color: #fff; border: 0; cursor: pointer; text-align: center; padding: 20px; font: inherit; }
.sens-wrap.shown .sens-cover { display: none; }
.sens-ic { font-size: 34px; }
.pframe { border-radius: 50%; }
.pframe > .avatar, .pframe > .profile-vid { box-shadow: 0 0 0 4px var(--card), 0 0 0 9px var(--fr, #ccc) !important; }
.pframe-gold > .avatar, .pframe-gold > .profile-vid { box-shadow: 0 0 0 4px var(--card), 0 0 0 9px #e8b923, 0 0 18px 6px rgba(232,185,35,.5) !important; }
.pframe-neon > .avatar, .pframe-neon > .profile-vid { box-shadow: 0 0 0 4px var(--card), 0 0 0 8px #00e5ff, 0 0 22px 8px #ff00e5 !important; }
.pframe-love { --fr: #ff4d79; } .pframe-thai { --fr: #c9932b; } .pframe-birthday { --fr: #ffb300; } .pframe-flowers { --fr: #ff8fb1; } .pframe-gold { --fr: #e8b923; }
.pframe-rainbow::before, .pframe-galaxy::before { content: ''; position: absolute; inset: -9px; border-radius: 50%; z-index: 0; }
.pframe-rainbow::before { background: conic-gradient(#ff3d3d, #ffb400, #ffe600, #2ecc71, #1fb6ff, #7b2ff7, #ff3d77, #ff3d3d); }
.pframe-galaxy::before { background: conic-gradient(#1b1464, #6a00ff, #ff00c8, #00d4ff, #1b1464); }
.pframe-rainbow > .avatar, .pframe-galaxy > .avatar, .pframe-rainbow > .profile-vid, .pframe-galaxy > .profile-vid { position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--card) !important; }
.pframe::after { position: absolute; bottom: -6px; right: -6px; font-size: 30px; z-index: 2; pointer-events: none; }
.pframe.mini::after { font-size: 16px; bottom: -4px; right: -6px; }
.pframe.mini::before { inset: -5px; }
.pframe.mini > .avatar { box-shadow: 0 0 0 2px var(--card), 0 0 0 5px var(--fr, #ccc) !important; }
.pframe-rainbow.mini > .avatar, .pframe-galaxy.mini > .avatar { box-shadow: 0 0 0 2px var(--card) !important; }
.pframe-love::after { content: '💕'; } .pframe-flowers::after { content: '🌸'; } .pframe-thai::after { content: '🪷'; } .pframe-birthday::after { content: '🎂'; } .pframe-gold::after { content: '👑'; } .pframe-galaxy::after { content: '✨'; }
.profile-head .avatar-wrap { border-radius: 50%; }
.profile-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; cursor: pointer; z-index: 1; }
.lock-badge { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); align-items: center; justify-content: center; vertical-align: middle; }
.hl-row { display: flex; gap: 14px; overflow-x: auto; padding: 4px 32px 14px; }
.hl-item { display: grid; justify-items: center; gap: 4px; background: none; border: 0; cursor: pointer; color: inherit; flex: none; width: 76px; }
.hl-circle { width: 68px; height: 68px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--line); font-size: 24px; font-weight: 700; color: #fff; }
.hl-item.new .hl-circle { background: var(--bg); }
.hl-item.new .hl-circle { color: var(--text); }
.hl-circle img { width: 100%; height: 100%; object-fit: cover; }
.hl-title { font-size: 12px; font-weight: 600; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.locked-card { padding: 16px; display: flex; gap: 12px; align-items: center; }
.lock-big { width: 52px; height: 52px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.link-line { background: none; border: 0; cursor: pointer; color: inherit; font: inherit; text-align: left; width: 100%; }
.featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 8px; overflow: hidden; }
.featured-grid img { width: 100%; aspect-ratio: 3/4; object-fit: cover; cursor: pointer; }
.frame-prev { position: relative; margin: 10px auto 18px; display: flex; justify-content: center; width: fit-content; }
.frame-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.frame-opt { display: grid; justify-items: center; gap: 8px; padding: 12px 4px 8px; border: 2px solid transparent; border-radius: 10px; background: var(--bg); cursor: pointer; font-size: 13px; color: inherit; }
.frame-opt.on { border-color: var(--brand); }
.frame-opt .avatar-wrap { position: relative; display: inline-flex; }
.feat-pick, .arch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.fp-item, .arch-item { position: relative; aspect-ratio: 3/4; border: 0; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: #000; }
.fp-item img, .arch-item img, .arch-item video { width: 100%; height: 100%; object-fit: cover; }
.fp-check { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: none; place-items: center; }
.fp-check svg { width: 14px; height: 14px; }
.fp-item.on, .arch-item.on { box-shadow: inset 0 0 0 3px var(--brand); }
.fp-item.on .fp-check, .arch-item.on .fp-check { display: grid; }
.arch-text { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; font-weight: 700; padding: 8px; font-size: 13px; text-align: center; }
.arch-date { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 6px; }
.act-row { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 8px; }
.act-row:hover { background: var(--hover); }
.act-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 20px; flex: none; }
.act-main { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.tilemap { position: relative; overflow: hidden; border-radius: 8px; background: #e5e3df; touch-action: none; cursor: grab; user-select: none; }
.tm-layer { position: absolute; inset: 0; }
.tm-tile { position: absolute; width: 256px; height: 256px; pointer-events: none; }
.tm-pin { position: absolute; transform: translate(-50%, -100%); font-size: 28px; line-height: 1; text-decoration: none; z-index: 2; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.tm-pin.with-label { transform: translate(-50%, -50%); background: var(--card); color: var(--text); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; box-shadow: 0 1px 4px rgba(0,0,0,.35); white-space: nowrap; filter: none; }
.tm-pin.with-label:hover { background: var(--brand); color: #fff; z-index: 3; }
.tm-circle { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(91,76,240,.25); border: 2px solid var(--brand); }
.tm-zoom { position: absolute; right: 8px; top: 8px; display: grid; gap: 2px; z-index: 3; }
.tm-zoom button { width: 30px; height: 30px; border: 0; border-radius: 6px; background: var(--card); color: var(--text); font-size: 18px; font-weight: 700; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.tm-attr { position: absolute; right: 4px; bottom: 2px; font-size: 10px; background: rgba(255,255,255,.8); color: #333; padding: 0 4px; border-radius: 3px; z-index: 3; }
.chat-tools { position: relative; }
.menu.chat-extras { position: absolute; top: auto; bottom: 42px; left: 0; right: auto; width: 230px; z-index: 30; }
.ce-ic { font-size: 18px; width: 24px; text-align: center; }
.sticker { display: inline-grid; justify-items: center; gap: 2px; animation: skPop .5s ease; }
.sk-e { font-size: 64px; line-height: 1.05; animation: skBob 2.4s ease-in-out infinite; }
.sk-t { font-size: 13px; font-weight: 800; background: #fff; color: #333; padding: 2px 10px; border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.25); border: 2px solid var(--sk, #ff7ab6); }
.sk-cat .sk-t { --sk: #ffb347; } .sk-thai .sk-t { --sk: #5b4cf0; } .sk-food .sk-t { --sk: #2ecc71; }
@keyframes skBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-4deg); } }
@keyframes skPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sticker-msg { padding: 2px; }
.sticker-tabs { display: flex; gap: 6px; }
.sticker-tabs .pill { font-size: 20px; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; max-height: 50vh; overflow-y: auto; }
.sticker-btn { background: none; border: 0; border-radius: 10px; padding: 8px 4px; cursor: pointer; }
.sticker-btn:hover { background: var(--hover); }
.sticker-btn .sk-e { font-size: 48px; animation: none; }
.loc-card { width: 240px; max-width: 100%; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.loc-body { padding: 8px 10px; display: grid; gap: 2px; font-size: 14px; }
.loc-acts { display: flex; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.chat-poll { width: 240px; max-width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; gap: 6px; background: var(--card); text-align: left; }
.cp-opt { position: relative; display: flex; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: none; cursor: pointer; overflow: hidden; color: inherit; font: inherit; text-align: left; }
.cp-opt.on { border-color: var(--brand); }
.cp-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand-soft); z-index: 0; transition: width .3s; }
.cp-txt, .cp-n { position: relative; z-index: 1; }
.cp-n { font-weight: 700; color: var(--muted); }
.req-banner { padding: 10px; border-top: 1px solid var(--line); display: grid; gap: 8px; background: var(--bg); font-size: 14px; }
.req-banner .row2 .btn { flex: 1; justify-content: center; }
.req-row .req-ic { width: 48px; height: 48px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; font-size: 22px; flex: none; }
.gcall-screen .call-btn.on { background: #0f9d58 !important; }
.page-chat { gap: 8px; }
.page-chat-list { min-height: 260px; max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 4px; }
.inbox { display: grid; grid-template-columns: 300px 1fr; gap: 12px; min-height: 60vh; }
.inbox-list { padding: 6px; overflow-y: auto; max-height: 70vh; }
.inbox-pane { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.inbox-pane .page-chat-list { flex: 1; max-height: 60vh; }
.inbox-head { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.inbox-head a { color: inherit; }
.stars { color: #c8ccd1; letter-spacing: 1px; font-size: 18px; }
.stars.sm { font-size: 13px; }
.stars .on { color: #f7b500; }
.stars-inline { color: #f7b500; font-weight: 700; }
.star-pick { display: flex; gap: 4px; justify-content: center; }
.star-pick button { font-size: 38px; background: none; border: 0; cursor: pointer; color: #c8ccd1; padding: 0 2px; }
.star-pick button.on { color: #f7b500; }
.rev-sum { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rev-avg { font-size: 28px; }
.rev-row { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.insights h4 { margin: 10px 0 0; }
.mini-chart { color: var(--text); background: var(--bg); border-radius: 8px; padding: 6px; }
.ins-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ins-table th, .ins-table td { padding: 6px; border-bottom: 1px solid var(--line); text-align: right; }
.ins-table th:first-child, .ins-table td:first-child { text-align: left; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; }
  .hl-row { padding: 4px 14px 12px; }
}
@media (max-width: 560px) {
  .pymk-card { flex-basis: 150px; }
  .backup-codes { grid-template-columns: 1fr; }
}
.sp-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px; font-size: 17px; }
.sr-item { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.sr-item:hover { background: var(--hover); }
.sr-item .sr-row { flex: 1; min-width: 0; }
.sr-item .sr-row:hover { background: none; }
.sr-x { flex: none; opacity: .7; }
.sr-x:hover { opacity: 1; }

/* =====================================================================
   Mobile app shell (≤700px) — Facebook-app layout + Nexus Chat
   ===================================================================== */
.m-only, .m-tabs, .m-back { display: none !important; }
@media (max-width: 700px) {
  .m-only { display: inline-flex !important; }
  .d-only, .topnav, .topbar .logo img { display: none !important; }
  .topbar { grid-template-columns: 1fr auto; height: 52px; padding: 0 10px; }
  .topbar .logo-text { display: inline !important; font-size: 30px; font-weight: 800; letter-spacing: -1px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .topbar .right { gap: 8px; }
  .topbar .right .round-btn { width: 38px; height: 38px; background: var(--bg); }
  .m-tabs { display: flex !important; position: fixed; left: 0; right: 0; bottom: 0; height: calc(54px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--card); border-top: 1px solid var(--line); z-index: 35; justify-content: space-around; align-items: stretch; }
  .mt-tab { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); }
  .mt-tab .icon { width: 26px; height: 26px; }
  .mt-tab.on { color: var(--brand); }
  .mt-tab.on::before { content: ''; position: absolute; top: 0; left: 18%; right: 18%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
  .mt-tab .badge { top: 6px; right: calc(50% - 22px); }
  .mt-av .avatar { box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--line); }
  .mt-tab.on .mt-av .avatar { box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--brand); }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .left-side { display: none !important; }
  .page { grid-template-columns: minmax(0, 1fr) !important; }
  /* composer: one row like the Facebook app */
  .composer .actions { display: none; }
  .composer { padding: 10px 12px; }
  .m-photo { width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 8px; background: none; border: 0; }
  .m-photo .act-ic { width: 28px; height: 28px; }
  /* chats open full screen */
  .chat-dock { left: 0; right: 0; top: 0; bottom: 0; align-items: stretch; pointer-events: none; z-index: 60; }
  .chat-win { position: fixed; inset: 0; width: 100% !important; height: 100% !important; height: 100dvh !important; border-radius: 0; z-index: 61; }
  .chat-win.min { display: none; }
  .chat-head .m-back { display: flex !important; }
  .chat-head .chat-ic[aria-label="ย่อ"] { display: none; }
  .chat-head { padding-top: env(safe-area-inset-top); }
  .chat-form { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .notif-page { border-radius: 0; box-shadow: none; }
}
/* notifications & menu pages */
.notif-page { padding: 8px; }
.menu-page { display: grid; gap: 10px; }
.menu-me, .menu-chat { display: flex; align-items: center; gap: 12px; padding: 12px; color: inherit; text-decoration: none; }
.mc-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.mc-ic .icon { width: 22px; height: 22px; }
.menu-page-apps .panel-head { display: none; }
.menu-page-apps .apps-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
.menu-page-apps .app-tile { background: var(--card); border-radius: 10px; box-shadow: var(--shadow); padding: 12px; }
.menu-page-apps .app-desc { display: none; }
.menu-page-apps .app-action { background: var(--card); border-radius: 10px; margin-top: 6px; }
.menu-page-apps .panel-sep { display: none; }
.menu-page-acc { padding: 6px; }
/* Nexus Chat app */
.msn-app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--card); width: 100%; max-width: 680px; margin: 0 auto; overflow-x: hidden; }
.msn-head { position: sticky; top: 0; z-index: 5; background: var(--card); display: flex; align-items: center; gap: 6px; padding: calc(10px + env(safe-area-inset-top)) 14px 8px; }
.msn-brand { flex: 1; font-size: 32px; font-weight: 800; letter-spacing: -1px; background: linear-gradient(135deg, #7b2ff7, var(--brand) 45%, var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.msn-title { flex: 1; margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.msn-title.sm { font-size: 22px; }
.msn-ghost { background: none; color: var(--text); }
.msn-ghost .icon { width: 28px; height: 28px; }
.msn-nexus { position: relative; background: none; }
.msn-n { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 900; font-size: 20px; line-height: 1; box-shadow: 0 2px 6px rgba(91, 75, 255, .35); }
.msn-nexus .badge { position: absolute; top: -2px; right: -4px; }
.msn-body { flex: 1; min-width: 0; width: 100%; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.msn-search-wrap { position: relative; margin: 2px 14px 10px; }
.msn-search { width: 100%; border: 0; background: var(--bg); border-radius: 999px; padding: 13px 16px 13px 46px; font-size: 16px; color: var(--text); font-family: inherit; }
.msn-search-wrap .tiny-search { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.msn-active { display: flex; gap: 16px; overflow-x: auto; padding: 8px 14px 12px; scrollbar-width: none; }
.msn-active::-webkit-scrollbar { display: none; }
.msn-act { display: grid; justify-items: center; gap: 6px; width: 76px; flex: none; background: none; border: 0; color: inherit; font-size: 13px; cursor: pointer; padding: 0; font-family: inherit; }
.msn-act span.ellipsis { max-width: 78px; font-size: 13px; }
.msn-act-av { position: relative; display: block; width: 62px; height: 62px; border-radius: 50%; }
.msn-act-av > .av-pres { position: absolute; left: 0; top: 0; }
.msn-act .avatar.lg2 { width: 62px; height: 62px; }
.msn-act-av.ring { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 5px var(--brand); }
.msn-act-av.ring.seen { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px #b0b3b8; }
.msn-plus { position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.3); display: grid; place-items: center; color: var(--text); z-index: 1; }
.msn-plus svg { width: 15px; height: 15px; }
.msn-req { display: flex; align-items: center; gap: 8px; margin: 0 14px 6px; padding: 10px 12px; border-radius: 12px; border: 0; background: var(--brand-soft); color: var(--brand); font-weight: 700; text-align: left; width: calc(100% - 28px); cursor: pointer; font-family: inherit; }
.msn-req .icon { width: 20px; height: 20px; }
.msn-list { display: grid; }
.msn-conv { display: flex; align-items: center; gap: 12px; padding: 9px 14px; background: none; border: 0; width: 100%; text-align: left; color: inherit; cursor: pointer; font: inherit; }
.msn-conv:hover { background: var(--hover); }
.msn-conv .avatar.lg2 { width: 60px; height: 60px; }
.msn-conv-body { flex: 1; min-width: 0; }
.msn-name { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msn-last { color: var(--muted); font-size: 15px; display: flex; min-width: 0; }
.msn-conv.unread .msn-name, .msn-conv.unread .msn-last { font-weight: 700; color: var(--text); }
.msn-meta { display: grid; justify-items: end; gap: 6px; color: var(--muted); font-size: 13px; flex: none; }
.msn-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); flex: none; }
.msn-sec { padding: 14px 16px 6px; font-weight: 600; color: var(--muted); font-size: 15px; }
.msn-call { display: flex; gap: 6px; }
.msn-call .round-btn { width: 36px; height: 36px; background: var(--bg); color: var(--brand); }
/* People tab: big story cards + pills */
.msn-cards { display: flex; gap: 10px; overflow-x: auto; padding: 4px 14px 14px; scrollbar-width: none; }
.msn-cards::-webkit-scrollbar { display: none; }
.msn-cards .story-card { width: 128px; height: 210px; border-radius: 16px; border: 0; cursor: pointer; }
.msn-add { background: var(--brand-soft); }
.msn-add-initial { position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; font-weight: 800; color: var(--brand); }
.msn-add-plus { position: absolute; top: 12px; left: 12px; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #050505; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.msn-add-plus svg { width: 22px; height: 22px; }
.msn-pills { display: flex; gap: 6px; overflow-x: auto; padding: 2px 10px 8px; scrollbar-width: none; }
.msn-pills::-webkit-scrollbar { display: none; }
.msn-pill { flex: none; border: 0; background: none; padding: 9px 14px; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.msn-pill.on { background: var(--bg); color: var(--text); }
.msn-pill-n { background: #e41e3f; color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; line-height: 18px; }
.msn-req-acts { display: flex; gap: 6px; flex: none; }
.msn-req-acts .btn { padding: 7px 12px; font-size: 14px; }
/* Notifications tab */
.msn-notifs .notif { padding-left: 16px; padding-right: 16px; }
/* Menu tab */
.msn-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 13px 18px; background: none; border: 0; color: inherit; font: inherit; font-size: 17px; text-align: left; cursor: pointer; }
.msn-item:hover { background: var(--hover); }
.msn-item-ic { width: 32px; display: grid; place-items: center; flex: none; }
.msn-item-ic .icon { width: 26px; height: 26px; }
.msn-item-label { flex: 1; min-width: 0; display: grid; }
.msn-item-sub { color: var(--muted); font-size: 14px; }
.msn-me-row { padding: 12px 16px; }
.msn-me-row .avatar.lg2 { width: 52px; height: 52px; }
.msn-hr { height: 1px; background: var(--line); margin: 6px 0; }
/* bottom bar: icons only, the current tab sits in a soft pill (like Messenger) */
.msn-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 680px; margin: 0 auto; display: flex; background: var(--card); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.msn-tab { flex: 1; display: grid; place-items: center; padding: 0; background: none; border: 0; color: var(--muted); cursor: pointer; font-family: inherit; }
.msn-tab-ic { position: relative; display: grid; place-items: center; width: 100%; max-width: 116px; height: 52px; border-radius: 999px; }
.msn-tab.on { color: var(--brand); }
.msn-tab.on .msn-tab-ic { background: var(--brand-soft); }
.msn-tab-ic .icon { width: 28px; height: 28px; }
.msn-tab-ic .badge { top: 4px; right: calc(50% - 26px); }
.badge.dotb { font-size: 0; min-width: 0; width: 11px; height: 11px; padding: 0; }
.call-status { max-width: 92vw; margin: 0 auto; overflow-wrap: anywhere; }
.call-btn.on > .icon { background: #fff; color: #15132b; }
.call-btn[hidden] { display: none !important; }

/* ---- v1.9.25 music picker (Facebook-style) + story music trimmer ---- */
.mp-body { gap: 10px; }
.mp-tabs { display: flex; gap: 8px; }
.mp-tab { padding: 7px 16px; border-radius: 999px; background: var(--bg); font-weight: 600; color: var(--muted); }
.mp-tab.on { background: var(--brand-soft, #e9e5ff); color: var(--brand); }
.mp-body .song-list { max-height: 48vh; }
.song-row { cursor: pointer; }
.song-row.sel { background: var(--hover); }
.song-art { position: relative; display: block; }
.song-eq { position: absolute; inset: 0; display: none; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 10px; background: rgba(0,0,0,.4); }
.song-eq i { width: 4px; background: #fff; border-radius: 2px; animation: mp-eq .9s ease-in-out infinite; }
.song-eq i:nth-child(2) { animation-delay: .2s; } .song-eq i:nth-child(3) { animation-delay: .4s; }
@keyframes mp-eq { 0%, 100% { height: 6px; } 50% { height: 20px; } }
.song-row.playing .song-eq { display: flex; }
.mp-act { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; color: var(--text); }
.song-row.sel .mp-act { background: var(--brand); color: #fff; }
.mp-act .icon { width: 20px; height: 20px; }
.mp-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #2b2b33; color: #fff; }
.mp-pp { flex: none; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; display: grid; place-items: center; }
.mp-pp .icon { width: 18px; height: 18px; }
.mp-now { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mp-now b, .mp-now span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-now span { font-size: 13px; opacity: .75; }
.mp-cut { flex: none; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 22px; background: transparent; }
.mp-add { flex: none; width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; }
.mp-add .icon { width: 22px; height: 22px; }
.music-card { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--bg); }
.music-card .music-chip { padding: 0; background: transparent; }
.mc-change { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; background: none; padding: 0; color: inherit; }
.mc-text small { font-size: 12px; color: var(--brand); }
.tr-track { position: relative; height: 48px; border-radius: 10px; background: rgba(0,0,0,.06); touch-action: none; cursor: grab; overflow: hidden; }
.tr-track.drag { cursor: grabbing; }
.tr-waves { position: absolute; inset: 6px 8px; display: flex; align-items: center; gap: 2px; }
.tr-waves i { flex: 1; border-radius: 2px; background: #b9b6c8; }
.tr-win { position: absolute; top: 2px; bottom: 2px; border: 3px solid var(--brand); border-radius: 10px; background: rgba(91,61,245,.14); pointer-events: none; transition: left .08s; }
.tr-label { font-size: 12px; color: var(--muted); text-align: center; }
.mp-body, .song-list, .story-create, .music-card { grid-template-columns: minmax(0, 1fr); }
.mp-body > *, .song-list > *, .story-create > *, .music-card > * { min-width: 0; }
.music-chip { min-width: 0; }

/* ---- v1.9.26 call: mic-off look, own avatar when camera off, peer mic badge, effects ---- */
.call-btn.mic-off > .icon, .call-btn.off.mic-off > .icon { background: #fff; color: #e41e3f; }
.call-screen.back-cam .local-video { transform: none; }
.self-tile { position: absolute; right: 16px; top: calc(16px + env(safe-area-inset-top)); width: 120px; aspect-ratio: 3/4; border-radius: 12px; display: none;
  align-items: center; justify-content: center; background: linear-gradient(160deg, #b7c2c8, #7f9a9a); box-shadow: 0 4px 16px rgba(0,0,0,.5); }
.self-tile .avatar { width: 72px; height: 72px; font-size: 28px; }
.call-screen.is-video:not(.has-local) .self-tile { display: flex; }
.peer-mic-off { position: absolute; right: 24px; top: calc(50% - 22px); width: 44px; height: 44px; border-radius: 50%; background: rgba(120,120,130,.75); display: grid; place-items: center; color: #fff; z-index: 2; }
.peer-mic-off[hidden] { display: none; }
.peer-mic-off .icon { width: 22px; height: 22px; }
.fx-panel { position: absolute; left: 0; right: 0; bottom: calc(150px + env(safe-area-inset-bottom)); padding: 10px 12px; background: rgba(15,15,22,.82); backdrop-filter: blur(8px); z-index: 3; }
.fx-panel[hidden] { display: none; }
.fx-title { font-size: 13px; opacity: .8; margin: 0 4px 8px; }
.cfx-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cfx-chip { flex: none; display: grid; justify-items: center; gap: 4px; width: 72px; color: #fff; font-size: 12px; background: none; }
.cfx-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: rgba(255,255,255,.14); border: 2px solid transparent; }
.cfx-chip.on .cfx-ic { border-color: #fff; background: rgba(255,255,255,.28); }
@media (max-width: 700px) { .call-controls { gap: 12px; } }
@media (max-width: 700px) {
  .call-controls { gap: 6px; flex-wrap: nowrap; padding: 0 6px; }
  .call-controls .call-btn { width: 66px; }
  .call-btn-label { font-size: 11px; white-space: nowrap; }
}

/* ---- v1.9.31 sign in with Google ---- */
.google-wrap { display: grid; justify-items: center; gap: 12px; margin-top: 4px; }
.google-wrap[hidden] { display: none; }
.or-line { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.google-btn { min-height: 44px; display: flex; justify-content: center; }
.radio-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); margin-left: auto; }
.radio-dot.on { border-color: var(--brand); box-shadow: inset 0 0 0 4px var(--card, #fff); background: var(--brand); }
.share-row.on { background: var(--brand-soft); }

/* ---------- call sound picker (ringtone / ringback) ---------- */
.tone-pick { gap: 14px; max-height: 75vh; overflow-y: auto; }
.tone-sec { display: grid; gap: 4px; }
.tone-sec h4 { margin: 4px 0 0; font-size: 16px; }
.tone-sec > .pc-sub { margin-bottom: 4px; }
.tone-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.tone-row:hover { background: var(--hover); }
.tone-row.on { background: var(--brand-soft); }
.tone-row input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; margin: 0; }
.tone-text { flex: 1; min-width: 0; display: grid; }
.tone-text .pc-sub { font-size: 13px; }
.tone-play { width: 36px; height: 36px; background: var(--bg); color: var(--brand); flex: none; }
.tone-play .icon { width: 16px; height: 16px; }
