:root {
  --bg: #fff;
  --bg-2: #fff;
  --surface: #fff;
  --surface-2: #fff;
  --line: #2a2636;
  --text: #000;
  --muted: #9a93ad;
  --accent: #7c5cff;
  --accent-2: #a98bff;
  --danger: #ff5c7a;
  --max: 600px;
  --tabbar-h: 58px;
  --topbar-h: 52px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: #7c5cff;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent-2); text-decoration: none; }

/* ---------------------------------------------------------- auth screen */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(124,92,255,.18), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 22px;
}
.brand {
  font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: 26px;
  letter-spacing: -.02em;
  display: flex; align-items: center; gap: 8px;
}
.brand-mark { color: var(--accent); transform: translateY(1px); }
.auth-tag { color: var(--muted); margin: 6px 0 22px; }
.seg {
  display: flex; gap: 4px; background: var(--bg-2);
  border-radius: 12px; padding: 4px; margin-bottom: 16px;
}
.seg-btn {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  padding: 9px; border-radius: 9px; font-weight: 600; font-size: 14px;
}
.seg-btn.active { background: var(--surface-2); color: var(--text); }
.field {
  width: 100%; margin-bottom: 11px; padding: 13px 14px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); font-size: 15px;
}
.field:focus { outline: 2px solid var(--accent); border-color: transparent; }
.btn-primary {
  width: 100%; padding: 13px; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 15px;
}
.btn-primary:active { background: var(--accent-2); }
.btn-sm { width: auto; padding: 8px 16px; border-radius: 10px; font-size: 14px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 16px; }

/* ----------------------------------------------------------- app shell */
.app { max-width: var(--max); margin: 0 auto; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #fff;
}
.topbar-title {
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; gap: 7px; letter-spacing: -.01em;
}
.icon-btn {
  background: transparent; border: 0; color: var(--text);
  font-size: 22px; width: 38px; height: 38px; border-radius: 10px;
}
.icon-btn:active { background: var(--surface); }

.view {
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 8px);
  min-height: calc(100dvh - var(--topbar-h));
}

/* ------------------------------------------------------------- tabbar */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: var(--max);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid #fff;
  z-index: 30;
}
.tab {
  background: transparent; border: 0; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; flex: 1; padding: 6px 0;
}
.tab-ico { font-size: 19px; line-height: 1; }
.tab.active { color: var(--text); }
.tab-compose {
  flex: 0 0 auto; width: 46px; height: 38px; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 24px; font-weight: 400;
  margin: 0 4px; display: grid; place-items: center;
}

/* -------------------------------------------------------------- posts */
.post {
  display: flex; gap: 11px; padding: 14px 14px 12px;
  border-bottom: 1px solid #fff;
}
.post-tap { cursor: pointer; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 42px;
  object-fit: cover; background: var(--surface-2);
  display: grid; place-items: center; font-weight: 600; color: var(--accent-2);
  border: 1px solid var(--line); overflow: hidden;
}
.avatar.lg { width: 76px; height: 76px; flex-basis: 76px; font-size: 28px; }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: baseline; gap: 6px; }
.post-name { font-weight: 600; }
.post-handle, .post-time { color: var(--muted); font-size: 13px; }
.post-body { margin: 3px 0 0; white-space: pre-wrap; word-wrap: break-word; }
.post-media { margin-top: 9px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.post-media img, .post-media video { display: block; width: 100%; max-height: 520px; object-fit: cover; background: #000; }
.post-actions { display: flex; gap: 18px; margin-top: 9px; color: var(--muted); font-size: 13px; }
.act { display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 0; color: var(--muted); font-size: 13px; padding: 2px; }
.media-note {
  margin-top: 9px; padding: 22px 14px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--bg-2); color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 14px;
}
.media-note.processing { color: var(--accent-2); }
.spinner.sm { width: 15px; height: 15px; border-width: 2px; margin: 0; display: inline-block; vertical-align: middle; }
.act.liked { color: var(--danger); }
.act:active { opacity: .6; }

/* ------------------------------------------------------------ profile */
.profile-head { padding: 18px 16px; border-bottom: 1px solid var(--line); }
.profile-top { display: flex; gap: 16px; align-items: center; }
.profile-meta { flex: 1; min-width: 0; }
.profile-name { font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 700; }
.profile-handle { color: var(--muted); font-size: 14px; }
.profile-bio { margin: 12px 0 4px; }
.profile-stats { display: flex; gap: 18px; color: var(--muted); font-size: 14px; margin-top: 6px; }
.profile-stats b { color: var(--text); }
.profile-actions { margin-top: 14px; display: flex; gap: 8px; }
.btn-outline {
  padding: 9px 18px; border-radius: 11px; background: transparent;
  border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px;
}
.btn-outline.active { background: var(--surface-2); }

/* -------------------------------------------------------------- reels */
.reels {
  height: calc(100dvh - var(--topbar-h) - var(--tabbar-h));
  overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none;
}
.reels::-webkit-scrollbar { display: none; }
.reel {
  position: relative; height: 100%; scroll-snap-align: start;
  display: grid; place-items: center; background: #000;
}
.reel video { width: 100%; height: 100%; object-fit: contain; }
.reel-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 16px 22px;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
}
.reel-author { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.reel-body { margin-top: 4px; }
.reel-side {
  position: absolute; right: 12px; bottom: 80px;
  display: flex; flex-direction: column; gap: 18px; align-items: center;
}
.reel-side .act { flex-direction: column; color: #fff; font-size: 12px; gap: 3px; }

/* --------------------------------------------------------- misc states */
.empty { text-align: center; color: var(--muted); padding: 60px 24px; }
.empty-emoji { font-size: 40px; display: block; margin-bottom: 10px; }
.loader { text-align: center; color: var(--muted); padding: 26px; }
.spinner {
  width: 22px; height: 22px; border: 2px solid var(--line);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------- compose sheet */
.sheet {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center;
}
.sheet-panel {
  width: 100%; max-width: var(--max);
  background: var(--surface); border-radius: 20px 20px 0 0;
  border: 1px solid var(--line); border-bottom: 0;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  animation: rise .22s ease;
}
@keyframes rise { from { transform: translateY(40px); opacity: .6; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.link-btn { background: transparent; border: 0; color: var(--muted); font-size: 15px; }
.compose-body {
  width: 100%; min-height: 110px; resize: none; border: 0; outline: 0;
  background: transparent; color: var(--text); font-size: 17px; font-family: inherit;
}
.compose-preview img, .compose-preview video {
  width: 100%; border-radius: 12px; margin-top: 6px; max-height: 280px; object-fit: cover;
}
.sheet-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.chip {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  padding: 8px 13px; border-radius: 999px; font-size: 13px; font-weight: 500;
}
.chip:active { background: var(--surface-2); }
.count { margin-left: auto; color: var(--muted); font-size: 13px; }

/* --------------------------------------------------- edit profile sheet */
.ep-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 18px; }
.ep-avatar {
  width: 92px; height: 92px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--accent-2); font-size: 34px; font-weight: 600;
  display: grid; place-items: center; overflow: hidden; cursor: pointer; padding: 0;
  position: relative;
}
.ep-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ep-avatar::after {
  content: '📷'; position: absolute; right: -2px; bottom: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center; font-size: 14px;
  border: 3px solid var(--surface);
}
.ep-change { background: transparent; border: 0; color: var(--accent-2); font-weight: 600; font-size: 14px; }
.ep-label { display: block; color: var(--muted); font-size: 13px; margin: 10px 2px 5px; }
.ep-bio { width: 100%; min-height: 70px; resize: none; font-family: inherit; }
.ep-count { text-align: right; color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px); transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 999px; z-index: 80; font-size: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}

/* tablet/desktop niceties */
@media (min-width: 640px) {
  .tab-lbl { display: inline; }
  .tabbar { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------- v2 additions */
/* hashtag links */
.tag { color: var(--accent-2); font-weight: 600; }

/* views in actions */
.act.views { pointer-events: none; }

/* home For You / Following toggle */
.feed-seg {
  display: flex; position: sticky; top: var(--topbar-h); z-index: 15;
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid #fff;
}
.feed-seg-btn {
  flex: 1; background: transparent; border: 0; color: var(--muted);
  padding: 13px; font-weight: 600; font-size: 15px; position: relative;
}
.feed-seg-btn.active { color: var(--text); }
.feed-seg-btn.active::after {
  content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 3px; border-radius: 3px; background: var(--accent);
}

/* profile link */
.profile-link { margin-top: 6px; }
.profile-link a { font-size: 14px; word-break: break-all; }

/* explore page */
.explore-sec { padding: 16px; border-bottom: 1px solid var(--line); }
.explore-h { font-family: 'Sora', sans-serif; font-size: 17px; margin: 0 0 4px; }
.explore-sub { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.interest-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.interest-chip {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.interest-chip b { color: var(--muted); margin-left: 4px; cursor: pointer; padding: 0 2px; }
.interest-add { position: relative; }
.suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin-top: 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.suggest-item { padding: 11px 14px; cursor: pointer; display: flex; justify-content: space-between; }
.suggest-item span { color: var(--muted); font-size: 12px; }
.suggest-item:active, .suggest-item:hover { background: var(--surface); }
.trend-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.trend-tag {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  padding: 9px 13px; border-radius: 12px; font-size: 13px; font-weight: 600; text-align: left;
}
.trend-tag span { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 2px; }

/* hashtag page header */
.hashtag-head { padding: 18px 16px; border-bottom: 1px solid var(--line); }
.hashtag-title { font-family: 'Sora', sans-serif; font-size: 24px; font-weight: 700; }
.hashtag-stats { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }

/* terms / 18+ modal */
.terms-panel { border-radius: 18px; max-width: 460px; margin: auto; }
.sheet { align-items: center; }
.terms-title { font-family: 'Sora', sans-serif; font-size: 20px; display: block; margin-bottom: 12px; }
.terms-list { margin: 0 0 16px; padding-left: 20px; color: var(--text); }
.terms-list li { margin-bottom: 9px; font-size: 14px; line-height: 1.5; }
.terms-list b { color: var(--accent-2); }
.terms-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); cursor: pointer; }
.terms-check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 18px; }
.terms-actions { display: flex; justify-content: flex-end; gap: 12px; align-items: center; margin-top: 18px; }
.btn-primary.btn-sm[disabled] { opacity: .5; }

/* prevent video download affordances */
video::-internal-media-controls-download-button { display: none; }
video::-webkit-media-controls-enclosure { overflow: hidden; }

/* ----------------------------------------------------- terms / age gate */
.terms-panel { max-width: var(--max); }
.terms-title { font-family: 'Sora', sans-serif; font-size: 20px; display: block; margin-bottom: 12px; }
.terms-list { margin: 0 0 16px; padding-left: 18px; color: var(--text); }
.terms-list li { margin-bottom: 9px; line-height: 1.4; }
.terms-list b { color: var(--accent-2); }
.terms-check {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 16px;
}
.terms-check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.terms-actions { display: flex; align-items: center; justify-content: space-between; }

/* ============================================================ SIDEBAR LAYOUT */
.app { max-width: none; margin: 0; min-height: 100dvh; }

/* left sidebar — drawer on mobile, fixed rail on desktop */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 248px; z-index: 60;
  background: var(--bg-2); border-right: 1px solid var(--line);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 4px;
  transform: translateX(-100%); transition: transform .22s ease;
}
.sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,.6); }
.side-brand {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 22px;
  letter-spacing: -.02em; padding: 8px 12px 18px; display: flex; align-items: center; gap: 8px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--text);
  font-family: inherit; font-size: 16px; font-weight: 500; padding: 12px; border-radius: 12px;
}
.side-link .ni { font-size: 18px; width: 22px; text-align: center; flex: 0 0 22px; }
.side-link:hover { background: var(--surface); }
.side-link.active { background: var(--surface-2); font-weight: 700; }
.side-out {
  margin-top: auto; background: transparent; border: 1px solid var(--line);
  color: var(--muted); border-radius: 12px; padding: 11px; font-weight: 600; font-size: 14px;
}
.side-out:hover { color: var(--text); border-color: var(--muted); }

.drawer-back {
  position: fixed; inset: 0; background: rgba(255, 255, 255, 0.55); z-index: 55;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-back.show { opacity: 1; pointer-events: auto; }

/* main column */
.app-main { max-width: var(--max); margin: 0 auto; min-height: 100dvh; }
.topbar { gap: 8px; }
.only-mobile { display: inline-flex; }

/* search bar */
.searchbar {
  position: relative; flex: 1; display: flex; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 14px; height: 38px;
}
.searchbar .search-ico { color: var(--muted); font-size: 13px; margin-right: 8px; }
.searchbar input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 14px; font-family: inherit; }
.searchbar input::-webkit-search-cancel-button { filter: invert(.6); }
.search-drop {
  position: absolute; top: 46px; left: 0; right: 0; z-index: 45;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  max-height: 64vh; overflow-y: auto; padding: 6px; box-shadow: 0 14px 44px rgba(0,0,0,.5);
}
.sd-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 9px 10px 4px; }
.sd-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.sd-item:hover { background: var(--surface-2); }
.sd-tag { color: var(--accent-2); font-weight: 600; }
.sd-count { color: var(--muted); font-size: 13px; margin-left: auto; }
.sd-empty { padding: 14px; text-align: center; color: var(--muted); }
.sd-all { padding: 11px 10px; text-align: center; color: var(--accent-2); font-weight: 600; cursor: pointer; border-top: 1px solid var(--line); margin-top: 4px; }
.avatar.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 13px; }
.search-head { padding: 14px 16px 4px; font-weight: 700; font-family: 'Sora', sans-serif; font-size: 17px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px 4px; }

/* right rail */
.rightbar { display: none; }
.rail-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.rail-h { font-size: 15px; margin: 0 0 10px; font-family: 'Sora', sans-serif; }
.rail-empty { color: var(--muted); font-size: 13px; }
.creator-row { display: flex; align-items: center; gap: 10px; padding: 9px 16px; }
.rail-card .creator-row { padding: 8px 0; }
.creator-meta { flex: 1; min-width: 0; }
.creator-name { font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.creator-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.follow-mini { background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600; flex: 0 0 auto; }
.follow-mini.following { background: var(--surface-2); color: var(--text); }
.rail-post { display: flex; gap: 10px; padding: 8px 0; cursor: pointer; align-items: center; }
.rail-thumb { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex: 0 0 46px; background: var(--surface-2); }
.rail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rail-post-meta { flex: 1; min-width: 0; }
.rail-post-body { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-post-sub { color: var(--muted); font-size: 12px; }

/* bottom tabbar: full-width on mobile */
.tabbar { left: 0; transform: none; width: 100%; max-width: none; }

/* ---- desktop: permanent sidebar via grid ---- */
@media (min-width: 1000px) {
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; height: 100vh; transform: none; box-shadow: none; }
  .app-main { grid-column: 2; max-width: var(--max); margin: 0 auto; width: 100%; }
  .only-mobile { display: none; }
  .drawer-back { display: none; }
  .tabbar { display: none; }
  .view { padding-bottom: 40px; }
  .reels { height: calc(100dvh - var(--topbar-h)); }
}
@media (min-width: 1200px) {
  .app { grid-template-columns: 248px minmax(0, 1fr) 330px; }
  .rightbar { display: block; grid-column: 3; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 64px 18px 24px; }
}

/* ============================================================ PERFORMANCE */
/* Skip rendering work for off-screen feed cards (huge win on long feeds). */
.post { content-visibility: auto; contain-intrinsic-size: 0 240px; }

/* Reserve space + show a subtle shimmer while media loads (less jank, feels faster). */
.post-media { background: var(--surface-2); min-height: 60px; }
.post-media img, .rail-thumb img, .avatar img {
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface) 50%, var(--surface-2) 70%);
  background-size: 200% 100%;
}
.rail-thumb, .ep-avatar { background: var(--surface-2); }
/* ============================================================ v8: ICONS + MODERN UI */

/* ---- base SVG icon sizing ---- */
.ic { width: 22px; height: 22px; display: block; flex: 0 0 auto; }
.icw { display: inline-flex; }

/* nav icons */
.side-link .ni { display: inline-flex; align-items: center; justify-content: center; }
.side-link .ni .ic { width: 24px; height: 24px; }
.side-link.active .ni { color: var(--accent); }
.tab-ico { display: inline-flex; }
.tab-ico .ic { width: 25px; height: 25px; }
.tab.active .tab-ico { color: var(--accent); }
.tab-compose .ic { width: 24px; height: 24px; }
.icon-btn .ic { width: 24px; height: 24px; margin: 0 auto; }

/* modern search bar */
.searchbar { height: 40px; transition: border-color .15s, background .15s; }
.searchbar:focus-within { border-color: var(--accent); background: var(--surface); }
.search-ico { display: inline-flex; align-items: center; color: var(--muted); margin-right: 8px; }
.search-ico .ic { width: 18px; height: 18px; }
.searchbar:focus-within .search-ico { color: var(--accent); }

/* ---- post action icons ---- */
.post-actions { gap: 22px; }
.act { gap: 6px; transition: color .15s; }
.act .ic { width: 20px; height: 20px; }
.act:hover { color: var(--text); }
.act-like:hover { color: var(--danger); }
.act.liked { color: var(--danger); }
.act.liked .ic { fill: var(--danger); stroke: var(--danger); }
.act-del:hover { color: var(--danger); }
.act.views { color: var(--muted); }
.act.pop .ic { animation: likepop .28s ease; }
@keyframes likepop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ============================================================ REELS (bigger icons, iOS) */
.reels { -webkit-overflow-scrolling: touch; }
.reel { scroll-snap-stop: always; }
.reel video { cursor: pointer; }
.reel-name { font-size: 14px; color: #fff;}

/* play glyph shown when paused */
.reel-play {
  position: absolute; inset: 0; margin: auto; width: 80px; height: 80px;
  display: grid; place-items: center; pointer-events: none;
  background: rgba(0,0,0,.32); border-radius: 50%; backdrop-filter: blur(2px);
}
.reel-play .ic { width: 40px; height: 40px; color: #fff; }

/* tap-for-sound hint */
.reel-unmute-hint {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; z-index: 5;
  background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.18);
  color: #fff; border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(8px);
}
.reel-unmute-hint .ic { width: 18px; height: 18px; }

/* big TikTok-style side rail */
.reel-side {
  position: absolute; right: 10px; bottom: 92px;
  display: flex; flex-direction: column; gap: 22px; align-items: center; z-index: 6;
}
.reel-act {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: transparent; border: 0; color: #fff; font-size: 12px; font-weight: 600;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
}
.reel-act .ic { width: 34px; height: 34px; }
.reel-act .rc { font-size: 12px; }
.reel-act:active { transform: scale(.9); }
.reel-act.liked { color: #fff; }
.reel-act.liked .ic { fill: #7c5cff; stroke: #7c5cff; }
.reel-act.pop .ic { animation: likepop .28s ease; }
.reel-views { opacity: .92; }
.reel-mute .ic { width: 30px; height: 30px; }

/* ============================================================ ADS (300x250) */
.ad-card {
  border-bottom: 1px solid var(--line); padding: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.ad-label {
  align-self: flex-start; font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.ad-slot {
  width: 300px; height: 250px; max-width: 100%;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--bg-2); display: grid; place-items: center;
}
.ad-slot iframe { border: 0; display: block; }
.ad-house {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center;
  color: var(--text); padding: 18px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(124,92,255,.18), transparent 65%), var(--surface);
}
.ad-house .ad-house-ico { width: 46px; height: 46px; color: var(--accent); }
.ad-house strong { font-family: 'Sora', sans-serif; font-size: 19px; }
.ad-house span { color: var(--muted); font-size: 13px; }

/* ============================================================ MOBILE SUGGESTIONS */
/* who to follow — horizontal cards */
.wtf-card { border-bottom: 1px solid var(--line); padding: 14px 0 16px; }
.wtf-head, .disc-head {
  display: flex; align-items: center; gap: 8px; padding: 0 16px 12px;
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 16px;
}
.wtf-ico, .disc-ico { width: 19px; height: 19px; color: var(--accent); }
.wtf-row {
  display: flex; gap: 12px; overflow-x: auto; padding: 0 16px 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.wtf-row::-webkit-scrollbar { display: none; }
.wtf-cell {
  flex: 0 0 140px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 12px; display: flex; flex-direction: column;
  align-items: center; gap: 6px; text-align: center;
}
.wtf-cell .avatar.lg { width: 60px; height: 60px; flex-basis: 60px; font-size: 22px; cursor: pointer; }
.wtf-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 116px; cursor: pointer; }
.wtf-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 116px; }
.wtf-follow {
  margin-top: 6px; background: var(--accent); color: #fff; border: 0;
  border-radius: 999px; padding: 7px 20px; font-size: 13px; font-weight: 600;
}
.wtf-follow.following { background: var(--surface-2); color: var(--text); }

/* suggested content — thumbnail strip */
.disc-card { border-bottom: 1px solid var(--line); padding: 14px 0 16px; }
.disc-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.disc-row::-webkit-scrollbar { display: none; }
.disc-cell {
  position: relative; flex: 0 0 128px; height: 170px; border-radius: 14px;
  overflow: hidden; background: var(--surface-2); cursor: pointer; border: 1px solid var(--line);
}
.disc-cell img { width: 100%; height: 100%; object-fit: cover; }
.disc-play {
  position: absolute; inset: 0; margin: auto; width: 38px; height: 38px;
  display: grid; place-items: center; pointer-events: none;
}
.disc-play .ic { width: 30px; height: 30px; color: #fff; filter: drop-shadow(0 2px 5px rgba(0,0,0,.6)); }
.disc-views {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
  color: #fff; font-size: 12px; font-weight: 600; filter: drop-shadow(0 1px 3px rgba(0,0,0,.8));
}
.disc-views .ic { width: 15px; height: 15px; }

/* ============================================================ ADMIN PANEL */
.admin { padding-bottom: 30px; }
.admin-stats { display: flex; gap: 10px; padding: 16px; }
.admin-stat {
  flex: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; text-align: center;
}
.admin-stat-n { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 800; }
.admin-stat-l { color: var(--muted); font-size: 12px; margin-top: 2px; }

.admin-tabs {
  display: flex; gap: 6px; padding: 0 16px 12px; position: sticky;
  top: var(--topbar-h); background: var(--bg); z-index: 12;
}
.admin-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 12px; padding: 11px; font-weight: 600; font-size: 14px;
}
.admin-tab .ic { width: 18px; height: 18px; }
.admin-tab.active { background: var(--surface-2); color: var(--text); border-color: var(--accent); }

.admin-search {
  display: flex; align-items: center; gap: 8px; margin: 0 16px 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; height: 42px;
}
.admin-search .ic { width: 18px; height: 18px; color: var(--muted); }
.admin-search input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 14px; font-family: inherit; }

.admin-list { display: flex; flex-direction: column; }
.admin-user { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.admin-user.banned { background: rgba(255,92,122,.06); }
.admin-user-meta { flex: 1; min-width: 0; }
.admin-user-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-user-sub { color: var(--muted); font-size: 12px; }
.admin-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 6px;
  background: var(--surface-2); color: var(--accent-2);
}
.admin-badge.ban { background: rgba(255,92,122,.16); color: var(--danger); }
.admin-ban-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--danger); color: var(--danger);
  border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 600;
}
.admin-ban-btn .ic { width: 16px; height: 16px; }
.admin-ban-btn.unban { border-color: #3ddc84; color: #3ddc84; }
.admin-ban-btn.disabled { opacity: .4; border-color: var(--line); color: var(--muted); }

.admin-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px; padding: 0 16px;
}
.admin-cell { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.admin-thumb { position: relative; aspect-ratio: 1; background: var(--surface-2); cursor: pointer; }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-thumb-play { position: absolute; inset: 0; margin: auto; width: 32px; height: 32px; display: grid; place-items: center; pointer-events: none; }
.admin-thumb-play .ic { width: 26px; height: 26px; color: #fff; filter: drop-shadow(0 2px 5px rgba(0,0,0,.6)); }
.admin-thumb-note { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 22px; }
.admin-cell-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; gap: 6px; }
.admin-cell-user { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-cell-del { flex: 0 0 auto; background: transparent; border: 0; color: var(--danger); display: inline-flex; padding: 2px; }
.admin-cell-del .ic { width: 18px; height: 18px; }

.admin-more {
  display: block; margin: 16px auto 0; background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 12px; padding: 11px 28px; font-weight: 600; font-size: 14px;
}

/* ============================================================ SMOOTHER SCROLL */
html { scroll-behavior: auto; }
.view, body { -webkit-overflow-scrolling: touch; }
/* tighter intrinsic sizing reduces layout shift while fast-scrolling */
.post { contain-intrinsic-size: 0 260px; }
.reel { content-visibility: auto; contain-intrinsic-size: 100% 100%; }

/* right rail also gets the new follow-mini icon spacing */
.creator-row .avatar { cursor: pointer; }
