/* ============================================================
   Qoooo — dark theme, white + silver
   Display: Montserrat   Body: Manrope
   ============================================================ */
:root {
  --bg:        #09090b;
  --bg-2:      #0e0e11;
  --surface:   #131317;
  --surface-2: #17171c;
  --line:      #26262d;
  --line-soft: #1d1d22;

  --text:      #f3f3f6;   /* white primary           */
  --silver:    #c7c8d1;   /* silver secondary text   */
  --silver-2:  #e9eaef;   /* bright silver           */
  --muted:     #83838f;   /* dim text                */

  /* chrome / silver gradient used for brand + primary */
  --chrome: linear-gradient(135deg,#f2f3f7 0%,#c9ccd6 38%,#9a9da9 64%,#d8dae2 100%);
  --chrome-soft: linear-gradient(135deg,#3a3b42,#222329);

  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 10px 40px -12px rgba(0,0,0,.7);
  --maxw:      975px;
  --sidebar:   244px;

  --font-display: 'Montserrat', ui-sans-serif, sans-serif;
  --font-body: 'Manrope', ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
/* atmospheric backdrop */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 600px at 12% -5%, rgba(170,174,190,.10), transparent 60%),
    radial-gradient(800px 700px at 100% 0%, rgba(120,124,140,.07), transparent 55%),
    linear-gradient(180deg,#0b0b0e,#070708);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; opacity: .035; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
strong { font-weight: 700; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.center { text-align: center; }
.pad { padding: 22px; }

/* link styles inside captions / bios */
.ext-link { color: var(--silver-2); border-bottom: 1px solid rgba(201,204,214,.35); }
.ext-link:hover { color: #fff; }
.mention, .hashtag { color: var(--silver); font-weight: 600; }
.mention:hover, .hashtag:hover { color: #fff; }

/* icons */
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor;
      stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; }
.ic.xl { width: 40px; height: 40px; stroke-width: 1.4; }

/* ---------------- Brand ---------------- */
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 4px 26px; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--chrome); color: #0c0c0e;
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  box-shadow: 0 2px 14px rgba(220,222,230,.18), inset 0 1px 0 rgba(255,255,255,.6);
}
.brand-mark.big { width: 64px; height: 64px; border-radius: 18px; font-size: 38px; }
.brand-word {
  font-family: var(--font-display); font-weight: 800; font-size: 26px;
  letter-spacing: .5px;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-word.xl { font-size: 40px; }

/* ---------------- Sidebar nav ---------------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar);
  padding: 30px 16px; border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(19,19,23,.7), rgba(9,9,11,.4));
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column; gap: 4px; z-index: 50;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 15px;
  padding: 12px 13px; border-radius: 12px; color: var(--silver);
  font-size: 15px; font-weight: 500; background: none; border: 0; cursor: pointer;
  width: 100%; text-align: left; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { color: var(--text); font-weight: 700; }
.nav-item.active .ic { stroke-width: 2.2; }
.logout-form { margin-top: auto; }
.logout { color: var(--muted); }
.nav-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background-size: cover; background-position: center;
  border: 1px solid var(--line); background-color: var(--surface-2);
}
.nav-avatar.sm { width: 26px; height: 26px; }

/* mobile bottom tab bar */
.tabbar { display: none; }

/* ---------------- App shell ---------------- */
.app { margin-left: var(--sidebar); min-height: 100dvh; padding: 30px 24px 60px; }
.narrow { max-width: 620px; margin: 0 auto; }
.page-title { font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: .3px; }
.page-title.sm { font-size: 20px; }

/* cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.empty { text-align: center; padding: 60px 24px; margin-top: 20px; }
.empty h2 { font-family: var(--font-display); font-weight: 700; margin-bottom: 8px; }
.empty a, .profile-link, .auth-switch a { color: var(--silver-2); }

/* ---------------- Buttons + forms ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 11px; font-weight: 700; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; font-family: var(--font-body);
  transition: transform .08s, filter .15s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn.full { width: 100%; }
.btn-primary { background: var(--chrome); color: #000; box-shadow: inset 0 1px 0 rgba(255,255,255,.55); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: #3a3a44; }
.link-btn { background: none; border: 0; color: var(--silver-2); font-weight: 700; cursor: pointer; font-size: 14px; font-family: var(--font-body); }
.link-btn:hover { color: #fff; }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--silver); }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 11px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  font: inherit; resize: vertical; transition: border-color .15s, background .15s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: #4a4b55; background: #101013;
}
.field input::placeholder, .field textarea::placeholder { color: #56565f; }
.hint { color: var(--muted); font-size: 12px; }

.alert { background: rgba(220,80,80,.12); border: 1px solid rgba(220,80,80,.4);
  color: #f0b6b6; padding: 11px 14px; border-radius: 11px; margin-bottom: 16px; font-size: 14px; }
.alert.ok { background: rgba(150,160,170,.14); border-color: rgba(180,185,195,.4); color: var(--silver-2); }

/* ---------------- Auth ---------------- */
.auth-body { display: grid; place-items: center; }
.auth-shell { width: 100%; min-height: 100dvh; display: grid; place-items: center; position: relative; padding: 24px; }
.auth-aurora {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(600px 400px at 50% 8%, rgba(200,204,214,.10), transparent 60%);
  pointer-events: none;
}
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 392px;
  background: linear-gradient(180deg, rgba(20,20,25,.92), rgba(13,13,16,.92));
  border: 1px solid var(--line); border-radius: 22px; padding: 40px 34px;
  box-shadow: var(--shadow);
}
.auth-brand { text-align: center; margin-bottom: 26px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.auth-brand .brand-mark { margin-bottom: 6px; }
.auth-tag { color: var(--muted); font-size: 14px; }
.auth-switch { text-align: center; margin-top: 20px; color: var(--muted); font-size: 14px; }

/* ---------------- Feed ---------------- */
.feed-layout { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 56px; }
.feed { max-width: 540px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.post { overflow: hidden; }
.post-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; }
.post-user { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background-size: cover; background-position: center;
  background-color: var(--surface-2); border: 1px solid var(--line);
  background-image: url('/static/img/default-avatar.svg');
}
.avatar.lg { width: 54px; height: 54px; }
.uname { font-weight: 700; color: var(--text); }
.post-media { background: #000; }
.post-media img, .post-media video { width: 100%; max-height: 720px; object-fit: contain; }
.post-actions { display: flex; align-items: center; gap: 6px; padding: 10px 11px 4px; }
.icon-btn { background: none; border: 0; color: var(--text); cursor: pointer; padding: 6px; border-radius: 10px; line-height: 0; transition: transform .12s, color .15s; }
.icon-btn:hover { color: var(--silver-2); }
.icon-btn:active { transform: scale(.9); }
.like-btn.liked .heart { fill: var(--silver-2); stroke: var(--silver-2); }
.like-count { padding: 2px 15px; font-weight: 700; font-size: 14px; }
.view-count { padding: 2px 15px; color: var(--muted); font-size: 13px; }
.caption { padding: 6px 15px 2px; font-size: 14px; }
.caption .uname { margin-right: 6px; }
.comments { padding: 6px 15px 0; display: flex; flex-direction: column; gap: 4px; }
.comment { font-size: 14px; color: var(--silver); }
.comment .uname { margin-right: 6px; }
.comment-form { display: flex; align-items: center; gap: 8px; padding: 12px 15px 15px; border-top: 1px solid var(--line-soft); margin-top: 10px; }
.comment-form input { flex: 1; background: none; border: 0; color: var(--text); font: inherit; }
.comment-form input:focus { outline: none; }
.comment-form input::placeholder { color: var(--muted); }
.comment-error { color: #f0a0a0; font-size: 13px; padding: 0 15px 12px; }

/* right rail */
.rail { position: sticky; top: 30px; align-self: start; display: flex; flex-direction: column; gap: 22px; }
.rail-me { display: flex; align-items: center; gap: 14px; }
.rail-title { color: var(--muted); font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.suggest-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; }
.suggest-user { display: flex; align-items: center; gap: 11px; }
.suggest-user span span { display: block; }
.suggest-user .uname { font-size: 14px; }
.rail-foot { padding-top: 8px; }

/* ---------------- Upload / dropzone ---------------- */
.dropzone { display: block; border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--bg-2); cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: #43434d; }
.dropzone.dragover { border-color: var(--silver); background: #101013; }
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 54px 24px; color: var(--silver); text-align: center; }
.dropzone-inner small { color: var(--muted); }
.preview { width: 100%; background: #000; }
.preview img, .preview video { width: 100%; max-height: 460px; object-fit: contain; }
.video-preview video { max-height: 480px; margin: 0 auto; }

/* ---------------- Videos ---------------- */
.videos-app { max-width: 760px; margin: 0 auto; }
.videos-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.videos-scroller { height: calc(100dvh - 150px); overflow-y: auto; scroll-snap-type: y mandatory; border-radius: var(--radius); }
.videos-scroller::-webkit-scrollbar { width: 0; }
.video { position: relative; height: calc(100dvh - 150px); scroll-snap-align: start; display: grid; place-items: center; background: #000; border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.video video { height: 100%; width: 100%; object-fit: contain; }
.video-mute { position: absolute; top: 14px; right: 14px; background: rgba(0,0,0,.5); border: 0; color: #fff; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(4px); }
.video-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 18px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.7)); }
.video-user { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.video-user .avatar { width: 34px; height: 34px; }
.video-caption { font-size: 14px; color: #ececf0; max-width: 80%; }

/* ---------------- Profile ---------------- */
.profile-wrap { max-width: 860px; margin: 0 auto; }
.profile-head { display: flex; gap: 46px; align-items: center; padding: 14px 8px 30px; }
.profile-avatar { width: 132px; height: 132px; border-radius: 50%; flex-shrink: 0; background-size: cover; background-position: center;
  background-color: var(--surface-2); border: 1px solid var(--line);
  background-image: url('/static/img/default-avatar.svg');
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px rgba(200,202,212,.12); }
.profile-avatar.md { width: 86px; height: 86px; }
.profile-avatar.sm { width: 56px; height: 56px; }
.profile-meta { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.profile-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.profile-username { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: .3px; }
.profile-stats { display: flex; gap: 28px; font-size: 15px; color: var(--silver); }
.profile-bio { font-size: 14px; }
.profile-name { font-weight: 700; }
.bio-text { color: var(--silver); margin: 2px 0; }
.profile-link { display: inline-flex; align-items: center; gap: 6px; color: var(--silver-2); font-weight: 600; margin-top: 2px; }
.profile-link:hover { color: #fff; }

.profile-tabs { display: flex; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 6px; margin-bottom: 14px; }
.ptab { background: none; border: 0; color: var(--muted); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; padding: 14px 16px; cursor: pointer; border-top: 2px solid transparent; margin-top: -7px; }
.ptab.active { color: var(--text); border-top-color: var(--silver); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.grid-cell { position: relative; aspect-ratio: 1; background: #000; border-radius: 6px; overflow: hidden; }
.grid-cell img, .grid-cell video { width: 100%; height: 100%; object-fit: cover; }
.grid-badge { position: absolute; top: 8px; right: 8px; color: #fff; line-height: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.grid-badge .ic { width: 18px; height: 18px; fill: #fff; stroke: none; }

/* edit profile */
.avatar-edit { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.inline-form { margin: 4px 0; }
.file-label { display: inline-block; cursor: pointer; }

/* ---------------- Direct Messages ---------------- */
.dm-app { padding: 0; margin-left: var(--sidebar); }
.dm { display: grid; grid-template-columns: 360px 1fr; height: 100dvh; }
.dm-list { border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; min-height: 0; }
.dm-list-head { padding: 24px 20px 12px; }
.dm-search { padding: 0 16px 12px; position: relative; }
.dm-search input { width: 100%; padding: 10px 14px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; }
.dm-search input:focus { outline: none; border-color: #43434d; }
.search-results { position: absolute; left: 16px; right: 16px; top: 52px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; z-index: 10; box-shadow: var(--shadow); }
.search-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.search-row:hover { background: var(--surface); }
.search-row .avatar { width: 30px; height: 30px; }
.threads { overflow-y: auto; flex: 1; }
.thread { display: flex; align-items: center; gap: 12px; padding: 12px 18px; position: relative; }
.thread:hover { background: var(--surface); }
.thread.active { background: var(--surface-2); }
.thread .avatar { width: 46px; height: 46px; }
.thread-meta { display: flex; flex-direction: column; min-width: 0; }
.preview-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
.badge { margin-left: auto; background: var(--chrome); color: #0c0c0e; font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }

.dm-thread { display: flex; flex-direction: column; min-height: 0; }
.dm-empty { margin: auto; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dm-empty p { font-family: var(--font-display); font-size: 20px; color: var(--text); }
.dm-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.back-btn { display: none; color: var(--text); }
.dm-peer { display: flex; align-items: center; gap: 11px; }
.dm-peer .avatar { width: 38px; height: 38px; }
.dm-scroll { flex: 1; overflow-y: auto; padding: 22px 20px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 64%; padding: 10px 14px; border-radius: 18px; font-size: 14px; word-wrap: break-word; }
.bubble.theirs { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); align-self: flex-start; border-bottom-left-radius: 5px; }
.bubble.mine { background: var(--chrome); color: #0c0c0e; align-self: flex-end; border-bottom-right-radius: 5px; font-weight: 500; }
.dm-compose { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.dm-compose input { flex: 1; padding: 12px 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; }
.dm-compose input:focus { outline: none; border-color: #43434d; }

/* ---------------- Error ---------------- */
.error-box { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.error-code { font-family: var(--font-display); font-weight: 800; font-size: 96px; background: var(--chrome); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .feed-layout { grid-template-columns: minmax(0,1fr); }
  .rail { display: none; }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .app { margin-left: 0; padding: 18px 12px 86px; }
  .page-title { font-size: 24px; }

  /* bottom tab bar */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    justify-content: space-around; align-items: center; height: 60px;
    background: rgba(12,12,15,.92); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line-soft); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { color: var(--silver); padding: 8px 14px; line-height: 0; }
  .tabbar a.active { color: var(--text); }

  /* Make the profile tab clearly identifiable (avatar only) */
  .tab-profile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 14px; }
  .tab-profile .nav-avatar.sm { width: 28px; height: 28px; border-color: var(--silver); }
  .tab-profile.active .nav-avatar.sm { border-color: var(--text); box-shadow: 0 0 0 2px var(--text); }

  .profile-head { gap: 22px; padding: 8px 4px 22px; }
  .profile-avatar { width: 86px; height: 86px; }
  .profile-stats { gap: 18px; font-size: 14px; }

  /* Pin the profile menu (Help / Log out) to the upper-right corner on mobile.
     Scoped under .profile-wrap so it beats the base 'display:none' by
     specificity (no !important needed) despite appearing earlier in the file. */
  .profile-wrap { position: relative; }
  .profile-wrap .profile-menu { display: inline-flex; position: absolute; top: 8px; right: 8px; z-index: 5; }

  /* DM becomes single-pane */
  .dm-app { margin-left: 0; }
  .dm { grid-template-columns: 1fr; height: calc(100dvh - 60px); }
  .dm .dm-thread { display: none; }
  .dm.has-active .dm-list { display: none; }
  .dm.has-active .dm-thread { display: flex; }
  .back-btn { display: block; }
  .videos-scroller, .video { height: calc(100dvh - 200px); }
}

/* ---------------- Owner menu + delete controls ---------------- */
.post-head-right { display: flex; align-items: center; gap: 4px; }
.owner-menu { position: relative; }
.menu-btn { background: none; border: 0; color: var(--silver); cursor: pointer; padding: 4px 6px; border-radius: 8px; line-height: 0; transition: background .12s, color .12s; }
.menu-btn:hover { color: var(--text); background: var(--surface-2); }
.menu-btn .ic { width: 20px; height: 20px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 156px; box-shadow: 0 12px 34px rgba(0,0,0,.55); }
.menu-del { display: block; width: 100%; text-align: left; background: none; border: 0; color: #ff6b6b; font-weight: 600; font-size: 14px; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-family: var(--font-body); }
.menu-del:hover { background: rgba(255,107,107,.12); }

/* Video feed: menu floats top-left over the clip */
.owner-menu.video-owner { position: absolute; top: 14px; left: 14px; z-index: 6; }
.video-owner .menu-btn { background: rgba(0,0,0,.5); color: #fff; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; backdrop-filter: blur(4px); padding: 0; }
.video-owner .menu-pop { left: 0; right: auto; }

/* Profile grid: trash button revealed on hover (always shown on touch) */
.cell-del { position: absolute; top: 6px; left: 6px; z-index: 4; background: rgba(0,0,0,.55); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .12s, background .12s; line-height: 0; padding: 0; }
.cell-del .ic { width: 16px; height: 16px; }
.grid-cell:hover .cell-del { opacity: 1; }
.cell-del:hover { background: rgba(229,72,77,.9); }
@media (hover: none) { .cell-del { opacity: 1; } }

/* ---------------- Logged-out (public) nav ---------------- */
.sidebar-public .nav { gap: 10px; }
.sidebar-public .nav .btn { width: 100%; text-align: center; }
.tabbar-public { gap: 12px; padding-left: 16px; padding-right: 16px; }
.tabbar-public a.btn { line-height: normal; flex: 1; text-align: center; }
.tabbar-public a.btn-primary { color: #000; }
.tabbar-public a.btn-ghost { color: var(--text); }

/* ---------------- Clickable grid cells + detail pages ---------------- */
.cell-link { position: absolute; inset: 0; z-index: 2; }          /* overlay link */
.grid-cell .cell-del { z-index: 3; }                               /* delete sits above link */
.grid-cell { cursor: pointer; }

.detail-wrap { max-width: 620px; margin: 0 auto; padding: 8px 0 40px; }
.detail-back { display: inline-block; color: var(--silver); font-weight: 600; margin: 4px 4px 14px; }
.detail-back:hover { color: var(--text); }

.video-detail-media { background: #000; border-radius: 12px; overflow: hidden; display: flex; justify-content: center; }
.video-detail-media video { width: 100%; max-height: 78vh; background: #000; }
.video-detail .caption { padding: 12px 4px 4px; }

/* ---------------- Inbox unread notification badge ---------------- */
.nav-ic { position: relative; display: inline-flex; line-height: 0; }
.nav-badge {
  position: absolute; top: -5px; right: -7px;
  min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  border-radius: 999px; background: #ff3b5c; color: #fff;
  font-size: 10px; font-weight: 700; font-family: var(--font-body);
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* Log out: a small, deliberately subtle icon on own profile (confirms on click) */
/* Profile menu (Help / Log out) — shown on mobile; desktop uses the sidebar */
.profile-menu { display: none; position: relative; }
.profile-menu-btn { background: none; border: 0; color: var(--silver); cursor: pointer; padding: 6px; border-radius: 8px; line-height: 0; }
.profile-menu-btn:hover { color: var(--text); background: var(--surface-2); }
.profile-menu-btn .ic { width: 22px; height: 22px; }
.profile-menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 170px; box-shadow: 0 12px 34px rgba(0,0,0,.55); }
.profile-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font-weight: 600; font-size: 14px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-family: var(--font-body); }
.profile-menu-item:hover { background: var(--surface); }
.profile-menu-item .ic { width: 18px; height: 18px; color: var(--silver); }
.profile-menu-item.danger { color: #ff6b6b; }
.profile-menu-item.danger .ic { color: #ff6b6b; }
.profile-menu-form { margin: 20px 0 0; }

/* ---------------- Admin user management ---------------- */
.admin-wrap { max-width: 820px; margin: 0 auto; }
.admin-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius, 14px); overflow: hidden; }
.admin-row { display: grid; grid-template-columns: minmax(0,1fr) 54px 88px 290px; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.admin-row:last-child { border-bottom: 0; }
.admin-head { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.admin-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-user .avatar.sm { width: 38px; height: 38px; flex: none; }
.admin-names { display: flex; flex-direction: column; min-width: 0; }
.admin-names .uname { font-weight: 600; }
.admin-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #0d0d12; background: var(--silver); padding: 1px 6px; border-radius: 999px; vertical-align: middle; }
.col-posts, .col-joined { color: var(--muted); font-size: 13px; }
.col-act { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.col-act form { margin: 0; }
.col-act .btn-ghost.sm, .col-act .btn-danger.sm { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.btn-danger { background: #ff3b5c; color: #fff; border: 0; border-radius: 9px; font-weight: 700; cursor: pointer; padding: 7px 14px; font-family: var(--font-body); }
.btn-danger:hover { background: #e22f4e; }
.btn-danger.sm { padding: 6px 12px; font-size: 13px; }

@media (max-width: 760px) {
  .admin-row { grid-template-columns: minmax(0,1fr) 200px; grid-template-areas: "user act" "meta act"; row-gap: 4px; }
  .admin-row .col-user { grid-area: user; }
  .admin-row .col-act { grid-area: act; align-self: center; justify-content: flex-end; }
  .admin-row .col-posts, .admin-head .col-posts { display: none; }
  .admin-row .col-joined { grid-area: meta; }
  .admin-head { grid-template-columns: minmax(0,1fr) 200px; }
  .admin-head .col-joined { display: none; }
}

/* Admin: inline edit form */
.admin-edit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.admin-edit .field.sm { gap: 4px; flex: 1; min-width: 180px; }
.admin-edit .field.sm > span { font-size: 12px; }
.admin-edit .field.sm input { padding: 8px 10px; }
.admin-edit-actions { display: flex; gap: 8px; }

/* ---------------- Verified check badge (Instagram-style blue) ---------------- */
.verified-badge { width: 1em; height: 1em; vertical-align: -0.12em; margin-left: 5px; flex: none; display: inline-block; }
.verified-badge .vb-seal { fill: #1d9bf0; }
.verified-badge .vb-check { stroke: #fff; }
.profile-username .verified-badge { width: 20px; height: 20px; margin-left: 2px; }
.uname .verified-badge { margin-left: 2px; }
.inline-form { display: inline; margin: 0; }

/* Admin: promoted tag */
.promo-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #0d0d12; background: #f5c451; padding: 1px 6px; border-radius: 999px; vertical-align: middle; }

/* ---------------- Post visibility feature ---------------- */
/* Upload: visibility radio options */
.vis-field { border: 0; padding: 0; margin: 0; }
.vis-field > span { font-size: 13px; font-weight: 600; color: var(--silver); display: block; margin-bottom: 8px; }
.vis-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vis-opt { position: relative; cursor: pointer; }
.vis-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.vis-opt-body { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .12s, background .12s; }
.vis-opt-body .ic { width: 22px; height: 22px; flex: none; color: var(--silver); }
.vis-opt-body strong { display: block; font-size: 14px; }
.vis-opt-body small { display: block; line-height: 1.3; margin-top: 2px; }
.vis-opt input:checked + .vis-opt-body { border-color: var(--silver); background: var(--surface-2); }
.vis-note { display: block; margin-top: 8px; }
@media (max-width: 560px) { .vis-options { grid-template-columns: 1fr; } }

/* Members-only lock indicators */
.post-lock { color: var(--silver); line-height: 0; }
.post-lock .ic { width: 16px; height: 16px; }
.grid-badge.lock-badge .ic { width: 16px; height: 16px; fill: none; stroke: #fff; }

/* Locked profile grid tiles (logged-out visitors) */
.grid-locked { background: var(--surface-2); }
.locked-tile { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-align: center; }
.locked-tile .ic { width: 26px; height: 26px; }
.locked-tile span { font-size: 11px; font-weight: 600; letter-spacing: .04em; }

/* Members-only locked page */
.locked-icon { color: var(--silver); display: flex; justify-content: center; margin-bottom: 10px; }
.locked-icon .ic { width: 42px; height: 42px; }
.locked-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }

/* Admin tabs */
.admin-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.admin-tab { padding: 10px 16px; font-weight: 700; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tab.active { color: var(--text); border-bottom-color: var(--silver); }
.admin-tab:hover { color: var(--text); }

/* Admin posts table */
.prow { display: grid; grid-template-columns: 56px minmax(0,1fr) 96px 220px; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.prow:last-child { border-bottom: 0; }
.pthumb { display: block; width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: #000; }
.pthumb img, .pthumb video { width: 100%; height: 100%; object-fit: cover; }
.pcol-info { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.pcaption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcol-act { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.vis-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.vis-public { background: var(--surface-2); color: var(--silver); }
.vis-members { background: #f5c451; color: #0d0d12; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }

@media (max-width: 760px) {
  .prow { grid-template-columns: 48px minmax(0,1fr) 150px; grid-template-areas: "media info act" "media date act"; row-gap: 2px; }
  .prow .pcol-media { grid-area: media; }
  .prow .pcol-info { grid-area: info; }
  .prow .pcol-date { grid-area: date; }
  .prow .pcol-act { grid-area: act; }
  .admin-head .pcol-date { display: none; }
}

/* Settings: collapsible change-password section */
.pw-details { margin-top: 14px; }
.pw-summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 700; font-size: 15px; list-style: none; }
.pw-summary::-webkit-details-marker { display: none; }
.pw-chevron { width: 18px; height: 18px; color: var(--muted); transition: transform .15s; }
.pw-details[open] .pw-chevron { transform: rotate(90deg); }
.pw-form { margin-top: 16px; }

/* Admin: inline password reset (sits on its own line under the row) */
.pw-reset-form { display: flex; gap: 6px; align-items: center; flex: 1 1 100%; margin-top: 6px; }
.pw-reset-form input { flex: 1; min-width: 0; padding: 6px 10px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.pw-reset-form input::placeholder { color: #56565f; }

/* ---------------- Contact / Help page ---------------- */
.contact-wrap { max-width: 520px; margin: 0 auto; }
.contact-card { text-align: center; }
.contact-icon { display: flex; justify-content: center; margin-bottom: 8px; color: var(--silver); }
.contact-icon .ic { width: 40px; height: 40px; }
.contact-card .page-title { margin-bottom: 6px; }
.line-id-box { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 20px 0; }
.line-id-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.line-id { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: .5px; user-select: all; }
