/* ASKfm web — mirrors the Jetpack Compose app (colors, shapes, layout). Light/dark, LTR/RTL. */
:root {
  --red: #EE1144; --red-dark: #C40A37; --red-light: #FF4D6D; --pink: #FFE5EB;
  --gold: #FFB300; --gold-dark: #E08E00; --coin: #FFC72C; --purple: #7B2FF7; --blue: #2D8CFF; --green: #1FC27A; --grey: #5B5B66;
  --bg: #F2F3F5; --surface: #FFFFFF; --surface-2: #F7F7F9; --text: #1B1B1F; --muted: #8A8A93; --line: #E6E6EB; --chip: #F0F0F3;
  --grad: linear-gradient(135deg, #FF4D6D, #EE1144 55%, #C40A37);
  --gold-grad: linear-gradient(135deg, #FFD54F, #FFB300 55%, #E08E00);
  --vip-grad: linear-gradient(135deg, #2B1055, #7B2FF7 55%, #EE1144);
  --radius: 18px; --nav-h: 64px; --top-h: 58px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", Tahoma, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] { --bg: #0F0F12; --surface: #1B1B20; --surface-2: #24242A; --text: #F2F2F5; --muted: #9A9AA3; --line: #2A2A31; --chip: #26262C; --pink: #3A0A17; color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] { --bg: #0F0F12; --surface: #1B1B20; --surface-2: #24242A; --text: #F2F2F5; --muted: #9A9AA3; --line: #2A2A31; --chip: #26262C; --pink: #3A0A17; color-scheme: dark; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-family: var(--font); }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; font-size: 15px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img, video { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; }
.ic { width: 24px; height: 24px; fill: currentColor; flex-shrink: 0; }
.ic.xs { width: 16px; height: 16px; vertical-align: -3px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.red { color: var(--red); } .green { color: var(--green); } .blue { color: var(--blue); } .gold-text { color: var(--gold-dark); } .purple { color: var(--purple); }
.pad { padding: 12px 16px; } .pad-x { padding-inline: 16px; }
[hidden] { display: none !important; }
/* User-written text keeps its own direction (English question on an Arabic page and vice versa) */
.q-title, .q-text, .answer .body, .msg-body, .bio, .chat-last, .question-preview h2, .poll-q, .qotd-body, textarea { unicode-bidi: plaintext; }

/* ───────── Shell ───────── */
.main { max-width: 640px; margin: 0 auto; padding: calc(var(--top-h) + 10px) 0 calc(var(--nav-h) + 24px); min-height: 100vh; }
body.bare .main { padding: 0; max-width: none; }
body.no-bottom .main { padding-bottom: 0; }
body.no-bottom .bottom-nav { display: none; }

.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top-h); z-index: 30; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.wordmark { font-weight: 900; font-size: 25px; letter-spacing: -1px; color: var(--red); direction: ltr; unicode-bidi: isolate; }
.wordmark span { font-weight: 700; }
.wordmark.big { font-size: 54px; } .wordmark.white { color: #fff; }
.topbar .wordmark { flex-shrink: 0; }
.top-search { flex: 1; max-width: 360px; margin-inline: auto; display: flex; align-items: center; gap: 8px; background: var(--chip); border-radius: 999px; padding: 0 14px; color: var(--muted); }
.top-search input { border: 0; background: transparent; padding: 10px 0; outline: none; width: 100%; color: var(--text); font: inherit; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text); }
.icon-btn:hover { background: var(--chip); }
.icon-btn.sm { width: 32px; height: 32px; color: var(--muted); }
.coin-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 199, 44, .18); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 13px; }
.coin { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gold-grad); color: #fff; font-weight: 900; font-size: 11px; border: 1px solid var(--gold-dark); flex-shrink: 0; }
.coin.big { width: 30px; height: 30px; font-size: 15px; } .coin.xl { width: 40px; height: 40px; font-size: 20px; }
.only-desktop { display: none; }

/* Sidebar = side drawer on mobile, fixed rail on desktop */
.sidebar { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: 290px; z-index: 50; background: var(--surface); overflow-y: auto;
  transform: translateX(-105%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.2); }
[dir="rtl"] .sidebar { transform: translateX(105%); }
body.drawer-open .sidebar { transform: none; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s; }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-head { background: var(--grad); color: #fff; padding: 24px 20px 18px; }
.drawer-name { font-size: 19px; font-weight: 700; margin-top: 10px; }
.drawer-user { opacity: .85; font-size: 14px; }
.side-nav { padding: 8px; display: flex; flex-direction: column; }
.side-nav form { display: contents; }
.side-link { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 14px; font-size: 15px; width: 100%; text-align: start; position: relative; }
.side-link .ic { color: var(--red); }
.side-link.gold .ic { color: var(--gold-dark); } .side-link.green .ic { color: var(--green); } .side-link.blue .ic { color: var(--blue); } .side-link.purple .ic { color: var(--purple); } .side-link.grey .ic { color: var(--grey); }
.side-link small { margin-inline-start: auto; color: var(--muted); }
.side-link:hover { background: var(--chip); }
.side-link.active { background: var(--pink); color: var(--red); font-weight: 700; }
.side-link .badge { position: static; margin-inline-start: auto; }
.main-link { display: none; }
.side-sep { height: 1px; background: var(--line); margin: 8px 6px; }

/* Bottom navigation (mobile) */
.bottom-nav { position: fixed; inset: auto 0 0 0; height: var(--nav-h); z-index: 30; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; }
.bottom-nav .nav-ic { position: relative; display: inline-flex; padding: 4px 18px; border-radius: 999px; }
.bottom-nav a.active { color: var(--red); font-weight: 700; }
.bottom-nav a.active .nav-ic { background: rgba(238, 17, 68, .1); }
.badge { position: absolute; top: -2px; inset-inline-end: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-style: normal; }
.badge.static { position: static; }
.fab { position: fixed; z-index: 31; inset-inline-end: 18px; bottom: calc(var(--nav-h) + 18px); width: 58px; height: 58px; border-radius: 50%; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 22px rgba(238, 17, 68, .45); }
.fab:hover { background: var(--red-dark); }

@media (min-width: 1000px) {
  .only-mobile { display: none !important; }
  .only-desktop { display: flex; }
  .sidebar { transform: none !important; top: var(--top-h); width: 270px; box-shadow: none; border-inline-end: 1px solid var(--line); }
  .drawer-backdrop, .bottom-nav { display: none; }
  .drawer-head { display: none; }
  .main-link { display: flex; }
  .main { margin-inline-start: max(290px, calc(50vw - 320px)); padding-bottom: 40px; }
  .fab { bottom: 30px; inset-inline-end: 30px; }
}

/* ───────── Common components ───────── */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin: 0 12px 12px; }
.card.list { padding: 0; overflow: hidden; }
.empty { text-align: center; color: var(--muted); padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty h3 { color: var(--text); }
.flash { padding: 12px 16px; border-radius: 14px; margin: 0 12px 12px; font-size: 14px; }
.flash-success { background: rgba(31,194,122,.12); color: #0d8a54; }
.flash-error { background: rgba(238,17,68,.1); color: var(--red); }
.page-head { display: flex; align-items: center; gap: 8px; padding: 4px 8px 12px; }
.page-head h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 8px; }
.section-head h3 { font-size: 16px; } .section-head a, .link { color: var(--red); font-size: 13px; font-weight: 600; }
.section-head.sm { padding: 12px 2px 6px; }
.vip { display: inline-block; background: var(--gold-grad); color: #fff; font-size: 9px; font-weight: 900; padding: 1px 7px; border-radius: 999px; vertical-align: middle; letter-spacing: .3px; }
.vip.lg { font-size: 12px; padding: 3px 10px; }
.verified { display: inline-flex; vertical-align: -3px; color: var(--blue); }
.verified .ic { width: 17px; height: 17px; }
h1 .verified .ic { width: 24px; height: 24px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill-purple { background: rgba(123, 47, 247, .12); color: var(--purple); }
.pill-red { background: rgba(238, 17, 68, .12); color: var(--red); }
.pill-grey { background: var(--chip); color: var(--muted); }
.pill-white { background: #fff; color: var(--red); border-radius: 999px; padding: 5px 14px; font-weight: 700; font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--red); color: #fff; border: 2px solid var(--red); border-radius: 999px;
  padding: 10px 22px; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 16px; font-size: 13px; } .btn-xs { padding: 4px 12px; font-size: 12px; }
.btn-outline { background: transparent; color: var(--red); }
.btn-outline:hover { background: var(--pink); color: var(--red); }
.btn-outline.gold { color: var(--gold-dark); border-color: var(--gold); } .btn-outline.gold.on { background: var(--gold); color: #fff; }
.btn-outline.blue { color: var(--blue); border-color: var(--blue); } .btn-outline.blue:hover { background: rgba(45,140,255,.1); }
.btn-soft { background: var(--chip); border-color: var(--chip); color: var(--text); }
.btn-soft:hover { background: var(--line); border-color: var(--line); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--chip); border-color: var(--chip); }
.btn-gold { background: var(--gold); border-color: var(--gold); } .btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn-white { background: #fff; border-color: #fff; color: var(--red); } .btn-white:hover { background: var(--pink); border-color: var(--pink); }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 8px; margin-top: 10px; }
.split { display: flex; } .split .btn:first-child { flex: 1; border-start-end-radius: 0; border-end-end-radius: 0; } .split .btn:last-child { border-start-start-radius: 0; border-end-start-radius: 0; border-inline-start: 0; padding-inline: 12px; }

textarea, input:not([type=checkbox]):not([type=radio]):not([type=file]), select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: none; }
textarea { min-height: 110px; resize: vertical; }
textarea:focus, input:focus, select:focus { border-color: var(--red); }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.counter { text-align: end; margin-top: 4px; }

.switch { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch:checked { background: var(--red); }
.switch:checked::after { transform: translateX(18px); }
[dir="rtl"] .switch:checked::after { transform: translateX(-18px); }
.switch:disabled { opacity: .4; }
.switch-row, .menu-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; width: 100%; text-align: start; cursor: pointer; }
.menu-row:hover { background: var(--surface-2); }
.menu-row.static { cursor: default; } .menu-row.static:hover { background: none; }
.switch-row b, .menu-row b { display: block; font-weight: 500; }
.switch-row small, .menu-row small { display: block; color: var(--muted); font-size: 12px; }
.mi { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mi .ic { width: 20px; height: 20px; }
.mi.red { background: rgba(238,17,68,.12); color: var(--red); } .mi.blue { background: rgba(45,140,255,.12); color: var(--blue); }
.mi.gold { background: rgba(255,179,0,.15); color: var(--gold-dark); } .mi.green { background: rgba(31,194,122,.12); color: var(--green); }
.mi.purple { background: rgba(123,47,247,.12); color: var(--purple); } .mi.grey { background: var(--chip); color: var(--grey); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 12px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar, .hscroll::-webkit-scrollbar, .stories::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 8px 16px; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--red); color: #fff; }
.tabs { display: flex; background: var(--surface); margin: 0 12px 12px; border-radius: 14px; overflow: hidden; }
.tabs.scroll { overflow-x: auto; }
.tabs a { flex: 1; text-align: center; padding: 12px 10px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 4px; }
.tabs a.on { color: var(--red); border-bottom-color: var(--red); }
.seg { display: flex; gap: 6px; padding: 10px; }
.seg a { flex: 1; text-align: center; padding: 9px; border-radius: 12px; background: var(--chip); font-size: 13px; font-weight: 600; }
.seg a.on { background: var(--red); color: #fff; }
.banner { display: flex; align-items: center; gap: 12px; margin: 0 12px 12px; padding: 12px 14px; border-radius: 14px; font-size: 13px; }
.banner.red-grad { background: var(--grad); color: #fff; } .banner.red-grad.big { padding: 18px; font-size: 15px; } .banner.red-grad .ic { width: 40px; height: 40px; }
.banner.gold-soft { background: rgba(255,179,0,.13); } .banner.gold-soft b { color: var(--gold-dark); }
.banner.purple-soft { background: rgba(123,47,247,.1); } .banner.purple-soft .ic { color: var(--purple); }
.banner.push-box { background: var(--surface); }
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding: 0 12px 6px; scrollbar-width: none; }

/* Avatar */
.av { position: relative; display: inline-flex; flex-shrink: 0; border-radius: 50%; }
.av-in { width: 100%; height: 100%; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; object-fit: cover; overflow: hidden; }
.av-anon { background: linear-gradient(135deg, #5A5A66, #2E2E36); } .av-anon .ic { width: 48%; height: 48%; }
.av-vip { padding: 3px; background: var(--gold-grad); }
.av-vip .av-in { border: 2px solid var(--surface); }
.av-online { position: absolute; bottom: 1px; inset-inline-end: 1px; width: 28%; height: 28%; min-width: 10px; min-height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--surface); }
.av-shout { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--red-light), var(--red)); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ───────── Feed ───────── */
.sticky-chips { position: sticky; top: var(--top-h); z-index: 5; background: var(--bg); padding-top: 8px; margin-top: -8px; }
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 4px 14px 14px; scrollbar-width: none; }
.story { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; flex-shrink: 0; }
.story-ring { width: 64px; height: 64px; border-radius: 50%; padding: 3px; background: var(--line); display: inline-flex; align-items: center; justify-content: center; }
.story-ring > .av { border: 2px solid var(--bg); }
.story-ring.online { background: linear-gradient(90deg, var(--red), var(--red-light)); }
.story-ring.shout { background: transparent; border: 2px solid var(--red); color: var(--red); }
.story-ring.shout .ic { background: rgba(238,17,68,.1); border-radius: 50%; width: 54px; height: 54px; padding: 14px; }
.story-name { font-size: 11px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.qotd { display: flex; align-items: center; gap: 10px; margin: 0 12px 12px; padding: 18px; border-radius: 20px; background: var(--grad); color: #fff; }
.qotd-text { flex: 1; }
.qotd-kicker { font-size: 11px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; opacity: .92; display: flex; align-items: center; gap: 6px; }
.qotd-body { font-size: 17px; font-weight: 700; margin: 8px 0 12px; }
.qotd-cta { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.answer .answer-q { display: flex; align-items: flex-start; gap: 6px; }
.q-title { flex: 1; font-size: 17px; font-weight: 700; }
.asker { font-size: 12px; color: var(--muted); margin: 3px 0 12px; display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.asker a { color: var(--red); }
.author { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.author .name, .name { font-weight: 700; font-size: 14px; }
.answer .body { white-space: pre-wrap; word-wrap: break-word; margin: 8px 0 4px; font-size: 15.5px; }
.tag, .mention { color: var(--red); font-weight: 600; }
.media { width: 100%; max-height: 560px; object-fit: cover; border-radius: 14px; display: block; margin: 4px 0; background: var(--chip); }
.media-wrap { position: relative; }
.media-tag { position: absolute; bottom: 12px; inset-inline-start: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 6px; }
.secret-lock { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--vip-grad); color: #fff; border-radius: 14px; padding: 22px; font-weight: 700; font-size: 14px; }
.actions { display: flex; align-items: center; gap: 4px; margin: 8px -6px -6px; }
.act { display: inline-flex; align-items: center; gap: 6px; padding: 8px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 13px; }
.act:hover { background: var(--chip); }
.act.like .ic { fill: none; stroke: currentColor; stroke-width: 2; transition: transform .15s; }
.act.like.liked { color: var(--red); } .act.like.liked .ic { fill: var(--red); stroke: var(--red); transform: scale(1.15); }
.act-count { font-size: 13px; font-weight: 700; margin-inline-end: 10px; }
.act.static:hover { background: none; }

.person-card { width: 152px; flex-shrink: 0; background: var(--surface); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.person-name { font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card .btn { margin-top: 8px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.user-row:hover { background: var(--surface-2); }
.user-row.me { background: rgba(238,17,68,.06); }
.user-row .rank { width: 28px; color: var(--muted); font-weight: 700; }

/* Poll */
.poll { padding: 16px 0; }
.poll .author { padding-inline: 16px; }
.poll-q { font-size: 17px; padding: 0 16px 12px; }
.poll-sides { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 12px; height: 240px; }
.poll.tall .poll-sides { height: 380px; }
.poll-side { position: relative; overflow: hidden; border-radius: 14px; background: var(--chip); }
.poll-side:first-child { border-start-end-radius: 4px; border-end-end-radius: 4px; }
.poll-side:nth-child(2) { border-start-start-radius: 4px; border-end-start-radius: 4px; }
.poll-side img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poll-result { position: absolute; inset: 0; background: rgba(0,0,0,.45); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 30px; }
.poll-side.mine .poll-result { background: rgba(238,17,68,.35); }
.poll-label { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.45); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.vs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 900; font-size: 13px;
  display: flex; align-items: center; justify-content: center; border: 4px solid var(--surface); pointer-events: none; }
.poll:not(.voted) .poll-side:hover img { transform: scale(1.04); transition: transform .2s; }

/* ───────── My country / World switch ───────── */
.scope-bar { display: flex; gap: 8px; padding: 0 12px 10px; flex-wrap: wrap; }
.scope-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; border: 1.5px solid var(--line); }
.scope-chip.on { border-color: var(--red); color: var(--red); background: var(--pink); }
.scope-chip .flag { font-size: 15px; line-height: 1; }
.scope-set { color: var(--red); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.scope-note { margin: 0 12px 12px; padding: 10px 12px; border-radius: 12px; background: rgba(45,140,255,.08); color: var(--text); font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start; }
.scope-note .ic { color: var(--blue); }
.leader-head .scope-bar { justify-content: center; padding-bottom: 12px; }
.leader-head .scope-chip { background: rgba(255,255,255,.18); border-color: transparent; color: #fff; }
.leader-head .scope-chip.on { background: #fff; color: var(--red); }
.leader-head .scope-set { color: #fff; }

/* ───────── Discover ───────── */
.search-pill { display: flex; align-items: center; gap: 8px; margin: 0 12px 12px; padding: 0 16px; background: var(--surface); border-radius: 999px; color: var(--muted); }
.search-pill input { border: 0 !important; background: transparent !important; padding: 12px 0 !important; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 12px 12px; }
.tile { border-radius: 18px; padding: 14px; color: #fff; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-size: 16px; margin-top: 8px; } .tile small { opacity: .88; font-size: 12px; }
.tile-ic { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.25); display: inline-flex; align-items: center; justify-content: center; }
.t-red { background: linear-gradient(135deg, #FF4D6D, #EE1144); } .t-orange { background: linear-gradient(135deg, #FF8A00, #FF5252); }
.t-blue { background: linear-gradient(135deg, #2D8CFF, #6A5CFF); } .t-green { background: linear-gradient(135deg, #1FC27A, #00A3A3); }
.tag-chip { white-space: nowrap; color: var(--red); background: rgba(238,17,68,.1); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.tag-chip small { color: var(--muted); font-weight: 500; }
.row-link { display: flex; gap: 8px; align-items: center; color: var(--red); font-weight: 600; }

/* ───────── Ask / answer ───────── */
.ask-form { display: flex; flex-direction: column; gap: 8px; }
.ask-form.inline { flex-direction: row; align-items: center; }
.ask-form .switch-row { padding: 10px 2px; }
.ask-form .author { margin: 0 0 4px; }
.grab-row { padding: 0 0 6px; }
.grab { flex-shrink: 0; max-width: 220px; text-align: start; background: var(--chip); border-radius: 14px; padding: 10px 12px; font-size: 13px; }
.friend-list { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; margin: 0 -16px; }
.friend { display: flex; align-items: center; gap: 12px; padding: 8px 16px; cursor: pointer; }
.friend:hover { background: var(--surface-2); }
.friend small { display: block; color: var(--muted); font-size: 12px; }
.friend input { width: 22px; height: 22px; accent-color: var(--red); }
.sticky-submit { position: sticky; bottom: calc(var(--nav-h) + 8px); display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); padding-top: 10px; }
.poll-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick { position: relative; aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pick-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--red); }
.pick-empty .ic { width: 38px; height: 38px; }

.question-preview { background: rgba(238,17,68,.07); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.qp-from { display: flex; align-items: center; gap: 8px; }
.question-preview h2 { font-size: 18px; margin-top: 8px; }
.answer-form textarea { border: 0; background: transparent; padding: 6px 2px; min-height: 140px; font-size: 16px; }
.attach-bar { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 0; margin: 6px 0; }
.attach-bar .icon-btn { color: var(--muted); cursor: pointer; }
.attach-bar .icon-btn:hover { color: var(--red); }
.media-preview { position: relative; margin: 6px 0; }
.media-preview img, .media-preview video { width: 100%; border-radius: 14px; max-height: 420px; object-fit: cover; }
.on-media, .on-cover { position: absolute; top: 10px; inset-inline-end: 10px; background: rgba(0,0,0,.45); color: #fff; }
.on-media:hover, .on-cover:hover { background: rgba(0,0,0,.65); }
.gif-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 50vh; overflow-y: auto; margin: 10px 0; }
.gif-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: pointer; }

/* Inbox */
.inbox-item { display: flex; gap: 12px; padding: 14px 12px 14px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.inbox-item:last-child { border-bottom: 0; }
.q-text { font-weight: 600; font-size: 15px; margin: 3px 0 8px; }
.q-meta { display: flex; align-items: center; gap: 6px; }

/* ───────── Profile ───────── */
.profile { padding: 0; overflow: hidden; text-align: center; }
.cover { height: 170px; position: relative; }
.cover.small { height: 110px; border-radius: 14px; }
.profile-body { padding: 0 18px 18px; }
.profile-avatar { margin-top: -56px; display: inline-block; border-radius: 50%; padding: 4px; background: var(--surface); }
.profile h1 { font-size: 24px; margin-top: 6px; }
.bio { margin: 8px 0 4px; white-space: pre-wrap; }
.stats { display: flex; justify-content: space-around; background: var(--surface-2); border-radius: 16px; padding: 12px 6px; margin: 14px 0 4px; }
.stats > * { display: flex; flex-direction: column; } .stats b { font-size: 19px; } .stats span { font-size: 11px; color: var(--muted); }
.profile .btn-block { margin-top: 10px; }
.vip-progress { background: var(--vip-grad); color: #fff; border-radius: 18px; padding: 16px; margin: 14px 12px 12px; text-align: start; }
.profile .vip-progress { margin: 14px 0 0; }
.vp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; } .vp-head .gold-text { color: var(--coin); }
.vp-row { display: flex; justify-content: space-between; font-size: 12px; opacity: .92; margin-top: 8px; }
.bar { height: 6px; background: rgba(255,255,255,.25); border-radius: 999px; margin-top: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--coin); border-radius: 999px; }

/* Profile backgrounds (same palette as the app) */
.bg-0 { background: linear-gradient(135deg, #EE1144, #1FC27A); } .bg-1 { background: linear-gradient(135deg, #7B2FF7, #FF8A00); }
.bg-2 { background: linear-gradient(135deg, #2D8CFF, #E91E63); } .bg-3 { background: linear-gradient(135deg, #1FC27A, #00BCD4); }
.bg-4 { background: linear-gradient(135deg, #FF8A00, #795548); } .bg-5 { background: linear-gradient(135deg, #E91E63, #3F51B5); }
.bg-6 { background: linear-gradient(135deg, #00BCD4, #009688); } .bg-7 { background: linear-gradient(135deg, #2B1055, #7B2FF7, #EE1144); }
.bg-8 { background: linear-gradient(135deg, #FFD54F, #FFB300, #E08E00); } .bg-9 { background: linear-gradient(135deg, #0F2027, #2C5364, #EE1144); }
.cover::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 15% 25%, rgba(255,255,255,.14) 0 60px, transparent 61px), radial-gradient(circle at 85% 15%, rgba(255,255,255,.1) 0 80px, transparent 81px), radial-gradient(circle at 60% 90%, rgba(255,255,255,.08) 0 90px, transparent 91px); }

/* ───────── Chats ───────── */
.chat-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.chat-row:hover { background: var(--surface-2); }
.chat-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-last { display: block; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-last.unread { color: var(--text); font-weight: 600; }
.room-ic { width: 50px; height: 50px; border-radius: 16px; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.room-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat { display: flex; flex-direction: column; height: calc(100vh - var(--top-h) - 10px); height: calc(100dvh - var(--top-h) - 10px); background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-head small { display: block; font-size: 12px; }
.identity-bar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.ai-note { background: rgba(31,194,122,.1); border-radius: 12px; padding: 10px; font-size: 12px; display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ai-note .ic { color: var(--green); }
.msg { max-width: 78%; align-self: flex-start; background: var(--surface); border-radius: 18px 18px 18px 4px; padding: 8px 14px; display: flex; flex-direction: column; }
.msg.me { align-self: flex-end; background: var(--red); color: #fff; border-radius: 18px 18px 4px 18px; }
[dir="rtl"] .msg { border-radius: 18px 18px 4px 18px; } [dir="rtl"] .msg.me { border-radius: 18px 18px 18px 4px; }
.msg-from { font-size: 11px; font-weight: 700; color: var(--red); }
.msg-body { white-space: pre-wrap; word-wrap: break-word; }
.msg-time { font-size: 10px; opacity: .7; align-self: flex-end; }
.msg-system { align-self: center; font-size: 12px; color: var(--muted); background: var(--chip); padding: 4px 12px; border-radius: 999px; }
.msg.pending { opacity: .6; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.composer textarea { min-height: 44px; max-height: 140px; border-radius: 22px; padding: 11px 16px; resize: none; background: var(--chip); border-color: transparent; }
.composer.join { justify-content: center; }
.send-btn { width: 46px; height: 46px; border-radius: 50%; background: var(--red); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[dir="rtl"] .send-btn .ic, [dir="rtl"] .page-head .ic, [dir="rtl"] .chat-head > a .ic { transform: scaleX(-1); }

/* ───────── Notifications ───────── */
.notif { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: rgba(238,17,68,.05); }
.notif-av { position: relative; }
.notif-badge { position: absolute; bottom: -2px; inset-inline-end: -2px; width: 22px; height: 22px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }
.notif-badge .ic { width: 12px; height: 12px; }
.notif-ic { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.notif-badge.red, .notif-ic.red { background: var(--red); color: #fff; } .notif-badge.blue, .notif-ic.blue { background: var(--blue); color: #fff; }
.notif-badge.green, .notif-ic.green { background: var(--green); color: #fff; } .notif-badge.gold, .notif-ic.gold { background: var(--gold); color: #fff; }
.notif-badge.purple, .notif-ic.purple { background: var(--purple); color: #fff; } .notif-badge.grey, .notif-ic.grey { background: var(--grey); color: #fff; }

/* ───────── Wallet / market / leaderboard / VIP ───────── */
.balance-card { margin: 0 12px 12px; padding: 22px; border-radius: 24px; background: var(--gold-grad); color: #fff; }
.muted-white { opacity: .9; font-weight: 700; font-size: 14px; }
.balance { display: flex; align-items: center; gap: 12px; font-size: 40px; font-weight: 900; margin: 6px 0 16px; }
.balance-card .row3 { grid-template-columns: 1fr 1fr 1fr; }
.wallet-act { background: rgba(255,255,255,.22); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; }
.earn-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.earn-row:last-child { border-bottom: 0; }
.coupon { background: var(--chip); padding: 4px 8px; border-radius: 8px; font-weight: 700; }
.packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 12px 8px; }
.pack { position: relative; background: var(--surface); border-radius: 16px; padding: 22px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px solid transparent; }
.pack.popular { border-color: var(--gold); }
button.pack { cursor: pointer; font: inherit; color: inherit; }
button.pack:hover:not(:disabled) { border-color: var(--red); }
button.pack:disabled { cursor: default; }
.pack-badge { position: absolute; top: 6px; background: var(--red); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.offer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 12px; }
.offer { background: var(--surface); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.offer-top { height: 96px; color: #fff; display: flex; align-items: center; justify-content: center; position: relative; font-size: 20px; }
.offer-cat { position: absolute; top: 8px; inset-inline-start: 8px; background: rgba(0,0,0,.3); font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.offer-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.offer-title { font-weight: 600; font-size: 14px; flex: 1; }
.offer-foot { display: flex; align-items: center; gap: 4px; }
.leader-head { background: var(--grad); margin: -10px 0 12px; padding: 18px 12px 0; color: #fff; }
.period { display: flex; justify-content: center; gap: 8px; }
.period a { padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.2); font-size: 13px; font-weight: 600; }
.period a.on { background: #fff; color: var(--red); }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin-top: 20px; }
.podium-spot { width: 104px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.podium-spot small { opacity: .85; }
.podium-block { width: 100%; background: rgba(255,255,255,.25); border-radius: 12px 12px 0 0; display: flex; justify-content: center; padding-top: 6px; font-size: 30px; font-weight: 900; margin-top: 6px; }
.place-1 .podium-block { height: 110px; } .place-2 .podium-block { height: 80px; } .place-3 .podium-block { height: 60px; }
.place-1 .av { box-shadow: 0 0 0 3px #FFC107; } .place-2 .av { box-shadow: 0 0 0 3px #CFD8DC; } .place-3 .av { box-shadow: 0 0 0 3px #D7894A; }
.crown { color: #FFC107; }
.vip-hero { background: var(--vip-grad); color: #fff; text-align: center; padding: 34px 20px 28px; margin: -10px 0 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vip-hero h1 { font-size: 30px; } .vip-hero p { margin: 0; opacity: .9; max-width: 380px; }
.vip-gem { width: 84px; height: 84px; border-radius: 50%; background: var(--gold-grad); display: inline-flex; align-items: center; justify-content: center; }
.vip-gem .ic { width: 46px; height: 46px; }
.perk { display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.perk b { display: block; font-size: 14px; } .perk small { color: var(--muted); font-size: 12px; }
.plans { margin: 0 12px; display: flex; flex-direction: column; gap: 8px; }
.plan { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.plan.on { border-color: var(--purple); }
.plan-price { font-size: 20px; }

/* ───────── Settings / admin ───────── */
.settings-profile { display: flex; flex-direction: column; gap: 10px; }
.edit-avatar { position: relative; align-self: center; margin-top: -54px; cursor: pointer; border-radius: 50%; padding: 4px; background: var(--surface); }
.edit-avatar .cam { position: absolute; bottom: 4px; inset-inline-end: 4px; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; }
.edit-avatar .cam .ic { width: 16px; height: 16px; }
.bg-picker { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.bg-swatch { width: 60px; height: 42px; border-radius: 10px; flex-shrink: 0; color: #fff; display: inline-flex; align-items: center; justify-content: center; border: 3px solid transparent; }
.bg-swatch.on { border-color: var(--text); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 0 12px 12px; }
.stat { background: var(--surface); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; }
.stat b { font-size: 24px; color: var(--red); } .stat span { font-size: 12px; color: var(--muted); }
.report blockquote { margin: 10px 0; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; border-inline-start: 4px solid var(--red); }
.thumb { max-width: 140px; border-radius: 8px; margin-top: 6px; }
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; }
.clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────── Sheets, toast ───────── */
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; background: var(--surface); color: var(--text); max-height: 85vh; }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: 24px; } }
dialog.sheet::backdrop { background: rgba(0,0,0,.45); }
.sheet-body { padding: 10px 0 24px; }
.sheet-body.center { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-inline: 20px; text-align: center; }
.sheet-body h3 { font-size: 19px; } .sheet-body h3.pad { padding: 8px 16px; }
.sheet-body .search-pill { margin: 8px 16px; background: var(--chip); }
.sheet-body .gif-grid { margin: 10px 16px; }
.sheet-handle { width: 40px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto 12px; }
.tip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; margin: 12px 0; }
.tip-option input { display: none; }
.tip-option > span { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 16px; padding: 14px 4px; cursor: pointer; font-size: 17px; }
.tip-option input:checked + span { border-color: var(--gold); background: rgba(255,199,44,.12); }
.done-ic .ic { width: 56px; height: 56px; color: var(--green); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%); background: #1B1B1F; color: #fff; padding: 12px 20px; border-radius: 14px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.error { background: var(--red); }

/* ───────── Welcome / login ───────── */
.welcome { min-height: 100vh; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; padding: 30px 20px; }
.welcome-inner { max-width: 380px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.welcome-sub { margin: 0; font-size: 16px; opacity: .92; }
.welcome-actions { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 18px; }
.welcome-actions form { width: 100%; }
.welcome-legal { font-size: 12px; opacity: .75; }
.footer { text-align: center; padding: 16px 16px 26px; }
body.bare .footer { position: absolute; bottom: 0; left: 0; right: 0; }
.langs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.langs a { padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.2); color: #fff; font-size: 13px; }
.langs a.active { background: #fff; color: var(--red); }
.error-page h1 { font-size: 42px; }
