/* ═══════════════════════════════════════════════════════════════
   Shamira v5 — Flat design, mobile-first
   Baloo 2 (headings) · Open Sans (body) · Font Awesome 6
   ═══════════════════════════════════════════════════════════════ */

/* ── Dark theme (default) ────────────────────────────────────── */
:root,
[data-theme="dark"] {
  --bg:        #080810;
  --bg-2:      #0e0e18;
  --surface:   #13131f;
  --surface-2: #1c1c2a;
  --surface-3: #252535;

  --accent:      #A855F7;
  --accent-2:    #9333EA;
  --accent-soft: rgba(168,85,247,.15);
  --accent-glow: rgba(168,85,247,.35);

  --text:   #FAFAFA;
  --text-2: #A8A8A8;
  --text-3: #8A8A9A;

  --border:   #262626;
  --border-2: #363636;

  --like:    #FF3040;
  --like-bg: rgba(255,48,64,.12);

  --success: #22C55E;
  --danger:  #EF4444;
  --warning: #F59E0B;
  --info:    #3B82F6;

  --shadow:    none;
  --shadow-sm: none;
  --shadow-xs: none;

  --topbar-h:    44px;
  --bottomnav-h: 68px;
  --sidebar-w:   244px;
}

/* ── Light theme ────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:        #EDE9FF;
  --bg-2:      #E5E0F8;
  --surface:   #F5F2FF;
  --surface-2: #EDE8FB;
  --surface-3: #E0DAF5;

  --accent:      #7C3AED;
  --accent-2:    #6D28D9;
  --accent-soft: rgba(124,58,237,.10);
  --accent-glow: rgba(124,58,237,.25);

  --text:   #0A0A0A;
  --text-2: #555555;
  --text-3: #757585;

  --border:   #DBDBDB;
  --border-2: #C7C7C7;

  --like:    #E11D48;
  --like-bg: rgba(225,29,72,.10);

  --success: #16A34A;
  --danger:  #DC2626;
  --warning: #D97706;
  --info:    #2563EB;

  --shadow:    none;
  --shadow-sm: none;
  --shadow-xs: none;
}

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --r-xs:   3px;
  --r-sm:   6px;
  --r:      8px;
  --r-lg:   10px;
  --r-xl:   12px;
  --r-2xl:  16px;
  --r-full: 9999px;
  --ease:   cubic-bezier(.4,0,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-tap-highlight-color: transparent;
  height: 100%;
}
button, .btn, [data-action], .forum-back-btn, .page-hd-back, .modal-close,
.notif-detail-close, .act-btn, .comment-reply-btn, .comment-like-btn, .comment-del {
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
body {
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  height: 100%;
  -webkit-font-smoothing: antialiased;
}
html, body, .app-layout, .topbar, .sidebar, .app-content, .page-hd, .profile-header,
.profile-settings-strip, .profile-tabs, .profile-cover, .profile-cover::after,
.post-card, .forum-wrap, .modal-box, .bottom-nav, .sidebar-action, .topbar-btn {
  transition: background-color .25s cubic-bezier(.4,0,.2,1), color .25s cubic-bezier(.4,0,.2,1), border-color .25s cubic-bezier(.4,0,.2,1), box-shadow .25s cubic-bezier(.4,0,.2,1);
}
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  animation: none !important;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font: inherit; }
ul { list-style: none; }

/* Smooth touch scrolling (NOT scroll-behavior — that causes input lag) */
.app-content, .sidebar, .modal-body, .wip-blocks, .forum-thread-replies {
  -webkit-overflow-scrolling: touch;
}
img, video { content-visibility: auto; }

h1, h2, h3, h4, .heading {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

/* ── Boot screen ─────────────────────────────────────────────── */
#boot-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 9999;
  transition: opacity .3s var(--ease);
}
#boot-screen.out { opacity: 0; pointer-events: none; }
.boot-logo {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 68px;
  background: linear-gradient(135deg, #A855F7, #EC4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: bootPulse .9s ease-in-out infinite alternate;
}
@keyframes bootPulse {
  from { opacity: .3; transform: scale(.85); }
  to   { opacity: 1;  transform: scale(1.1); }
}

/* ═══════════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* ── Mobile topbar ──────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding-left: 16px;
  padding-right: 12px;
  gap: 8px;
  z-index: 200;
}
.topbar-logo {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
  flex: 1;
  letter-spacing: -0.5px;
  user-select: none;
}
.nav-logo-icon { height: 36px; width: auto; display: block; border-radius: 10px; margin: 8px 0 12px; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0;
}
.topbar-btn {
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  transition: opacity .12s;
  position: relative;
}
.topbar-btn:active { opacity: .6; }

/* Notification badge */
.notif-badge {
  position: absolute;
  top: 6px; right: 6px;
  min-width: 17px; height: 17px;
  background: var(--danger);
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid var(--bg);
  line-height: 1;
  animation: badgePop .3s var(--spring);
}
.notif-badge:empty { display: none; }

/* Heart beat animation when notifications exist */
.notif-heart-active i {
  animation: heartBeat 1.2s ease-in-out infinite;
  transition: color .4s ease;
}
@keyframes heartBeat {
  0%   { transform: scale(1); }
  14%  { transform: scale(1.22); }
  28%  { transform: scale(1); }
  42%  { transform: scale(1.16); }
  56%  { transform: scale(1); }
  100% { transform: scale(1); }
}
/* Color-cycle pop when type changes */
.notif-heart-active i.notif-color-pop {
  animation: heartBeat 1.2s ease-in-out infinite, notifColorPop .4s ease;
}
@keyframes notifColorPop {
  0%   { filter: brightness(1); }
  40%  { filter: brightness(1.6); }
  100% { filter: brightness(1); }
}
.notif-badge { transition: background .4s ease; }

/* ── Main content ─────────────────────────────────────────── */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-top: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 2px);
}
.content-inner {
  width: 100%;
  max-width: 614px;
  margin: 0 auto;
}

/* ── Page overlay — covers feed so it stays intact underneath ── */
.page-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 150;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-top: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 2px);
  /* Hidden by default — slide up + fade */
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .22s cubic-bezier(.4,0,.2,1), transform .22s cubic-bezier(.4,0,.2,1);
}
.page-overlay.active {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

/* ── Bottom nav ───────────────────────────────────────────────── */
/* ── Bottom nav — edge-to-edge with notch ─────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: 68px;
  background: var(--surface);
  border-top: none;
  padding: 0;
  position: relative;
}
/* Notch line — SVG draws the curved path, no CSS pseudo-elements needed */
.nav-notch-svg {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}
.notch-border-path { stroke-width: 1.5; fill: none; }
.notch-glow-path   { stroke-width: 3; fill: none; opacity: .45; }
.notch-stop-a  { stop-color: var(--accent); }
.notch-stop-a2 { stop-color: var(--accent-2); }

/* ── Nav item — depth press ── */
.b-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  padding: 6px 0 10px;
  transition: color .2s;
  border-radius: 0;
}
.b-nav-item i {
  font-size: 24px;
  line-height: 1;
  position: relative;
  z-index: 1;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), color .2s;
}
.b-nav-item span:not(.notif-badge) { display: none; }

/* ── Tap — press INTO the bar ── */
.b-nav-item::before {
  content: '';
  position: absolute;
  top: 10px; bottom: 8px;
  left: 12%; right: 12%;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  transition: background .12s, box-shadow .25s cubic-bezier(.34,1.56,.64,1), transform .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.b-nav-item:active::before {
  background: color-mix(in srgb, var(--text) 5%, transparent);
  box-shadow: inset 0 3px 8px rgba(0,0,0,.1), inset 0 1px 2px rgba(0,0,0,.06);
}
.b-nav-item:active i {
  transform: scale(.78) translateY(2px);
  transition-duration: .1s;
}

/* ── Active state ── */
.b-nav-item.active { color: var(--accent); }
.b-nav-item.active i { font-weight: 900; }
/* Gradient pill under active icon */
.b-nav-item::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 0;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: translateX(-50%);
  transition: width .35s cubic-bezier(.34,1.56,.64,1);
}
.b-nav-item.active::after { width: 22px; }
/* Soft glow behind active icon */
.b-nav-item.active i::after {
  content: '';
  position: absolute;
  inset: -10px -14px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  z-index: -1;
  animation: bNavGlowIn .4s ease both;
}

/* ── Profile avatar in bottom nav ── */
.b-nav-avatar {
  width: 28px; height: 28px;
  border-radius: var(--r-full);
  object-fit: cover;
  border: 2.5px solid transparent;
  position: relative;
  z-index: 1;
  transition: border-color .2s, transform .35s cubic-bezier(.34,1.56,.64,1);
}
.b-nav-item:active .b-nav-avatar { transform: scale(.78) translateY(2px); }
.b-nav-item.active .b-nav-avatar { border-color: var(--accent); }
.b-nav-avatar-ph {
  width: 28px; height: 28px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--accent);
  border: 2.5px solid transparent;
  position: relative;
  z-index: 1;
  transition: border-color .2s, transform .35s cubic-bezier(.34,1.56,.64,1);
}
.b-nav-item:active .b-nav-avatar-ph { transform: scale(.78) translateY(2px); }
.b-nav-item.active .b-nav-avatar-ph { border-color: var(--accent); }

/* ── Create button — centered on bar's top border so its border
      becomes the bar's border curving around the button ── */
.b-nav-create {
  width: 50px; height: 50px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 20px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  /* Center button exactly on bar's top edge: -(height/2) */
  margin-top: -25px;
  position: relative;
  z-index: 2;
  box-shadow: none;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  isolation: isolate;
}
/* Surface fill ring behind button — same bg as menu bar */
.b-nav-create::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: var(--r-full);
  background: var(--surface);
  z-index: -1;
}
/* Tap — press in + rotate */
.b-nav-create:active {
  transform: scale(.82) rotate(90deg);
}

/* ── Desktop sidebar ─────────────────────────────────────────── */
.sidebar {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  border-right: 1px solid var(--border);
  flex-direction: column;
  padding: 16px 12px;
  z-index: 200;
}
.sidebar-logo {
  padding: 16px 12px 28px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: #fff;
  cursor: pointer;
  user-select: none;
}
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.s-nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 12px;
  border-radius: var(--r);
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  transition: background .15s var(--ease), transform .15s var(--ease);
  user-select: none;
}
.s-nav-item i { width: 22px; text-align: center; font-size: 22px; transition: transform .15s var(--spring); }
.s-nav-item:hover { background: var(--surface-2); }
.s-nav-item:active { transform: scale(.97); }
.s-nav-item:active i { transform: scale(.9); }
.s-nav-item.active { font-weight: 700; }
.s-nav-badge {
  position: static;
  margin-left: auto;
  min-width: 20px; height: 20px;
  background: var(--danger);
  border-radius: var(--r-full);
  font-size: 11px;
  border: none;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.s-nav-badge:empty { display: none; }
.sidebar-create { margin: 8px 0; }
.sidebar-create .btn { width: 100%; border-radius: var(--r-sm); font-size: 15px; }
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 0; }
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .12s;
}
.sidebar-user:hover { background: var(--surface-2); }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role { font-size: 13px; color: var(--text-3); }
.sidebar-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px;
  border-radius: var(--r);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s;
}
.sidebar-action:hover { background: var(--surface-2); color: var(--text); }
.sidebar-action.danger:hover { background: rgba(239,68,68,.10); color: var(--danger); }
.sidebar-action i { width: 22px; text-align: center; font-size: 20px; }

/* ── Page header ─────────────────────────────────────────────── */
.page-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}
.page-hd-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 20px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-hd-back {
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  flex-shrink: 0;
}
.page-hd-back:active { opacity: .6; }

/* ── Album header buttons (responsive) ── */
.album-hd-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 6px 10px;
}
.album-hd-btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
@media (max-width: 420px) {
  .album-hd-label { display: none; }
  .album-hd-btn { padding: 6px 9px; min-width: 32px; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════
   FORMS & INPUTS
   ═══════════════════════════════════════════════════════════════ */
.field { margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: .7px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  color: var(--text);
  font-size: 15px;
  font-family: 'Open Sans', sans-serif;
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  appearance: none;
}
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-input::placeholder { color: var(--text-3); }
textarea.field-input { resize: vertical; min-height: 88px; }
.password-field-wrap {
  position: relative;
}
.password-field-wrap .password-field-input {
  padding-right: 46px;
}
.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.password-toggle-btn:hover {
  color: var(--accent-strong, var(--accent));
  background: var(--accent-soft);
}
.password-toggle-btn[aria-pressed="true"] {
  color: var(--accent-strong, var(--accent));
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04) inset;
}
.password-toggle-btn:focus {
  outline: none;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 20px;
  border-radius: var(--r);
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s var(--ease), opacity .15s, background .15s;
  white-space: nowrap;
  border: none;
  outline: none;
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); opacity: .85; }
.btn:disabled { opacity: .4; pointer-events: none; transform: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-outline:hover { background: var(--surface-2); }

.btn-danger { background: rgba(239,68,68,.12); color: var(--danger); }

.btn-sm  { padding: 8px 14px; font-size: 13px; min-height: 40px; }
.btn-xs  { padding: 6px 10px; font-size: 12px; min-height: 34px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 44px; height: 44px;
  padding: 0;
  border-radius: var(--r-full);
  flex-shrink: 0;
  min-height: unset;
}
.btn-icon-sm { width: 38px; height: 38px; font-size: 15px; }

/* ═══════════════════════════════════════════════════════════════
   AVATAR
   ═══════════════════════════════════════════════════════════════ */
.avatar {
  border-radius: var(--r-full);
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
  display: block;
}
.avatar-ph {
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #A855F7, #EC4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Baloo 2', sans-serif;
  color: white;
  flex-shrink: 0;
  user-select: none;
}

/* ── Animated role rings for small avatars ─────────────────── */
.av-ring-admin,
.av-ring-moderator,
.av-ring-gunnar {
  display: inline-flex;
  border-radius: var(--r-full);
  padding: 2px;
  flex-shrink: 0;
}
.av-ring-admin {
  background: linear-gradient(270deg, #f59e0b, #a855f7, #ec4899, #f59e0b);
  background-size: 300% 100%;
  animation: badge-gradient-flow 3s linear infinite;
}
.av-ring-moderator {
  background: linear-gradient(270deg, #06b6d4, #3b82f6, #8b5cf6, #06b6d4);
  background-size: 300% 100%;
  animation: badge-gradient-flow 3s linear infinite;
}
.av-ring-gunnar {
  background: linear-gradient(270deg, #22c55e, #10b981, #34d399, #22c55e);
  background-size: 300% 100%;
  animation: badge-gradient-flow 3s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGE — No card, content floats on animated gradient
   ═══════════════════════════════════════════════════════════════ */
.auth-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(140deg, #0a0118 0%, #110a2e 40%, #0d1a30 70%, #0a0118 100%);
}
.auth-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 55%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 55%);
  pointer-events: none;
  z-index: 1;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Animated orbs — static blurred backgrounds, no continuous animation to avoid input lag */
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .35;
  mix-blend-mode: screen;
  will-change: transform;
}
.auth-orb-1 {
  width: 500px; height: 500px;
  top: -15%; right: -8%;
  background: radial-gradient(circle, rgba(236,72,153,.5), transparent 70%);
}
.auth-orb-2 {
  width: 600px; height: 600px;
  left: -15%; bottom: -15%;
  background: radial-gradient(circle, rgba(59,130,246,.4), transparent 70%);
}
.auth-orb-3 {
  width: 400px; height: 400px;
  left: 25%; top: 10%;
  background: radial-gradient(circle, rgba(168,85,247,.4), transparent 70%);
}
.auth-orb-4 {
  width: 300px; height: 300px;
  right: 15%; bottom: 15%;
  background: radial-gradient(circle, rgba(16,185,129,.25), transparent 70%);
}

/* Floating particles — GPU-composited (transform+opacity only) */
.auth-aurora {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
  filter: blur(24px);
  opacity: .5;
  will-change: transform;
}
.auth-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  contain: strict;
}
.auth-particle {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  will-change: transform, opacity;
  animation: authParticleFloat linear infinite, authParticleGlimmer ease-in-out infinite;
  box-shadow: 0 0 4px rgba(255,255,255,.3);
}
.auth-particle:nth-child(1)  { left: 10%; animation-duration: 18s, 3s; animation-delay: 0s, 0s; }
.auth-particle:nth-child(2)  { left: 20%; animation-duration: 22s, 2.5s; animation-delay: -3s, -1s; width: 2px; height: 2px; }
.auth-particle:nth-child(3)  { left: 35%; animation-duration: 16s, 3.5s; animation-delay: -6s, -2s; }
.auth-particle:nth-child(4)  { left: 50%; animation-duration: 24s, 4s; animation-delay: -2s, -0.5s; width: 4px; height: 4px; }
.auth-particle:nth-child(5)  { left: 65%; animation-duration: 20s, 2.8s; animation-delay: -8s, -1.5s; width: 2px; height: 2px; }
.auth-particle:nth-child(6)  { left: 75%; animation-duration: 17s, 3.2s; animation-delay: -4s, -2.5s; }
.auth-particle:nth-child(7)  { left: 88%; animation-duration: 21s, 2.6s; animation-delay: -10s, -0.8s; width: 2px; height: 2px; }
.auth-particle:nth-child(8)  { left: 45%; animation-duration: 19s, 3.8s; animation-delay: -12s, -1.2s; }
.auth-particle:nth-child(9)  { left: 5%;  animation-duration: 25s, 2.4s; animation-delay: -7s, -3s; width: 2px; height: 2px; }
.auth-particle:nth-child(10) { left: 92%; animation-duration: 15s, 3.6s; animation-delay: -1s, -0.3s; }
.auth-particle:nth-child(11) { left: 55%; animation-duration: 20s, 2.9s; animation-delay: -5s, -1.8s; width: 3px; height: 3px; }
.auth-particle:nth-child(12) { left: 80%; animation-duration: 23s, 3.3s; animation-delay: -9s, -2.2s; width: 2px; height: 2px; }
@keyframes authParticleGlimmer {
  0%, 100% { opacity: .2; box-shadow: 0 0 2px rgba(255,255,255,.1); }
  50% { opacity: 1; box-shadow: 0 0 8px rgba(255,255,255,.6), 0 0 16px rgba(168,85,247,.3); }
}
/* Pause particles when user is typing — zero GPU cost during input */

/* Decorative rings */
.auth-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.025);
  pointer-events: none;
}
.auth-ring-1 {
  width: 700px; height: 700px;
  top: -250px; right: -250px;
}
.auth-ring-2 {
  width: 500px; height: 500px;
  bottom: -150px; left: -150px;
  border-style: dashed;
  border-color: rgba(255,255,255,.02);
}

/* Content container — no card, just centered content */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  opacity: 0;
  animation: authContentIn .7s cubic-bezier(.16,1,.3,1) .1s forwards;
}
.auth-card::before,
.auth-card::after { display: none; }
.auth-card-glow { display: none; }

.auth-card-inner {
  position: relative;
  z-index: 1;
  padding: 0;
}

/* Brand */
.auth-brand {
  text-align: center;
  margin-bottom: 20px;
}
.auth-brand-kicker {
  font-family: 'Baloo 2', sans-serif;
  font-size: 22px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  color: rgba(255,255,255,.85);
  margin-top: 14px;
  margin-bottom: 14px;
  text-shadow: 0 0 20px rgba(168,85,247,.2);
}
.auth-brand-logo {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 64px;
  background: linear-gradient(135deg, #ffffff 0%, #e8c8ff 35%, #ffc8e0 65%, #ffffff 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  letter-spacing: -.02em;
  animation: authLogoShimmer 9s ease infinite;
  filter: drop-shadow(0 0 20px rgba(168,85,247,.18));
}
.auth-brand-logo-icon { height: 100px; width: auto; display: block; margin: 0 auto 0; border-radius: 20px; filter: drop-shadow(0 0 20px rgba(168,85,247,.18)); }
.auth-brand-tagline {
  font-size: 15px;
  color: rgba(255,255,255,.5);
  margin-top: 12px;
  letter-spacing: .02em;
}

/* Tabs */
.auth-tabs {
  display: flex;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  margin-top: 20px;
  margin-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.auth-tab {
  flex: 1;
  padding: 12px 10px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,.45);
  text-align: center;
  cursor: pointer;
  border-radius: 13px;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
  position: relative;
}
.auth-tab:hover { color: rgba(255,255,255,.7); }
.auth-tab.active {
  color: #fff;
  background: rgba(255,255,255,.1);
  box-shadow: 0 2px 12px rgba(168,85,247,.15);
}

/* Form */
.auth-form-stage {
  color: #fff;
}
.auth-form-stage .field-label {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 16px;
  padding-left: 6px;
}
.auth-form-stage .field-input,
.auth-form-stage .btn {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
}
.auth-field-error {
  font-family: 'Baloo 2', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #f0a0b0;
  margin-top: 6px;
  padding-left: 6px;
  animation: authErrFade .3s ease;
}
.auth-form-stage .field-input:invalid,
.auth-form-stage .field-input:user-invalid {
  border-color: var(--border) !important;
  box-shadow: none !important;
  outline: none !important;
}
.auth-form-stage .field-input:-moz-ui-invalid {
  border-color: var(--border) !important;
  box-shadow: none !important;
  outline: none !important;
}
@keyframes authErrFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-form-intro {
  margin-bottom: 12px;
}
#auth-form-wrap {
  position: relative;
}
#auth-form-wrap > * {
  animation: authFormFade .25s ease both;
}
@keyframes authFormFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.auth-form-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: rgba(255,255,255,.4);
  margin-bottom: 6px;
}
.auth-form-title,
.auth-state-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 30px;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.auth-form-copy,
.auth-state-copy {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255,255,255,.55);
}

.auth-form-stage .field {
  margin-bottom: 18px;
}
.auth-form-stage .field-label {
  color: rgba(255,255,255,.5);
  letter-spacing: .12em;
  font-size: 11px;
}
.auth-form-stage .field-input {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
  color: #fff;
  border-radius: 14px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.auth-form-stage .field-input::placeholder {
  color: rgba(255,255,255,.3);
}
.auth-form-stage .field-input:focus {
  border-color: rgba(168,85,247,.4);
  box-shadow: 0 0 0 3px rgba(168,85,247,.1), 0 0 30px rgba(168,85,247,.08);
  background: rgba(255,255,255,.10);
}
.auth-form-stage #rg-suggestions {
  color: rgba(255,255,255,.6);
}
.auth-form-stage #rg-suggestions .btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff;
  border-radius: 999px;
}

/* Primary button on auth — subtle glass pill */
.auth-form-stage .btn-primary {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.14);
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.auth-form-stage .btn-primary:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.25);
  box-shadow: 0 4px 32px rgba(168,85,247,.2);
  transform: translateY(-1px);
}

.auth-inline-action {
  text-align: center;
  margin-top: 16px;
}
.auth-link-btn,
.auth-theme-btn {
  color: rgba(255,255,255,.5) !important;
  transition: all .2s;
}
.auth-link-btn {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 15px;
}
.auth-link-btn:hover,
.auth-theme-btn:hover {
  color: rgba(255,255,255,.85) !important;
  text-shadow: 0 0 16px rgba(168,85,247,.3);
}
.auth-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 0;
  border-top: none;
}

/* States (verify/forgot success) */
.auth-state {
  text-align: center;
  padding: 16px 4px 8px;
  color: #fff;
}
.auth-state-icon {
  font-size: 58px;
  line-height: 1;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 20px rgba(168,85,247,.25));
}
.auth-state-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.55);
  font-size: 13px;
  line-height: 1.65;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.auth-state strong,
.auth-form-copy strong,
.auth-state-copy strong {
  color: #fff;
}
.auth-state .auth-brand-logo {
  font-size: 50px;
}

/* ── Light theme overrides ── */
[data-theme="light"] .auth-wrap {
  background: linear-gradient(
    135deg,
    #e8dff5 0%,
    #d4c4f0 12%,
    #c9b8eb 24%,
    #bdd4f0 38%,
    #d0e4f7 50%,
    #d9c2ed 62%,
    #f0c6dd 74%,
    #d4b8e8 86%,
    #e8dff5 100%
  );
  background-size: 400% 400%;
}
[data-theme="light"] .auth-wrap::before {
  background-image:
    linear-gradient(rgba(0,0,0,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.08) 1px, transparent 1px);
}
[data-theme="light"] .auth-orb { opacity: .18; filter: blur(40px); }
[data-theme="light"] .auth-particle { background: rgba(91,33,182,.2); }
[data-theme="light"] .auth-ring { border-color: rgba(91,33,182,.04); }
[data-theme="light"] .auth-ring-2 { border-color: rgba(91,33,182,.03); }
[data-theme="light"] .auth-tabs,
[data-theme="light"] .auth-state-note {
  background: rgba(255,255,255,.35);
  border-color: rgba(255,255,255,.45);
}
[data-theme="light"] .auth-tab { color: rgba(36,22,63,.5); }
[data-theme="light"] .auth-tab.active {
  color: #24163f;
  background: rgba(255,255,255,.5);
}
[data-theme="light"] .auth-form-title,
[data-theme="light"] .auth-state-title {
  color: #1a0e3a;
  text-shadow: 0 2px 16px rgba(91,33,182,.1);
}
[data-theme="light"] .auth-state,
[data-theme="light"] .auth-form-stage {
  color: #1a0e3a;
}
[data-theme="light"] .auth-brand-tagline,
[data-theme="light"] .auth-form-copy,
[data-theme="light"] .auth-state-copy,
[data-theme="light"] .auth-state-note,
[data-theme="light"] .auth-brand-kicker,
[data-theme="light"] .auth-form-eyebrow {
  color: rgba(36,22,63,.55);
}
[data-theme="light"] .auth-state strong,
[data-theme="light"] .auth-form-copy strong,
[data-theme="light"] .auth-state-copy strong {
  color: #1a0e3a;
}
[data-theme="light"] .auth-link-btn,
[data-theme="light"] .auth-theme-btn {
  color: rgba(36,22,63,.5) !important;
}
[data-theme="light"] .auth-link-btn:hover,
[data-theme="light"] .auth-theme-btn:hover {
  color: #1a0e3a !important;
}
[data-theme="light"] .auth-brand-logo {
  background: linear-gradient(135deg, #5b21b6 0%, #db2777 50%, #5b21b6 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: authLogoShimmer 5s ease infinite;
  filter: none;
}
[data-theme="light"] .auth-form-stage .field-label {
  color: rgba(36,22,63,.5);
}
[data-theme="light"] .auth-form-stage .field-input {
  background: rgba(255,255,255,.45);
  border-color: rgba(255,255,255,.55);
  color: #1a0e3a;
}
[data-theme="light"] .auth-form-stage .field-input::placeholder {
  color: rgba(36,22,63,.3);
}
[data-theme="light"] .auth-form-stage .field-input:focus {
  border-color: rgba(91,33,182,.3);
  box-shadow: 0 0 0 3px rgba(91,33,182,.06), 0 0 20px rgba(91,33,182,.05);
  background: rgba(255,255,255,.55);
}
[data-theme="light"] .auth-form-stage .btn-primary {
  background: rgba(255,255,255,.4);
  border-color: rgba(255,255,255,.6);
  color: #1a0e3a;
}
[data-theme="light"] .auth-form-stage .btn-primary:hover {
  background: rgba(255,255,255,.55);
  box-shadow: 0 4px 24px rgba(91,33,182,.1);
}
[data-theme="light"] .auth-form-stage #rg-suggestions .btn {
  background: rgba(255,255,255,.45);
  border-color: rgba(91,33,182,.08);
  color: #1a0e3a;
}

/* ── Auth keyframes ── */
@keyframes authOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(-30px, 20px) scale(1.08); }
  66%  { transform: translate(15px, -15px) scale(.95); }
}
@keyframes authOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(25px, -20px) scale(1.05); }
  66%  { transform: translate(-10px, 25px) scale(.97); }
}
@keyframes authOrb3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-20px, -25px) scale(1.1); }
}
@keyframes authParticleFloat {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 1; transform: translateY(90vh) scale(1); }
  90%  { opacity: 1; }
  100% { transform: translateY(-10vh) scale(0); opacity: 0; }
}
@keyframes authParticlePulse {
  0%, 100% { opacity: .15; }
  50%      { opacity: .4; }
}
@keyframes authLogoShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes authContentIn {
  0%   { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: none; }
}
@keyframes authRingSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .auth-wrap { padding: 12px; }
  .auth-brand-logo { font-size: 44px; }
  .auth-brand { margin-bottom: 12px; }
  .auth-brand-kicker { margin-bottom: 8px; }
  .auth-brand-tagline { font-size: 13px; margin-top: 6px; }
  .auth-form-stage .field { margin-bottom: 12px; }
  .auth-ring,
  .auth-orb-4 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   STORIES BAR
   ═══════════════════════════════════════════════════════════════ */
.stories-bar {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 8px;
  background: var(--surface);
  border-radius: var(--r-lg);
  margin: 8px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.stories-bar::-webkit-scrollbar { display: none; }
.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.story-ring {
  padding: 2px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #F97316, #EC4899, #A855F7);
}
.story-ring.seen {
  background: var(--border);
}
.story-ring-inner {
  padding: 2px;
  border-radius: var(--r-full);
  background: var(--bg);
}
.story-av {
  width: 60px; height: 60px;
  border-radius: var(--r-full);
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}
.story-av-ph {
  width: 60px; height: 60px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #A855F7, #EC4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: white;
}
.story-name {
  font-size: 12px;
  color: var(--text-2);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
/* Your story item */
.story-own .story-ring {
  background: var(--border);
}
.story-add-icon {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 20px; height: 20px;
  background: var(--accent);
  border-radius: var(--r-full);
  border: 2px solid var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-weight: 700;
}
.story-av-wrap {
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   POST CARD — flat, full-width
   ═══════════════════════════════════════════════════════════════ */
.post-card {
  background: var(--surface);
  border-radius: 0;
  margin: 0;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  animation: slideIn .28s var(--ease) both;
  contain: content;
}
[data-theme="light"] .post-card { box-shadow: none; }
.post-highlight {
  animation: postPulse 2s ease forwards;
}
@keyframes postPulse {
  0%   { background: rgba(124,58,237,.15); }
  40%  { background: rgba(124,58,237,.06); }
  100% { background: var(--surface); }
}

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}
.post-meta { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; }
.post-username {
  font-family: 'Baloo 2', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-username:hover { opacity: .7; }
.post-location {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 1px;
}
/* Pinned post indicator */
.post-pin-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.post-pinned { border-top: 2px solid var(--accent); }

/* Post menu items (in modal) */
.post-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  font-size: 15px;
  transition: background .1s;
}
.post-menu-item:active { background: var(--surface-2); }
.post-menu-item.danger { color: var(--danger); }
.post-menu-item i { width: 20px; text-align: center; }

/* Three-dot menu button */
.post-menu-btn {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: var(--r-full);
}
.post-menu-btn:active { opacity: .5; }

/* Post image — full width, natural aspect ratio */
.post-img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--surface-2);
}
.post-video {
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
  object-fit: contain;
  opacity: 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}
/* Post thumbnail grid (multi-image) */
.post-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px 4px;
}
.post-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 72px; height: 72px;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), opacity .15s;
  box-shadow: 0 1px 6px rgba(0,0,0,.1);
  border: 2px solid var(--border);
}
.post-thumb:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 16px rgba(124,58,237,.18);
  border-color: var(--accent);
}
.post-thumb:active {
  transform: scale(.97);
}
.post-thumb-media {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.post-thumb-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35);
  color: #fff; font-size: 16px;
  border-radius: 14px;
}

/* Gallery viewer nav */
.img-viewer-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,.15);
  border: none; color: #fff;
  font-size: 18px; cursor: pointer;
  z-index: 410;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s, background .15s;
}
.img-viewer.open .img-viewer-nav { opacity: 1; }
.img-viewer-nav:hover { background: rgba(255,255,255,.3); }
.img-viewer-prev { left: 16px; }
.img-viewer-next { right: 16px; }
.img-viewer-media {
  display: flex; align-items: center; justify-content: center;
  max-width: 92vw; max-height: 85vh;
}
.img-viewer-counter {
  position: absolute;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.8);
  font-size: 14px; font-weight: 600;
  background: rgba(0,0,0,.5);
  padding: 4px 14px;
  border-radius: var(--r-full);
  opacity: 0; transition: opacity .25s;
}
.img-viewer.open .img-viewer-counter { opacity: 1; }

/* Create post multi-preview */
.cp-previews {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.cp-preview-main {
  position: relative;
  width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cp-preview-main img,
.cp-preview-main video {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--r-lg);
  display: block;
}
.cp-preview-thumb {
  position: relative;
  width: 72px; height: 72px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.cp-preview-thumb img,
.cp-preview-thumb video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.cp-preview-rm {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,.7);
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  border: none; color: #fff;
  font-size: 11px; cursor: pointer;
  z-index: 2;
  opacity: 0; transition: opacity .15s;
}
.cp-preview-main:hover .cp-preview-rm,
.cp-preview-thumb:hover .cp-preview-rm { opacity: 1; }

/* Caption text */
.post-body {
  padding: 0 16px 4px;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Action bar (Instagram-style) ───────────────────────────── */
.post-actions {
  display: flex;
  align-items: center;
  padding: 6px 8px 4px;
}
.post-act-left {
  display: flex;
  align-items: center;
  flex: 1;
}
.act-btn {
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  border-radius: var(--r-full);
  transition: transform .18s var(--spring);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-width: 40px;
  min-height: 40px;
}
.act-btn:active { transform: scale(.8); }
.act-btn.liked,
.act-btn.liked .like-icon,
.act-btn.liked .like-icon i {
  color: var(--like) !important;
}
.act-btn-bookmark {
  margin-left: auto;
}

/* Post footer */
.post-footer { padding: 0 16px 12px; }
.post-like-count {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 5px;
}
.post-caption {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 4px;
  word-break: break-word;
  white-space: pre-wrap;
}
.post-caption strong {
  font-weight: 700;
  cursor: pointer;
  margin-right: 4px;
}
.post-caption strong:hover { opacity: .7; }
.post-caption a,
.comment-text a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  font-weight: 600;
  transition: color .12s ease, opacity .12s ease;
}
.post-caption a:hover,
.comment-text a:hover {
  color: var(--accent-2);
}
.yt-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 8px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.yt-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}

.post-comment-link {
  font-size: 15px;
  color: var(--text-3);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  font-family: 'Open Sans', sans-serif;
  display: block;
  margin-bottom: 3px;
  transition: color .12s;
}
.post-comment-link:hover { color: var(--text-2); }
.post-timestamp {
  font-size: 13px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 5px;
}

/* ── Create bar ──────────────────────────────────────────────── */
.create-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.create-bar:active { background: var(--surface-2); }
.create-bar-ph {
  flex: 1;
  font-size: 15px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 8px 16px;
}

/* ═══════════════════════════════════════════════════════════════
   COMMENTS
   ═══════════════════════════════════════════════════════════════ */
.comments-wrap {
  background: var(--surface);
  border-top: none;
}
.comment-item {
  display: flex;
  gap: 10px;
  padding: 6px 16px;
  align-items: flex-start;
  animation: slideIn .22s var(--ease) both;
  border-radius: 10px;
  transition: background .25s var(--ease);
}
.comment-highlight {
  animation: commentPulse 2s ease forwards;
}
@keyframes commentPulse {
  0%   { background: rgba(124,58,237,.18); }
  40%  { background: rgba(124,58,237,.08); }
  100% { background: transparent; }
}
.comment-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.comment-menu-wrap {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 5;
}
.comment-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: .45;
  transition: opacity .15s, background .15s;
}
[data-theme="dark"] .comment-menu-btn { color: #ccc; }
[data-theme="light"] .comment-menu-btn { color: #666; }
.comment-menu-btn:hover,
.comment-menu-btn:focus { opacity: 1; }
[data-theme="dark"] .comment-menu-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
[data-theme="light"] .comment-menu-btn:hover { color: #111; background: rgba(0,0,0,.08); }
.comment-menu-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  min-width: 130px;
  padding: 4px 0;
  z-index: 10;
}
.comment-menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.comment-menu-dropdown button:hover {
  background: var(--surface-2);
  color: var(--danger);
}
@media (max-width: 480px) {
  .comment-menu-dropdown { min-width: 110px; }
  .comment-menu-dropdown button { padding: 10px 12px; }
}
.comment-username {
  font-family: 'Baloo 2', sans-serif;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 3px;
  line-height: 1.3;
}
.comment-username:hover { opacity: .7; }
.comment-text {
  position: relative;
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
  background: var(--surface-2);
  border-radius: 0 16px 16px 16px;
  padding: 10px 14px;
}
.comment-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  margin-left: -6px;
}
.comment-time { font-size: 12px; color: var(--text-3); padding: 6px 4px; }
.comment-del {
  color: var(--text-3);
  cursor: pointer;
  font-size: 12px;
  padding: 6px 8px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-xs);
  opacity: 0;
  transition: opacity .12s;
}
.comment-item:hover .comment-del { opacity: 1; }
@media (hover: none) { .comment-del { opacity: .7; } }
.comment-del:hover { color: var(--danger); }
.comment-form {
  display: flex;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
}
.comment-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.comment-textarea {
  width: 100%;
  box-sizing: border-box;
  display: block;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 16px 16px 0 0;
  border-bottom: none;
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  outline: none;
  resize: none;
  max-height: 140px;
  overflow: hidden;
  line-height: 1.5;
  font-family: 'Open Sans', sans-serif;
  transition: border-color .15s;
}
.comment-textarea:focus { border-color: var(--accent); }
.comment-textarea::placeholder { color: var(--text-3); }
.comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 0 0 16px 16px;
  transition: border-color .15s;
}
.comment-textarea:focus ~ .comment-form-footer,
.comment-input-wrap:focus-within .comment-form-footer {
  border-color: var(--accent);
  border-top-color: var(--border);
}
.comment-img-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-3);
  cursor: pointer;
  font-size: 15px;
  transition: color .15s, background .15s;
}
.comment-img-btn input[type="file"] { display: none; }
.comment-img-btn:hover { color: var(--accent); background: var(--accent-soft); }
.comment-send-btn {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  padding: 5px 14px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  border: none;
  transition: background .15s, color .15s, opacity .12s;
  white-space: nowrap;
}
.comment-send-btn:hover { background: var(--accent); color: #fff; }
.comment-send-btn:disabled { opacity: .4; pointer-events: none; }

/* Image preview in comment form */
.comment-img-preview {
  margin-top: 8px;
}
.comment-img-preview.hidden { display: none; }
.comment-img-preview-inner {
  position: relative;
  display: inline-block;
}
.comment-img-preview-inner img {
  display: block;
  max-width: 160px;
  max-height: 140px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  object-fit: cover;
}
.comment-img-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: background .15s;
}
.comment-img-remove:hover { background: rgba(0,0,0,.9); }

/* Image inside a comment bubble */
.comment-img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 400px;
  border-radius: 10px;
  margin-top: 8px;
  object-fit: cover;
  cursor: pointer;
}

/* Old comment-bubble compat */
.comment-bubble { flex: 1; min-width: 0; }
.comment-uname {
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
  margin-right: 4px;
}
.comment-uname:hover { opacity: .7; }

/* ═══════════════════════════════════════════════════════════════
   PROFILE PAGE — Instagram layout
   ═══════════════════════════════════════════════════════════════ */
.profile-header {
  padding: 12px 16px 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-top-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}
.profile-identity {
  padding-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.profile-av-wrap {
  position: relative;
  flex-shrink: 0;
  margin-top: -34px;
  z-index: 3;
}
.profile-av-ring {
  padding: 2px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #F97316, #EC4899, #A855F7);
  display: inline-block;
}
.profile-av-ring.no-posts {
  background: var(--border);
}
.profile-av-ring.profile-av-ring-admin {
  background: linear-gradient(270deg, #f59e0b, #a855f7, #ec4899, #f59e0b);
  background-size: 300% 100%;
  animation: badge-gradient-flow 3s linear infinite;
}
.profile-av-ring.profile-av-ring-moderator {
  background: linear-gradient(270deg, #06b6d4, #3b82f6, #8b5cf6, #06b6d4);
  background-size: 300% 100%;
  animation: badge-gradient-flow 3s linear infinite;
}
.profile-av-ring.profile-av-ring-gunnar {
  background: linear-gradient(270deg, #22c55e, #10b981, #34d399, #22c55e);
  background-size: 300% 100%;
  animation: badge-gradient-flow 3s linear infinite;
}
.profile-av-ring-inner {
  padding: 2px;
  border-radius: var(--r-full);
  background: var(--bg);
  display: block;
}
.profile-av-edit {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 28px; height: 28px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  border: 1.5px solid var(--bg);
  font-size: 11px;
}

/* Clickable avatar wrapper (own profile) */
.profile-av-wrap-label {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: 50%;
}
.profile-av-wrap-label:hover .profile-av-ring,
.profile-av-wrap-label:active .profile-av-ring {
  opacity: .85;
}
.av-camera-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  border: 2.5px solid var(--bg);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  pointer-events: none;
  transition: transform .15s;
}
.profile-av-wrap-label:hover .av-camera-badge {
  transform: scale(1.1);
}
/* Profile cover photo (Facebook-style) */
.profile-cover {
  width: 100%;
  height: 190px;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
  background-color: var(--surface-2);
  box-shadow: inset 0 -2px 0 var(--bg);
}
.profile-cover::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 88px;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0) 48%,
    var(--bg-2) 82%,
    var(--bg) 100%
  );
  pointer-events: none;
  z-index: 1;
}
.profile-cover-edit {
  position: absolute;
  bottom: 54px;
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.14);
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.profile-cover-edit:hover { background: rgba(0,0,0,.68); border-color: rgba(255,255,255,.22); }
.profile-cover-edit:active { opacity: .7; }
.profile-cover-adjust {
  position: absolute;
  bottom: 54px;
  left: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 38px;
  background: rgba(0,0,0,.52);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.14);
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
  -webkit-tap-highlight-color: rgba(124,58,237,.3);
  touch-action: manipulation;
}
.profile-cover-adjust:hover { background: rgba(0,0,0,.75); }
.profile-cover-adjust:active { background: rgba(0,0,0,.8); }

/* Cover position editor — inline (on the cover itself) */
.profile-cover.editing {
  cursor: grab;
  z-index: 10;
}
.profile-cover.editing.dragging { cursor: grabbing; }

.cover-edit-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: fadeIn .2s var(--ease);
  pointer-events: none;
  z-index: 2;
}
.cover-edit-hint {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: var(--r-full);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.cover-edit-actions {
  position: absolute;
  bottom: 10px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 3;
  pointer-events: auto;
  animation: fadeUp .2s var(--ease);
}
.cover-edit-actions .btn {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 13px;
  padding: 7px 16px;
  min-height: 34px;
  border-radius: var(--r-full);
}
.cover-edit-actions .btn-ghost {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
}
.cover-edit-actions .btn-ghost:hover { background: rgba(255,255,255,.25); }

/* Legacy modal cover editor — keep for fallback */
.cover-editor {
  padding: 0;
  overflow: hidden;
  border-radius: var(--r-xl);
  min-width: min(480px, calc(100vw - 32px));
}
.cover-editor-hd {
  padding: 18px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-bottom: 1px solid var(--border);
}
.cover-editor-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.cover-editor-preview {
  width: 100%;
  aspect-ratio: 16 / 5;
  background-color: var(--surface-3);
  background-repeat: no-repeat;
  user-select: none;
  -webkit-user-drag: none;
}
.cover-editor-footer {
  padding: 14px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
}
@media (min-width: 768px) {
  .profile-cover { height: 280px; }
  .profile-av-wrap { margin-top: -42px; }
}

/* ── Cover text overlay ─────────────────────────────────────── */
.cover-text-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  text-align: center;
  transform: translate(-50%, -50%);
  left: 50%; top: 30%;
}
.cover-text-content {
  font-size: clamp(16px, 3.5vw, 30px);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 6px 16px;
  border-radius: 10px;
  display: inline-block;
  overflow: hidden;
}
/* Draggable text in editor preview */
.cte-draggable { pointer-events: auto; cursor: grab; touch-action: none; }
.cte-draggable:active { cursor: grabbing; }
.cte-drag-hint {
  position: absolute;
  bottom: 6px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(255,255,255,.7);
  background: rgba(0,0,0,.45);
  padding: 3px 10px;
  border-radius: var(--r-full);
  pointer-events: none;
  display: flex; align-items: center; gap: 5px;
}
.cte-size-badge {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  padding: 3px 10px;
  border-radius: var(--r-full);
  pointer-events: none;
  z-index: 12;
  transition: opacity .2s;
}
.cte-size-badge.hidden { opacity: 0; }
.cte-size-badge.cte-snap-flash {
  background: var(--accent);
  transition: background .1s;
}

/* ── Cover text editor modal ────────────────────────────────── */
.cte-modal {
  display: flex;
  flex-direction: column;
  max-height: calc(96vh - 20px);
  max-height: calc(96dvh - 20px);
  overflow: hidden;
}
/* Wider modal on desktop so preview matches actual cover width */
@media (min-width: 640px) {
  .modal-box:has(.cte-modal),
  .modal-box.modal-wide { max-width: 620px; }
}
.cte-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cte-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.cte-preview {
  width: 100%;
  height: 150px;
  background-color: var(--surface-2);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
@media (min-width: 768px) { .cte-preview { height: 220px; } }

/* ── Canva-style guide lines ─── */
.cte-guide {
  position: absolute;
  background: rgba(124, 58, 237, .7);
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.cte-guide.visible { opacity: 1; }
.cte-guide-h {
  left: 0; right: 0;
  height: 1px;
  top: 50%;
}
.cte-guide-v {
  top: 0; bottom: 0;
  width: 1px;
  left: 50%;
}
.cte-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}
.cte-field { display: flex; flex-direction: column; gap: 5px; }
.cte-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-3);
}
.cte-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
}
.cte-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.cte-input::placeholder { color: var(--text-3); }

.cte-field-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
@media (max-width: 480px) { .cte-field-row > div { flex: 1 1 100% !important; } }

.cte-font-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cte-font-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 15px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  min-width: 0;
}
.cte-font-btn:hover { background: var(--surface-2); }
.cte-font-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.cte-color-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cte-color-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  border: 2.5px solid var(--border);
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  flex-shrink: 0;
}
@media (max-width: 380px) {
  .cte-color-btn { width: 30px; height: 30px; }
  .cte-color-wrap { gap: 5px; }
}
.cte-color-btn:hover { transform: scale(1.12); }
.cte-color-btn.active { border-color: var(--accent); transform: scale(1.12); box-shadow: 0 0 0 2px rgba(124,58,237,.3); }

.cte-anim-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
@media (min-width: 420px) { .cte-anim-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) { .cte-anim-grid { grid-template-columns: repeat(4, 1fr); } }

.cte-anim-btn {
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background .15s, border-color .15s, color .15s;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.cte-anim-btn:hover { background: var(--surface-2); }
.cte-anim-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.cte-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.cte-footer .btn {
  font-size: 13px;
  padding: 8px 20px;
  border-radius: var(--r-full);
}
.cte-remove-btn { margin-right: auto; color: var(--danger) !important; }

/* ── Cover text animations (play once) ──────────────────────── */
.ct-anim-slide-up { animation: ctSlideUp .7s cubic-bezier(.22,1,.36,1) both; }
@keyframes ctSlideUp { from { opacity:0; transform:translateY(40px); } to { opacity:1; transform:translateY(0); } }

.ct-anim-slide-down { animation: ctSlideDown .7s cubic-bezier(.22,1,.36,1) both; }
@keyframes ctSlideDown { from { opacity:0; transform:translateY(-40px); } to { opacity:1; transform:translateY(0); } }

.ct-anim-drop-in { animation: ctDropIn .6s cubic-bezier(.25,.46,.45,.94) both; }
@keyframes ctDropIn { from { opacity:0; transform:translateY(-60px); } to { opacity:1; transform:translateY(0); } }

.ct-anim-bounce-drop { animation: ctBounceDrop .8s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes ctBounceDrop { 0% { opacity:0; transform:translateY(-50px); } 60% { opacity:1; transform:translateY(6px); } 80% { transform:translateY(-3px); } 100% { transform:translateY(0); } }

.ct-anim-elastic-drop { animation: ctElasticDrop 1s cubic-bezier(.68,-.55,.27,1.55) both; }
@keyframes ctElasticDrop { 0% { opacity:0; transform:translateY(-50px) scaleY(1.2); } 50% { opacity:1; transform:translateY(8px) scaleY(.95); } 70% { transform:translateY(-4px) scaleY(1.02); } 100% { transform:translateY(0) scaleY(1); } }

.ct-anim-overshoot-slide { animation: ctOvershoot .7s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes ctOvershoot { from { opacity:0; transform:translateX(-40px); } to { opacity:1; transform:translateX(0); } }

.ct-anim-gravity-fall { animation: ctGravity .5s cubic-bezier(.55,.09,.68,.53) both; }
@keyframes ctGravity { from { opacity:0; transform:translateY(-80px); } to { opacity:1; transform:translateY(0); } }

.ct-anim-soft-settle { animation: ctSoftSettle 1.2s cubic-bezier(.22,1,.36,1) both; }
@keyframes ctSoftSettle { 0% { opacity:0; transform:translateY(-30px); } 70% { opacity:1; transform:translateY(2px); } 100% { transform:translateY(0); } }

.ct-anim-fade-in { animation: ctFadeIn .8s ease both; }
@keyframes ctFadeIn { from { opacity:0; } to { opacity:1; } }

.ct-anim-fade-in-up { animation: ctFadeInUp .7s cubic-bezier(.22,1,.36,1) both; }
@keyframes ctFadeInUp { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }

.ct-anim-fade-in-down { animation: ctFadeInDown .7s cubic-bezier(.22,1,.36,1) both; }
@keyframes ctFadeInDown { from { opacity:0; transform:translateY(-30px); } to { opacity:1; transform:translateY(0); } }

/* Staggered letters, cascade, typewriter — handled via JS spans */
.ct-anim-staggered-letters .ct-letter { display: inline-block; opacity:0; animation: ctLetterDrop .4s cubic-bezier(.34,1.56,.64,1) forwards; }
@keyframes ctLetterDrop { from { opacity:0; transform:translateY(-20px); } to { opacity:1; transform:translateY(0); } }

.ct-anim-cascade-drop .ct-word { display: inline-block; opacity:0; animation: ctWordDrop .5s cubic-bezier(.22,1,.36,1) forwards; }
@keyframes ctWordDrop { from { opacity:0; transform:translateY(-25px); } to { opacity:1; transform:translateY(0); } }

.ct-anim-typewriter { overflow: hidden; border-right: 2px solid currentColor; white-space: nowrap; width: 0; animation: ctTypewriter 2s steps(40,end) forwards, ctBlink .6s step-end 3; }
@keyframes ctTypewriter { from { width:0; } to { width:100%; } }
@keyframes ctBlink { 50% { border-color:transparent; } }

.ct-anim-staggered-typewriter .ct-letter { display: inline-block; opacity:0; animation: ctStaggerType .1s ease forwards; }
@keyframes ctStaggerType { from { opacity:0; } to { opacity:1; } }

.profile-stats-row {
  flex: 1;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 4px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  cursor: default;
  padding: 6px 4px;
  border-radius: var(--r);
  transition: background .12s;
}
.stat-clickable {
  cursor: pointer;
}
.stat-clickable:hover { background: var(--surface-2); }
.stat-clickable:active { opacity: .7; }
.stat-num {
  font-family: 'Baloo 2', sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.stat-lbl {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  margin-top: 2px;
  text-transform: lowercase;
  display: flex;
  align-items: center;
  gap: 3px;
}
.profile-uname {
  font-family: 'Baloo 2', sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.2px;
}
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.profile-bio {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}
.profile-bio-empty { color: var(--text-3); }
.profile-actions {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  flex-wrap: wrap;
}
.profile-actions .btn {
  font-size: 13px;
  padding: 7px 16px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
}
.profile-actions .btn:hover { background: var(--surface-3); }
.profile-actions .btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Profile settings strip (own profile) ──────────────────── */
.profile-settings-strip {
  display: flex;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.profile-settings-strip-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: background .12s, color .12s;
  -webkit-tap-highlight-color: transparent;
}
.profile-settings-strip-item:last-child { border-right: none; }
.profile-settings-strip-item:active { background: var(--surface-2); }
.profile-settings-strip-item i { font-size: 18px; }

/* Profile tabs — Instagram style */
.profile-tabs {
  display: flex;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.profile-tab {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  color: var(--text-3);
  cursor: pointer;
  border-top: 1px solid transparent;
  margin-top: -1px;
  transition: all .14s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}
.profile-tab i { font-size: 22px; }
.profile-tab-wip i {
  background: linear-gradient(135deg, #ff2d55 0%, #ff8a00 18%, #ffe600 34%, #2dfc9f 52%, #00cfff 70%, #7a5cff 86%, #ff4fd8 100%);
  background-size: 260% 260%;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: profileWipPulse 1.8s ease-in-out infinite, profileWipGradientShift 3.2s linear infinite;
  filter: drop-shadow(0 0 10px rgba(255, 64, 129, .45)) drop-shadow(0 0 16px rgba(0, 207, 255, .3));
}
.profile-tab.active {
  color: var(--text);
  border-top-color: var(--text);
}
@keyframes profileWipPulse {
  0%, 100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 10px rgba(255, 64, 129, .45)) drop-shadow(0 0 16px rgba(0, 207, 255, .3)); }
  50% { transform: scale(1.18) rotate(-10deg); filter: drop-shadow(0 0 14px rgba(255, 230, 0, .52)) drop-shadow(0 0 22px rgba(122, 92, 255, .34)); }
}
@keyframes profileWipGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* Profile grid (Instagram 3-col square thumbnails) */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.profile-grid-item {
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--surface-2);
}
.profile-grid-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity .15s;
}
.profile-grid-item:active img { opacity: .7; }
.profile-grid-item-ph {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 28px;
}
/* Multi-image indicator */
.grid-multi-badge {
  position: absolute;
  top: 6px; right: 6px;
  color: white;
  font-size: 14px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
}

/* ═══════════════════════════════════════════════════════════════
   ALBUMS
   ═══════════════════════════════════════════════════════════════ */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 8px;
}
@media (min-width: 480px) {
  .albums-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .albums-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 10px; }
}
.album-card {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
  border-radius: var(--r);
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s var(--ease);
}
.album-card:hover { transform: scale(1.01); box-shadow: none; }
.album-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity .15s;
}
.album-thumb-video-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.album-thumb-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.album-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.3);
  color: #fff;
  font-size: 14px;
  pointer-events: none;
}
.album-sort-thumb .album-thumb-video-wrap,
.album-sort-thumb img,
.album-sort-thumb video,
.album-img-thumb .album-thumb-video-wrap,
.album-img-thumb img,
.album-img-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.album-sort-thumb video,
.album-img-thumb video,
.album-card-img,
.image-viewer-img {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}
.album-card:active .album-card-img { opacity: .8; }
.album-card-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 30px;
}
.album-card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: white;
}
.album-card-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-card-count { font-size: 12px; opacity: .8; }
.album-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: 12px;
  z-index: 2;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.album-privacy-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.album-privacy-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}
.album-privacy-toggle span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Album detail image grid */
.album-images-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
}
.album-img-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.album-img-thumb:active img,
.album-img-thumb:active video { opacity: .8; }
.album-media-badges {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.album-media-badge {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 11px;
}
.album-img-thumb-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 32px; height: 32px;
  background: rgba(0,0,0,.7);
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s;
}
.album-img-thumb:hover .album-img-thumb-del { opacity: 1; }
@media (hover: none) { .album-img-thumb-del { opacity: .85; } }

/* ── Album upload overlay (circular progress) ── */
.album-img-uploading { pointer-events: none; }
.album-upload-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  transition: opacity .3s;
}
.album-upload-ring { width: 44px; height: 44px; }
.album-upload-ring-prog { transition: stroke-dashoffset .2s linear; }
.album-upload-pct { font-size: 11px; color: #fff; font-weight: 700; }
.album-upload-done { opacity: 0; }

/* ── Add-image modal: multi-preview grid ── */
.ai-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.ai-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.ai-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.ai-preview-rm {
  position: absolute; top: 4px; right: 4px;
  width: 32px; height: 32px;
  background: rgba(0,0,0,.65);
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; cursor: pointer;
}
.ai-preview-add {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 22px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.ai-preview-add:hover { border-color: var(--accent); color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   IMAGE VIEWER (fullscreen)
   ═══════════════════════════════════════════════════════════════ */
.image-viewer {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 500;
  display: flex;
  flex-direction: column;
  animation: fadeIn .2s var(--ease);
}
.image-viewer-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(rgba(0,0,0,.7), transparent);
  z-index: 10;
  color: white;
}
.image-viewer-close {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 22px;
  color: white;
}
.image-viewer-close:active { opacity: .6; }
.image-viewer-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.image-viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.image-viewer-dots {
  position: relative;
  display: flex;
  gap: 8px;
  align-self: center;
  justify-content: center;
  margin: 10px auto 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.34);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.image-viewer-dot {
  width: 8px;
  height: 8px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.42);
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, opacity .16s ease;
}
.image-viewer-dot.active {
  width: 10px;
  height: 10px;
  background: #fff;
}
.image-viewer-dot:hover {
  background: rgba(255,255,255,.72);
  transform: scale(1.08);
}
.image-viewer-bottom {
  background: var(--bg);
  padding: 14px 16px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  max-height: 45vh;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}
.image-viewer-caption {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}
.image-viewer-caption-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
  position: relative;
  z-index: 2;
  background: var(--bg);
}
/* Comments inside image viewer — remove double padding, match main feed look */
.image-viewer-bottom {
  padding: 0;
}
.image-viewer-bottom .comment-form {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
}
.image-viewer-bottom .comment-textarea {
  font-size: 15px;
}
.image-viewer-bottom .comment-item {
  padding: 8px 16px;
}

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATIONS PANEL
   ═══════════════════════════════════════════════════════════════ */
.notif-panel {
  position: fixed;
  top: calc(var(--topbar-h) + env(safe-area-inset-top));
  left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  border: 1px solid var(--border-2);
  z-index: 190;
  max-height: 70vh;
  overflow-y: auto;
  animation: slideDown .22s var(--ease);
  box-shadow: none;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px) scale(.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
}
.notif-panel-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 17px;
  font-weight: 700;
}
.notif-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.notif-item:hover { background: var(--surface-2); }
.notif-item:active { transform: scale(.99); }
.notif-item.unread { background: var(--surface-3); }
.notif-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}
.notif-text strong {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
}
.notif-text .online-dot {
  margin-left: 0;
}
.notif-time {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
  margin-top: 2px;
}
.notif-thumb {
  width: 44px; height: 44px;
  border-radius: var(--r-xs);
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}
.notif-like-dot {
  width: 18px; height: 18px;
  border-radius: var(--r-full);
  background: var(--like);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL — bottom sheet on mobile
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 600;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn .2s var(--ease);
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: 16px; }
}
.modal-box {
  background: var(--surface);
  border-radius: 14px 14px 0 0;
  width: 100%;
  max-height: 96vh;
  max-height: 96dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: slideUp .25s cubic-bezier(.32,.72,.37,1.1);
  box-shadow: none;
}
@media (min-width: 640px) {
  .modal-box {
    border-radius: var(--r-xl);
    max-width: 520px;
    max-height: 90vh;
    max-height: 90dvh;
  }
}

.notif-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  z-index: 650;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn .2s var(--ease);
}
.notif-detail-panel {
  width: min(720px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 48px rgba(0,0,0,.28);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  animation: notifDetailIn .28s cubic-bezier(.22,.61,.36,1) both;
  will-change: transform;
}
.notif-detail-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.notif-detail-title {
  font-size: 15px;
  font-weight: 700;
}
.notif-detail-close {
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  border: none;
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}
.notif-detail-close:hover { color: var(--text); background: var(--surface-2); }
.notif-detail-hd-actions { display: flex; align-items: center; gap: 4px; }
.notif-detail-mute-btn {
  width: 40px; height: 40px; border-radius: var(--r-full);
  border: none; background: transparent; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; transition: background .15s, color .15s;
}
.notif-detail-mute-btn:hover { color: var(--text); background: var(--surface-2); }
.notif-detail-mute-btn[data-muted="1"] { color: var(--text-3); }
.notif-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0;
  display: block;
}
.notif-detail-card {
  background: var(--surface);
  border: none;
  border-radius: 0;
  overflow: visible;
}
.notif-detail-post-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.notif-detail-post-meta {
  min-width: 0;
  flex: 1;
}
.notif-detail-post-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.notif-detail-post-action-btn {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 15px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}
.notif-detail-post-action-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.notif-detail-post-action-danger:hover {
  color: var(--danger);
  background: rgba(239,68,68,.1);
}
/* Inline edit UI for comments and posts */
.comment-edit-textarea {
  border-radius: var(--r-md) !important;
  border: 1.5px solid var(--accent) !important;
  margin-top: 4px;
}
.comment-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.comment-edit-cancel,
.comment-edit-save {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--r-full);
  transition: background .15s, color .15s;
}
.comment-edit-cancel {
  color: var(--text-3);
}
.comment-edit-cancel:hover {
  background: var(--surface-2);
  color: var(--text);
}
.comment-edit-save {
  color: var(--accent);
  background: var(--accent-soft);
}
.comment-edit-save:hover {
  background: var(--accent);
  color: #fff;
}
.notif-detail-post-user {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.notif-detail-post-time {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 3px;
}
.notif-detail-post-media img,
.notif-detail-post-media video {
  width: 100%;
  display: block;
  max-height: min(68vh, 760px);
  object-fit: contain;
  background: #000;
}
.notif-detail-post-body {
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.notif-detail-post-caption {
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.notif-detail-post-caption strong {
  font-weight: 700;
  cursor: pointer;
  margin-right: 5px;
}
.notif-detail-post-caption strong:hover { opacity: .7; }
.notif-detail-post-like {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 16px 8px;
}
.notif-detail-like-count {
  font-size: 13px;
  font-weight: 700;
}
.notif-detail-comments-card {
  background: var(--surface);
  border: none;
  border-radius: 0;
  overflow: visible;
}
.notif-detail-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.notif-detail-comments-list {
  padding: 8px 0 0;
  contain: layout style;
}
.notif-detail-comment-form {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  flex-shrink: 0;
}
.notif-detail-comment-form .comment-form {
  display: flex;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border-top: none;
}
.notif-detail-comment-form .comment-input-wrap,
.notif-detail-comment-form .comment-textarea,
.notif-detail-comment-form .comment-form-footer {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.notif-detail-reply-wrap {
  box-sizing: border-box;
  width: auto;
  max-width: calc(100% - 68px);
  margin: 0 16px 8px 52px;
  padding: 0;
  overflow: hidden;
}
.notif-detail-reply-wrap.hidden { display: none; }
.notif-detail-reply-wrap .comment-form {
  display: flex;
  width: 100%;
  max-width: 100%;
  padding: 10px 0 0;
  border-top: none;
}
.notif-detail-reply-wrap .comment-input-wrap,
.notif-detail-reply-wrap .comment-textarea,
.notif-detail-reply-wrap .comment-form-footer {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.notif-detail-reply-wrap .comment-form-footer {
  gap: 10px;
}
.notif-detail-comment-form .comment-form-footer,
.notif-detail-reply-wrap .comment-form-footer {
  justify-content: space-between;
  flex-wrap: nowrap;
}
.notif-detail-comment-form .comment-img-btn,
.notif-detail-reply-wrap .comment-img-btn,
.notif-detail-comment-form .comment-send-btn,
.notif-detail-reply-wrap .comment-send-btn {
  flex-shrink: 0;
}
.notif-detail-empty {
  padding: 22px 18px;
  color: var(--text-3);
  font-size: 13px;
}
@keyframes notifDetailIn {
  from { transform: translateX(48px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes notifDetailOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(48px); opacity: 0; }
}
@media (max-width: 640px) {
  .notif-detail-panel { width: 100vw; }
  .notif-detail-comment-form {
    padding: 12px;
  }
  .notif-detail-comment-form .comment-form {
    gap: 8px;
  }
  .notif-detail-reply-wrap {
    max-width: calc(100% - 24px);
    margin-left: 12px;
    margin-right: 12px;
  }
  .notif-detail-reply-wrap .comment-form {
    gap: 6px;
  }
}
.modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-handle {
  width: 32px; height: 3px;
  background: var(--border-2);
  border-radius: var(--r-full);
  margin: 10px auto 0;
}
@media (min-width: 640px) { .modal-handle { display: none; } }
.modal-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 17px;
  font-weight: 700;
}
.modal-close {
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  font-size: 18px;
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 20px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--surface);
  z-index: 1;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* Likers modal */
.likers-modal { padding: 0; }
.likers-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.likers-title { font-family: 'Baloo 2', sans-serif; font-size: 17px; font-weight: 700; margin: 0; }
.likers-list { max-height: 360px; overflow-y: auto; padding: 6px 0; }
.liker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; cursor: pointer;
  transition: background .15s ease;
}
.liker-item:hover { background: var(--surface-2); }
.liker-name { font-size: 15px; font-weight: 600; }

/* Image viewer lightbox */
.img-viewer {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,.0);
  display: flex; align-items: center; justify-content: center;
  transition: background .25s var(--ease);
  padding: 20px;
}
.img-viewer.open { background: rgba(0,0,0,.9); }
.img-viewer-img {
  max-width: 92vw; max-height: 85vh;
  border-radius: var(--r-lg);
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
  transform: scale(.5);
  opacity: 0;
  transition: transform .3s cubic-bezier(.32,.72,.37,1.1), opacity .25s var(--ease);
}
.img-viewer-img.img-viewer-round {
  width: 280px; height: 280px;
  max-width: 70vw; max-height: 70vw;
  border-radius: 50%;
  object-fit: cover;
}
.img-viewer.open .img-viewer-img {
  transform: scale(1);
  opacity: 1;
}
.img-viewer-close {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,.15);
  border: none; color: #fff;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .2s var(--ease), background .15s;
  z-index: 410;
}
.img-viewer.open .img-viewer-close { opacity: 1; }
.img-viewer-close:hover { background: rgba(255,255,255,.25); }
.post-img, .comment-img { cursor: pointer; }

/* Image drop zone */
.img-drop {
  border: 2px dashed var(--border-2);
  border-radius: var(--r-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  color: var(--text-3);
  font-size: 14px;
  transition: border-color .15s;
}
.img-drop:hover { border-color: var(--accent); color: var(--accent); }
.img-drop i { font-size: 36px; margin-bottom: 10px; display: block; }
.cp-media-actions { display: flex; flex-direction: column; gap: 8px; }
.cp-camera-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border: 2px dashed var(--border-2); border-radius: var(--r-lg); color: var(--text-3); font-size: 14px; cursor: pointer; transition: border-color .15s, color .15s; }
.cp-camera-btn:hover { border-color: var(--accent); color: var(--accent); }
.cp-camera-btn i { font-size: 18px; }
.img-preview-wrap { position: relative; margin-top: 12px; }
.img-preview-wrap .album-upload-overlay.hidden { display: none; }
.img-preview {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--r-lg);
}
.img-preview-rm {
  position: absolute;
  top: 8px; right: 8px;
  width: 36px; height: 36px;
  background: rgba(0,0,0,.7);
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   BADGE
   ═══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
}
/* ── Admin badge — animated gradient text ──────────────────── */
.badge-admin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  background: linear-gradient(270deg, #f59e0b, #a855f7, #ec4899, #f59e0b);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: badge-gradient-flow 3s linear infinite;
  border: 1.5px solid transparent;
  background-origin: border-box;
  position: relative;
}
.badge-admin::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-full);
  border: 1.5px solid transparent;
  background: linear-gradient(270deg, #f59e0b, #a855f7, #ec4899, #f59e0b) border-box;
  background-size: 300% 100%;
  animation: badge-gradient-flow 3s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  pointer-events: none;
}
.cover-text-overlay {
  z-index: 2;
}
.badge-admin i {
  background: linear-gradient(270deg, #f59e0b, #a855f7, #ec4899, #f59e0b);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: badge-gradient-flow 3s linear infinite;
  font-size: 10px;
}

.badge-banned { background: rgba(239,68,68,.13); color: var(--danger); -webkit-text-fill-color: unset; }

/* ── Moderator badge — animated gradient text ───────────────── */
.badge-moderator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  background: linear-gradient(270deg, #06b6d4, #3b82f6, #8b5cf6, #06b6d4);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: badge-gradient-flow 3s linear infinite;
  position: relative;
}
.badge-moderator::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-full);
  border: 1.5px solid transparent;
  background: linear-gradient(270deg, #06b6d4, #3b82f6, #8b5cf6, #06b6d4) border-box;
  background-size: 300% 100%;
  animation: badge-gradient-flow 3s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  pointer-events: none;
}
.badge-moderator i {
  background: linear-gradient(270deg, #06b6d4, #3b82f6, #8b5cf6, #06b6d4);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: badge-gradient-flow 3s linear infinite;
  font-size: 10px;
}
.badge-gunnar,
.username-gunnar {
  background: linear-gradient(270deg, #22c55e, #10b981, #34d399, #22c55e);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: badge-gradient-flow 3s linear infinite;
}
.badge-gunnar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.username-gunnar {
  font-weight: 800;
}

@keyframes badge-gradient-flow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* ── VIP badge — animated gold gradient with spinning star ──────── */
.badge-vip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  background: linear-gradient(270deg, #f59e0b, #fcd34d, #fb923c, #f59e0b);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: badge-gradient-flow 3s linear infinite;
  position: relative;
}
.badge-vip::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-full);
  border: 1.5px solid transparent;
  background: linear-gradient(270deg, #f59e0b, #fcd34d, #fb923c, #f59e0b) border-box;
  background-size: 300% 100%;
  animation: badge-gradient-flow 3s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  pointer-events: none;
}
.badge-vip .vip-star-icon {
  display: inline-block;
  background: linear-gradient(270deg, #f59e0b, #fcd34d, #fb923c, #f59e0b);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: badge-gradient-flow 3s linear infinite, vip-star-spin 4s ease-in-out infinite;
  font-size: 10px;
  transform-origin: center;
}
@keyframes vip-star-spin {
  0%,100% { transform: rotate(0deg) scale(1); }
  25%     { transform: rotate(72deg) scale(1.25); }
  50%     { transform: rotate(144deg) scale(1); }
  75%     { transform: rotate(216deg) scale(1.25); }
}
/* legacy single-star still used in some places */
.badge-vip-star {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

/* ── Badge icon-only (feeds, comments, lists) ────────────────── */
.badge-icon-only {
  padding: 0;
  gap: 0;
  margin-left: 5px;
  font-size: 0;
  background: none;
  border: none;
  box-shadow: none;
  position: static;
}
.badge-icon-only::before {
  display: none;
}
.badge-icon-only i {
  font-size: 13px;
}

/* ── Post role badge (small icon inline) ──────────────────────── */
.post-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.post-role-admin {
  background: linear-gradient(270deg, #f59e0b, #a855f7, #ec4899, #f59e0b);
  background-size: 300% 100%;
  animation: badge-gradient-flow 3s linear infinite;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.post-role-moderator {
  background: linear-gradient(270deg, #06b6d4, #3b82f6, #8b5cf6, #06b6d4);
  background-size: 300% 100%;
  animation: badge-gradient-flow 3s linear infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════════ */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px;
}
@media (min-width: 480px) {
  .admin-stats { grid-template-columns: repeat(4, 1fr); }
}
.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
}
.admin-stat-val {
  font-family: 'Baloo 2', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.admin-stat-lbl {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.admin-toolbar {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.admin-search { flex: 1; min-width: 140px; }
.admin-filter {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  font: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  cursor: pointer;
}
.admin-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  transition: background .15s var(--ease);
  animation: slideIn .25s var(--ease) both;
}
.admin-user-card:hover { background: var(--surface-2); }
.auc-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.auc-info { min-width: 0; }
.auc-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auc-email { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.auc-badges { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.auc-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 480px) {
  .admin-user-card { flex-direction: column; align-items: flex-start; }
  .auc-actions { width: 100%; }
}
.auc-btn {
  padding: 5px 12px;
  border-radius: var(--r-full);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.auc-btn:hover { opacity: .8; }
.auc-btn:disabled { opacity: .4; cursor: default; }
.auc-btn-danger { background: rgba(239,68,68,.13); color: var(--danger); }
.auc-btn-warn   { background: rgba(245,158,11,.13);  color: var(--warning); }
.auc-btn-ok     { background: rgba(34,197,94,.13);   color: var(--success); }
.auc-btn-soft   { background: var(--accent-soft);     color: var(--accent); }
.auc-btn-ghost  { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════════
   SKELETON LOADERS
   ═══════════════════════════════════════════════════════════════ */
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-xs);
}
.skel-card {
  background: var(--surface);
  border-radius: 0;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.skel-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.skel-circle { border-radius: var(--r-full); flex-shrink: 0; }
.skel-line { height: 12px; border-radius: var(--r-xs); }

/* ═══════════════════════════════════════════════════════════════
   UTILS
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-3);
}
.empty-icon { font-size: 48px; margin-bottom: 14px; opacity: .3; }
.empty-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}
.empty-sub { font-size: 14px; }

.divider { height: 1px; background: var(--border); margin: 10px 0; }
.hidden  { display: none !important; }
.mt-8    { margin-top: 8px; }
.mt-12   { margin-top: 12px; }
.mt-16   { margin-top: 16px; }
.flex    { display: flex; }
.items-center { align-items: center; }
.gap-8   { gap: 8px; }
.text-muted   { color: var(--text-3); }
.text-danger  { color: var(--danger); }
.text-accent  { color: var(--accent); }
.font-bold    { font-weight: 700; }
.text-sm      { font-size: 12.5px; }
.w-full       { width: 100%; }
.load-more-wrap { text-align: center; padding: 20px 16px 40px; }
.load-more-wrap .btn { min-width: 160px; }

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeUp    { from { opacity:0; transform:translateY(12px) scale(.99); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes bNavPop     { 0%{transform:scale(1)} 30%{transform:scale(1.3)} 60%{transform:scale(.9)} 100%{transform:scale(1)} }
@keyframes bNavGlowIn { from{opacity:0;transform:scale(.5)} to{opacity:1;transform:scale(1)} }
.b-nav-pop { animation: bNavPop .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes fadeIn    { from { opacity:0; } to { opacity:1; } }
@keyframes fadeOut   { from { opacity:1; } to { opacity:0; } }
@keyframes pageEnter { from { opacity:.4; } to { opacity:1; } }
.page-enter { animation: pageEnter .1s ease both; }
/* Page content transition layer — GPU-promoted for smooth fade */
/* will-change removed — permanent GPU layers cause input lag */
/* Suppress child entry animations during page-level crossfade to prevent double-bounce */
.page-replacing * { animation-duration: 0s !important; }
@keyframes iv-slide-out-left  { to { opacity:0; transform:translateX(-26px) scale(.985); } }
@keyframes iv-slide-out-right { to { opacity:0; transform:translateX(26px) scale(.985); } }
@keyframes iv-slide-in-right  { from { opacity:0; transform:translateX(26px) scale(.985); } to { opacity:1; transform:translateX(0) scale(1); } }
@keyframes iv-slide-in-left   { from { opacity:0; transform:translateX(-26px) scale(.985); } to { opacity:1; transform:translateX(0) scale(1); } }
@keyframes slideUp   { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideIn   { from { opacity:0; transform:translateY(8px) scale(.98); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes shimmer   { from { background-position:200% 0; } to { background-position:-200% 0; } }
@keyframes heartPop  { 0%{transform:scale(1)} 15%{transform:scale(.85)} 50%{transform:scale(1.25)} 100%{transform:scale(1)} }
@keyframes toastIn   { from { opacity:0; transform:translateY(8px) scale(.95); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes toastOut  { to { opacity:0; transform:translateY(8px) scale(.95); } }
@keyframes badgePop  { 0%{transform:scale(0)} 60%{transform:scale(1.2)} 100%{transform:scale(1)} }

.heart-anim { animation: heartPop .4s var(--spring); }

/* ── Staggered entry for lists ─────────────────────────────── */
.anim-item {
  animation: slideIn .28s var(--ease) both;
}
.anim-item:nth-child(1)  { animation-delay: 0ms; }
.anim-item:nth-child(2)  { animation-delay: 35ms; }
.anim-item:nth-child(3)  { animation-delay: 70ms; }
.anim-item:nth-child(4)  { animation-delay: 105ms; }
.anim-item:nth-child(5)  { animation-delay: 140ms; }
.anim-item:nth-child(6)  { animation-delay: 175ms; }
.anim-item:nth-child(7)  { animation-delay: 210ms; }
.anim-item:nth-child(8)  { animation-delay: 245ms; }
.anim-item:nth-child(9)  { animation-delay: 280ms; }
.anim-item:nth-child(10) { animation-delay: 315ms; }
.anim-item:nth-child(n+11){ animation-delay: 340ms; }

/* ── Toast ──────────────────────────────────────────────────── */
#toasts {
  position: fixed;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
  width: calc(100vw - 32px);
  max-width: 380px;
}
.toast {
  background: var(--surface-3);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--r-full);
  font-size: 13.5px;
  font-weight: 500;
  animation: toastIn .25s var(--spring);
  pointer-events: auto;
  box-shadow: none;
  border: 1px solid var(--border-2);
  text-align: center;
  width: auto;
  max-width: 100%;
}
.toast.success { background: #111; color: #fff; }
.toast.error   { background: var(--danger); color: #fff; }
.toast.warning { background: var(--warning); color: #fff; }
.toast.out     { animation: toastOut .2s var(--ease) forwards; }

/* ═══════════════════════════════════════════════════════════════
   DESKTOP (≥ 768px)
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  body { overflow: auto; }

  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  .topbar { display: none; }

  .app-layout {
    flex-direction: row;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }
  .app-content {
    margin-left: var(--sidebar-w);
    padding-top: 0;
    padding-bottom: 32px;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
    height: 100dvh;
  }
  .content-inner { padding: 20px 0; max-width: min(614px, calc(100vw - var(--sidebar-w) - 32px)); }
  .page-overlay {
    top: 0; right: 0; bottom: 0;
    left: var(--sidebar-w);
    padding-top: 0;
    padding-bottom: 32px;
  }

  /* Modal — account for sidebar */
  .modal-overlay { padding-left: var(--sidebar-w); }

  /* Notif-detail — account for sidebar */
  .notif-detail-overlay { left: var(--sidebar-w); }
  .notif-detail-panel { width: min(720px, calc(100vw - var(--sidebar-w))); }

  /* Desktop post cards — flat, no margins */
  .post-card { margin: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
  [data-theme="light"] .post-card { box-shadow: none; }
  .post-img { border-radius: 0; }
  .create-bar {
    border-radius: 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
  }
  .notif-panel {
    top: 0;
    left: var(--sidebar-w);
    right: auto;
    width: min(380px, calc(100vw - var(--sidebar-w) - 16px));
    border-radius: 0 0 var(--r-xl) var(--r-xl);
    border: 1px solid var(--border);
    border-top: none;
    box-shadow: none;
  }
  .stories-bar { margin: 0 0 0; border-radius: var(--r-lg); }
  #toasts { bottom: 20px; left: var(--sidebar-w); right: 0; transform: none; }
  .profile-grid { gap: 3px; }
  .albums-grid { gap: 10px; padding: 10px; }
}

@media (min-width: 1100px) {
  :root { --sidebar-w: 260px; }
}

/* ═══════════════════════════════════════════════════════════════
   @MENTION AUTOCOMPLETE DROPDOWN
   ═══════════════════════════════════════════════════════════════ */
.mention-dropdown {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  overflow-y: auto;
  overscroll-behavior: contain;
  min-width: 200px;
  max-width: 280px;
  max-height: 240px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background .1s;
}
.mention-item:hover { background: var(--surface-2); }
.mention-item span { font-weight: 600; }

/* @mention inline styling */
.mention {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.mention:hover { text-decoration: underline; }
.mention-alla {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   COMMENT REPLIES & LIKES
   ═══════════════════════════════════════════════════════════════ */
.comment-replies {
  margin-left: 0;
  border-left: none;
  padding-left: 0;
  margin-top: 2px;
  margin-bottom: 4px;
}
.comment-reply-item {
  padding-top: 4px;
  padding-bottom: 4px;
}
.comment-reply-item .comment-text {
  border-radius: 0 16px 16px 16px;
  background: var(--surface-2);
  font-size: 15px;
  line-height: 1.55;
  padding: 10px 14px;
  color: var(--text);
}
.comment-reply-reference {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-top: 6px;
  margin-bottom: 2px;
  padding: 0 4px;
  background: none;
  border: none;
}
.comment-reply-reference-arrow {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.comment-reply-reference-body {
  min-width: 0;
}
.comment-reply-reference-user {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1px;
}
.comment-reply-reference-text {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.35;
  word-break: break-word;
}
.comment-reply-item .avatar,
.comment-reply-item .avatar-ph {
  width: 28px !important;
  height: 28px !important;
  font-size: 11px !important;
}
.comment-reply-form {
  margin-left: 0;
  margin-top: 4px;
  padding-top: 4px;
}
.reply-form-wrap {
  margin-left: 0;
  border-left: none;
  padding-left: 0;
}

.comment-reply-btn {
  background: none;
  border: none;
  padding: 6px 8px;
  min-height: 36px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  cursor: pointer;
  opacity: .8;
  transition: opacity .12s, color .12s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.comment-reply-btn:hover { opacity: 1; color: var(--accent); }

.comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 6px 8px;
  min-height: 36px;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  transition: color .14s;
}
.comment-like-btn:hover { color: var(--like); }
.comment-like-btn.liked { color: var(--like); }
.comment-like-count { font-size: 12px; font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════
   FOLLOW BUTTON
   ═══════════════════════════════════════════════════════════════ */
#follow-btn {
  min-width: 100px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 700;
  transition: all .18s var(--ease);
}

/* ── Touch targets ────────────────────────────────────────────── */
.b-nav-item, .b-nav-create, .topbar-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE IMPROVEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* ── Landscape mobile — fit everything in short viewport ── */
@media (max-height: 440px) and (orientation: landscape) {
  :root { --topbar-h: 36px; --bottomnav-h: 52px; }
  .topbar { height: 36px; }
  .topbar .topbar-title { font-size: 17px; }
  .bottom-nav-inner { height: 52px; }
  .b-nav-item { padding: 4px 0 6px; }
  .b-nav-item i { font-size: 20px; }
  .b-nav-create { width: 42px; height: 42px; font-size: 17px; margin-top: -21px; }
  .b-nav-create::before { inset: -5px; }
  .profile-cover { height: 190px; }
  .profile-av-wrap { margin-top: -26px; }
}

/* Better small phone support */
@media (max-width: 360px) {
  .post-actions { gap: 2px; }
  .act-btn { width: 38px; height: 38px; font-size: 18px; }
  .b-nav-item i { font-size: 21px; }
  .b-nav-create { width: 44px; height: 44px; font-size: 18px; margin-top: -18px; }
  .profile-stats-row .stat-num { font-size: 17px; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE (max-width: 600px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  /* Post cards on mobile — flat, full width */
  .post-card {
    margin: 0;
    border-radius: 0;
  }
  .stories-bar {
    margin: 6px 10px;
    border-radius: var(--r-lg);
  }
  /* Ensure content has no extra padding */
  .content-inner {
    padding-left: 0;
    padding-right: 0;
  }
  .post-body,
  .post-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  /* Image viewer bottom */
  .image-viewer-bottom {
    max-height: 38vh;
    overflow-y: auto;
  }
  /* Comment form full-width */
  .comment-form {
    padding: 10px 12px 12px;
    gap: 8px;
  }
  .comment-item {
    padding: 8px 12px;
  }
  .comment-replies {
    margin-left: 0;
  }
  .reply-form-wrap {
    margin-left: 0;
  }
  .forum-reply-main {
    padding: 12px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ALBUM CARD EDIT BUTTON
   ═══════════════════════════════════════════════════════════════ */
.album-card { position: relative; }
.album-card-edit {
  position: absolute;
  top: 6px; right: 6px;
  width: 34px; height: 34px;
  background: rgba(0,0,0,.55);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transition: opacity .2s;
}
.album-card:hover .album-card-edit { opacity: 1; }
/* Always visible on touch devices */
@media (hover: none) { .album-card-edit { opacity: 1; } }

/* ── Album drag-to-reorder ─── */
/* ── Album sort list (up/down buttons) ── */
.page-hd-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.album-sort-bar {
  display: flex;
  justify-content: flex-end;
  padding: 4px 12px 8px;
}
.album-sort-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
  box-sizing: border-box;
}
.album-sort-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  box-sizing: border-box;
}
.album-sort-thumb {
  width: 48px; height: 48px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-size: 18px;
}
@media (max-width: 420px) {
  .album-sort-list { padding: 0 8px; }
  .album-sort-row { gap: 8px; padding: 8px 10px; }
  .album-sort-thumb { width: 40px; height: 40px; }
  .album-sort-btn { width: 36px; height: 36px; font-size: 14px; }
}
.album-sort-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.album-sort-info {
  flex: 1;
  min-width: 0;
}
.album-sort-title {
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-sort-count {
  font-size: .8rem;
  color: var(--text-3);
}
.album-sort-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.album-sort-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-1);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.album-sort-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.album-sort-btn:disabled {
  opacity: .3;
  cursor: default;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN MENU ACCORDION
   ═══════════════════════════════════════════════════════════════ */
.main-menu {
  border-bottom: 2px solid var(--accent);
  background: var(--surface);
  overflow: hidden;
}

/* Toggle button — the visible "header" of the accordion */
.main-menu-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: linear-gradient(135deg, #4c1d95 0%, #7C3AED 60%, #a855f7 100%);
  border: none;
  cursor: pointer;
  color: #fff;
  gap: 10px;
  user-select: none;
  transition: filter .15s;
}
.main-menu-toggle:hover { filter: brightness(1.08); }
.main-menu-toggle:active { filter: brightness(.95); }

.main-menu-toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.main-menu-icon {
  font-size: 16px;
  opacity: .9;
}
.main-menu-label {
  font-family: 'Baloo 2', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
}
.main-menu-chevron {
  font-size: 13px;
  opacity: .85;
  transition: transform .3s var(--ease);
  will-change: transform;
  flex-shrink: 0;
}
.main-menu.open .main-menu-chevron {
  transform: rotate(180deg);
}

/* Collapsible body */
.main-menu-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s var(--ease), padding .3s var(--ease);
  padding: 0 14px;
}
.main-menu.open .main-menu-body {
  max-height: 600px;
  padding: 16px 14px 36px;
}

/* Feed section separator */
.feed-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  padding: 12px 16px 6px;
  border-top: 1px solid var(--border);
}
/* ── Feed filter dropdown ─── */
.feed-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  position: relative;
}
.feed-toolbar-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.feed-filter-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  min-height: 40px;
  font-size: 15px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.feed-filter-btn:hover {
  background: var(--surface-2);
  color: var(--accent);
  border-color: var(--accent);
}
.feed-filter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 16px;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 180px;
  padding: 6px 0;
  animation: feedDdIn .15s ease;
}
@keyframes feedDdIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.feed-filter-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.feed-filter-opt:hover {
  background: var(--surface-2);
  color: var(--text);
}
.feed-filter-opt.active {
  color: var(--accent);
  font-weight: 600;
}
.feed-filter-opt.active::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 12px;
  margin-left: auto;
}

/* ─── Media sub-filter tabs ────────────────────────────────── */
.media-sub-filters {
  display: flex;
  gap: 6px;
  padding: 6px 16px 10px;
}
.media-sub-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.media-sub-btn:hover {
  background: var(--surface-3, #ede9fe);
  color: var(--accent);
}
.media-sub-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── Media gallery grid ──────────────────────────────────── */
.media-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 2px;
}
.media-grid-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
  -webkit-tap-highlight-color: transparent;
}
.media-grid-item:active { opacity: .85; }
.media-grid-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-grid-play {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  border-radius: var(--r-full);
  color: #fff;
  font-size: 11px;
  pointer-events: none;
}
.media-grid-count {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,.55);
  border-radius: var(--r-sm);
  pointer-events: none;
}
.media-grid-avatar {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: var(--r-full);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  pointer-events: none;
  overflow: hidden;
  line-height: 0;
}
.media-grid-avatar img,
.media-grid-avatar .avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--r-full);
}
@media (min-width: 480px) {
  .media-gallery-grid { gap: 4px; }
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD GRID (inside menu)
   ═══════════════════════════════════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 8px;
}
@media (min-width: 480px) {
  .dashboard-grid { grid-template-columns: repeat(8, 1fr); gap: 10px; }
}
.dash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 2px 4px;
  border-radius: 12px;
  transition: background .15s, transform .15s;
  user-select: none;
}
.dash-card:hover { background: var(--surface-2); }
.dash-card:active { transform: scale(.93); }
.dash-card-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  transition: transform .15s;
}
.dash-card:hover .dash-card-icon { transform: translateY(-2px); }
.dash-card span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
  white-space: normal;
  max-width: 64px;
}

/* ═══════════════════════════════════════════════════════════════
   USER SEARCH
   ═══════════════════════════════════════════════════════════════ */
.search-wrap {
  padding: 12px 14px 0;
}
.search-input-row {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  gap: 8px;
  margin-bottom: 14px;
  transition: border-color .15s;
}
.search-input-row:focus-within {
  border-color: var(--accent);
}
.search-icon {
  color: var(--text-3);
  font-size: 14px;
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 12px 0;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
}
.search-input::placeholder { color: var(--text-3); }
.search-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}
.search-clear:hover { color: var(--text); }
.search-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.search-history-row {
  display: flex;
  align-items: center;
  padding: 2px 12px;
  border-radius: 10px;
  transition: background .12s;
}
.search-history-row:hover { background: var(--surface-2); }
.search-history-term span {
  font-family: 'Baloo 2', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.search-history-del:hover { color: var(--danger) !important; }

.search-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s;
}
.search-user-row:hover { background: var(--surface-2); }
.sur-info {
  flex: 1;
  min-width: 0;
}
.sur-name {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.sur-role {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 1px;
}
.sur-arrow {
  color: var(--text-3);
  font-size: 12px;
  flex-shrink: 0;
}
.search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--text-3);
  font-size: 14px;
}
.search-empty i { font-size: 28px; opacity: .4; }
.search-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  padding: 4px 12px 8px;
}

/* feed-view-* classes kept minimal — list is the only view now */
.feed-view-list { display: flex; flex-direction: column; }

/* ═══════════════════════════════════════════════════════════════
   FORUM
   ═══════════════════════════════════════════════════════════════ */
.forum-wrap { padding: 0 12px; }
.forum-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px; padding: 14px 2px 0;
}
.forum-header h2 {
  font-size: clamp(22px, 5vw, 28px); font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #EC4899);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.forum-back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--accent);
  cursor: pointer; padding: 10px 12px 10px 0;
  min-height: 44px;
}
.forum-back-btn:hover { opacity: .8; }
.forum-back-btn:active { opacity: .6; }

/* ── Category accordion ──────────────────────────────── */
.forum-cat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  overflow: hidden;
  animation: slideIn .25s var(--ease) both;
}
.forum-cat:nth-child(1) { animation-delay: 0ms; }
.forum-cat:nth-child(2) { animation-delay: 40ms; }
.forum-cat:nth-child(3) { animation-delay: 80ms; }
.forum-cat:nth-child(4) { animation-delay: 120ms; }
.forum-cat:nth-child(n+5) { animation-delay: 160ms; }
.forum-cat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; cursor: pointer;
  min-height: 56px;
  transition: background .15s var(--ease);
  user-select: none;
}
.forum-cat-head:hover { background: var(--surface-2); }
.forum-cat-icon {
  width: 36px; height: 36px; border-radius: var(--r);
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 15px; flex-shrink: 0;
}
.forum-cat-info { flex: 1; min-width: 0; }
.forum-cat-name {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 800;
  line-height: 1.2;
}
.forum-cat-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.forum-cat-counts { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.forum-cat-chevron {
  color: var(--text-3); font-size: 12px; flex-shrink: 0;
  transition: transform .3s var(--ease);
  will-change: transform;
}
.forum-cat.open .forum-cat-chevron { transform: rotate(180deg); }

.forum-cat-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s var(--ease);
}
.forum-cat.open .forum-cat-body {
  grid-template-rows: 1fr;
}
.forum-cat-body-inner {
  overflow: hidden;
}

/* ── Thread list inside accordion ────────────────────── */
.forum-threads {
  padding: 8px 12px 12px;
}
.forum-thread-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px;
  min-height: 48px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .12s var(--ease);
  animation: slideIn .25s var(--ease) both;
}
.forum-thread-card:nth-child(1) { animation-delay: 0ms; }
.forum-thread-card:nth-child(2) { animation-delay: 30ms; }
.forum-thread-card:nth-child(3) { animation-delay: 60ms; }
.forum-thread-card:nth-child(4) { animation-delay: 90ms; }
.forum-thread-card:nth-child(5) { animation-delay: 120ms; }
.forum-thread-card:nth-child(n+6) { animation-delay: 150ms; }
.forum-thread-card:hover { background: var(--surface-2); }
.forum-thread-card + .forum-thread-card {
  border-top: 1px solid var(--border);
}
.forum-thread-av { flex-shrink: 0; }
.forum-thread-info { flex: 1; min-width: 0; }
.forum-thread-title {
  font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.forum-thread-pinned {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent); font-size: 11px; font-weight: 700;
  margin-right: 6px;
}
.forum-thread-snippet {
  font-size: 12px; color: var(--text-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.forum-thread-meta {
  display: flex; gap: 10px; font-size: 11px; color: var(--text-3); margin-top: 4px;
}
.forum-thread-replies {
  font-size: 12px; color: var(--text-3); flex-shrink: 0;
  display: flex; align-items: center; gap: 4px; margin-top: 8px;
}

.forum-new-thread-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 10px;
  margin-top: 4px;
  border-radius: var(--r);
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  border: 1px dashed var(--border);
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s, transform .18s var(--ease);
  animation: slideIn .25s var(--ease) both;
  animation-delay: 180ms;
}
.forum-new-thread-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: scale(1.01);
}

/* ── Single thread view ──────────────────────────────── */
.forum-thread-view { padding: 0 2px; }
.forum-thread-head {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  margin-bottom: 4px;
  animation: slideIn .3s var(--ease) both;
}
.forum-thread-head-top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.forum-thread-head-user { font-size: 14px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.forum-thread-head-user .online-dot { margin-left: 0; }
.forum-thread-head-user:hover { color: var(--accent); }
.forum-thread-head-time { font-size: 12px; color: var(--text-3); }
.forum-thread-head-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; line-height: 1.3; }
.forum-thread-head-content { font-size: 14px; line-height: 1.6; color: var(--text-2); word-break: break-word; }
.forum-thread-head-content p { margin: 0 0 8px; }
.forum-thread-head-content p:last-child { margin-bottom: 0; }
.forum-thread-head-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 8px 0; padding: 6px 12px;
  color: var(--text-3); font-style: italic;
}
.forum-thread-head-content a { color: var(--accent); text-decoration: underline; }
.forum-thread-head-content ul, .forum-thread-head-content ol { margin: 6px 0; padding-left: 20px; }
.forum-thread-head-content img { max-width: 100%; border-radius: var(--r); margin: 8px 0; }
.forum-thread-head-actions {
  display: flex; gap: 8px; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ── Replies ──────────────────────────────────────────── */
.forum-replies-title {
  font-size: 13px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .03em;
  margin: 18px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
/* ── Forum reply accordion ─────────────────────────────────── */
.forum-reply-acc {
  border-bottom: 1px solid var(--border);
  animation: slideIn .25s var(--ease) both;
}
.forum-reply-acc:last-child { border-bottom: none; }
.forum-reply-acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .15s;
}
.forum-reply-acc-head:hover { background: var(--surface-2); }
.forum-reply-acc-av { flex-shrink: 0; }
.forum-reply-acc-meta { flex: 1; min-width: 0; }
.forum-reply-acc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.forum-reply-acc-top strong { font-weight: 700; }
.forum-reply-acc-time { color: var(--text-3); font-size: 12px; }
.forum-acc-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 8px;
  border-radius: var(--r-full);
}
.forum-reply-acc-preview {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.forum-reply-acc-chevron {
  flex-shrink: 0;
  color: var(--text-3);
  font-size: 12px;
  transition: transform .3s var(--ease);
  will-change: transform;
}
.forum-reply-acc.open .forum-reply-acc-chevron { transform: rotate(180deg); }
.forum-reply-acc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s var(--ease);
}
.forum-reply-acc.open .forum-reply-acc-body {
  grid-template-rows: 1fr;
}
.forum-reply-acc-body-inner {
  overflow: hidden;
  padding: 0;
}
.forum-reply-acc.open .forum-reply-acc-body-inner {
  padding-bottom: 8px;
}

.forum-reply {
  position: relative;
  padding: 0;
  margin-bottom: 0;
  animation: slideIn .25s var(--ease) both;
}
.forum-reply:nth-child(1) { animation-delay: 0ms; }
.forum-reply:nth-child(2) { animation-delay: 30ms; }
.forum-reply:nth-child(3) { animation-delay: 60ms; }
.forum-reply:nth-child(4) { animation-delay: 90ms; }
.forum-reply:nth-child(5) { animation-delay: 120ms; }
.forum-reply:nth-child(n+6) { animation-delay: 150ms; }
.forum-reply-main {
  display: flex;
  gap: 10px;
  padding: 6px 16px;
  align-items: flex-start;
}
.forum-reply-av { flex-shrink: 0; padding-top: 2px; }
.forum-reply-body { flex: 1; min-width: 0; }
.forum-reply-bubble {
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
  background: var(--surface-2);
  border-radius: 0 16px 16px 16px;
  padding: 10px 14px;
}
.forum-reply-nested .forum-reply-bubble {
  border-radius: 0 12px 12px 12px;
  background: var(--surface-3);
  font-size: 14px;
  padding: 8px 13px;
}
.forum-reply-user-wrap { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }
.forum-reply-user-wrap .online-dot { margin-left: 0; }
.forum-reply-user { font-weight: 700; cursor: pointer; margin-right: 0; }
.forum-reply-user:hover { color: var(--accent); }
.forum-reply-time { font-size: 12px; color: var(--text-3); }
.forum-reply-content {
  font-size: inherit; line-height: inherit; color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}
.forum-reply-content p { margin: 0 0 6px; }
.forum-reply-content p:last-child { margin-bottom: 0; }
.forum-reply-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 6px 0; padding: 4px 10px;
  color: var(--text-2); font-style: italic;
  background: var(--accent-soft); border-radius: 0 var(--r-xs) var(--r-xs) 0;
}
.forum-reply-content a { color: var(--accent); text-decoration: underline; }
.forum-reply-content ul, .forum-reply-content ol { margin: 4px 0; padding-left: 20px; }
.forum-reply-content img { max-width: 100%; border-radius: var(--r); margin: 6px 0; }
.forum-reply-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  margin-left: -6px;
  flex-wrap: wrap;
}
.forum-reply-foot button {
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  transition: color .12s, background .12s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  min-height: 36px;
  border-radius: var(--r-xs);
  background: none;
}
.forum-reply-foot button:hover { color: var(--accent); }

/* Reply-to indicator bar */
.forum-reply-to-bar {
  font-size: 12px; color: var(--accent); font-weight: 600;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 5px;
}
.forum-reply-to-bar i { font-size: 11px; opacity: .7; }
.forum-reply-to-bar strong { font-weight: 700; }
.forum-reply-reference {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.08);
  border: 1px solid var(--border);
}
.forum-reply-reference-arrow {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.forum-reply-reference-body {
  min-width: 0;
}
.forum-reply-reference-user {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}
.forum-reply-reference-text {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.45;
  word-break: break-word;
}
.forum-comment-replies {
  margin-left: 0;
  border-left: none;
  padding-left: 0;
  margin-top: 0;
  margin-bottom: 0;
}
.forum-reply-form-wrap {
  margin-left: 0;
  border-left: none;
  padding-left: 0;
}
.forum-reply-nested .forum-reply-av .avatar,
.forum-reply-nested .forum-reply-av .avatar-ph {
  width: 28px !important;
  height: 28px !important;
  font-size: 11px !important;
}

/* Inline reply form */
.forum-inline-reply-form {
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin: 6px 0;
  box-shadow: 0 2px 12px rgba(124,58,237,.08);
}
.forum-inline-reply-label {
  font-size: 12px; color: var(--accent); font-weight: 700;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.forum-inline-reply-label i { font-size: 12px; }
.forum-inline-reply-form .forum-editor {
  min-height: 80px;
}

/* Edit reply form (expanded, not cramped) */
.forum-reply-edit-wrap {
  margin-top: 8px;
  border: 1.5px solid var(--accent);
  border-radius: var(--r-lg);
  padding: 12px;
  background: var(--surface);
  box-shadow: 0 2px 12px rgba(124,58,237,.08);
}
.forum-reply-edit-wrap .forum-editor {
  min-height: 80px;
}
.forum-reply-edit-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px;
}

/* ── Reply form ──────────────────────────────────────── */
.forum-reply-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-top: 16px;
}
.forum-reply-form-label {
  font-size: 13px; font-weight: 700; color: var(--text-2);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.forum-reply-form-label i { color: var(--accent); }
.forum-reply-form textarea {
  width: 100%; min-height: 70px; max-height: 200px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 12px;
  color: var(--text); font-size: 14px; line-height: 1.5;
  resize: vertical; outline: none;
  transition: border-color .15s;
}
.forum-reply-form textarea:focus { border-color: var(--accent); }
.forum-reply-form .forum-editor {
  min-height: 100px;
}
.forum-reply-form-actions {
  display: flex; justify-content: flex-end; margin-top: 10px;
}

/* ── New thread / edit forms ─────────────────────────── */
.forum-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
}
.modal-box .forum-form {
  padding: 16px 18px 0;
}
.modal-box .forum-form-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 12px 0 16px;
  z-index: 1;
}
.forum-form label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: 6px;
}
.forum-form input[type="text"],
.forum-form textarea {
  width: 100%;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 12px;
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color .15s;
}
.forum-form input[type="text"]:focus,
.forum-form textarea:focus { border-color: var(--accent); }
.forum-form textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.forum-form-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px;
}
.forum-empty {
  text-align: center; padding: 28px 16px;
  color: var(--text-3); font-size: 14px;
}
.forum-empty i { font-size: 24px; margin-bottom: 8px; display: block; opacity: .4; }

/* ── Forum toolbar ────────────────────────────────────── */
.forum-toolbar {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  padding: 6px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r) var(--r) 0 0;
}
.forum-toolbar + textarea,
.forum-toolbar + .forum-editor {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}
.forum-tb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 28px;
  border-radius: var(--r-xs);
  color: var(--text-2); font-size: 13px;
  transition: background .1s, color .1s;
}
.forum-tb-btn:hover { background: var(--surface-3); color: var(--text); }
.forum-tb-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ── Forum contenteditable editor ────────────────────── */
.forum-editor {
  min-height: 100px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r) var(--r);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  overflow-y: auto;
  max-height: 300px;
}
.forum-editor:focus {
  border-color: var(--accent);
}
/* Highlight toolbar when editor is focused */
.forum-toolbar:has(+ .forum-editor:focus),
.forum-toolbar.toolbar-focused {
  border-color: var(--accent);
}
.modal-box .forum-editor {
  min-height: 80px;
  max-height: 30vh;
  max-height: 30dvh;
}
.forum-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
  pointer-events: none;
}
.forum-editor blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  margin: 4px 0;
  color: var(--text-2);
}
.forum-editor a {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Forum formatted content ─────────────────────────── */
.forum-quote {
  display: block; padding: 4px 10px; margin: 4px 0;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  font-style: italic; color: var(--text-2);
}
.forum-li {
  display: block; padding-left: 16px; position: relative;
}
.forum-li::before {
  content: '•'; position: absolute; left: 4px; color: var(--accent);
}

/* ── Forum image in content ──────────────────────────── */
.forum-content-img {
  width: 100%; max-width: 100%; max-height: 400px;
  object-fit: contain;
  border-radius: var(--r);
  margin-top: 8px;
  cursor: pointer;
}

/* ── Forum image preview (in forms) ──────────────────── */
.forum-img-preview { margin-top: 8px; }
.forum-img-preview-inner {
  position: relative; display: inline-block;
}
.forum-img-preview-inner img {
  max-height: 160px; border-radius: var(--r);
  object-fit: contain;
}
.forum-img-rm {
  position: absolute; top: 4px; right: 4px;
  width: 32px; height: 32px;
  background: rgba(0,0,0,.6); color: #fff;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer;
}

/* ═══════════════════════════════════════════════════════
   NEWS
   ═══════════════════════════════════════════════════════ */
.news-wrap { max-width: 620px; margin: 0 auto; padding: 0 12px; }
.news-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px; padding: 14px 2px 0;
}
.news-header h2 {
  font-size: clamp(22px, 5vw, 28px); font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.news-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  overflow: hidden;
  animation: slideIn .25s var(--ease) both;
}
.news-item:nth-child(1) { animation-delay: 0ms; }
.news-item:nth-child(2) { animation-delay: 40ms; }
.news-item:nth-child(3) { animation-delay: 80ms; }
.news-item:nth-child(4) { animation-delay: 120ms; }
.news-item:nth-child(n+5) { animation-delay: 160ms; }
.news-item-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer;
  min-height: 56px;
  transition: background .15s var(--ease);
  user-select: none;
}
.news-item-head:hover { background: var(--surface-2); }
.news-item-icon {
  width: 36px; height: 36px; border-radius: var(--r);
  background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(249,115,22,.15));
  display: flex; align-items: center; justify-content: center;
  color: #f59e0b; font-size: 15px; flex-shrink: 0;
}
.news-item-info { flex: 1; min-width: 0; }
.news-item-title {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 800;
  line-height: 1.2;
}
.news-item-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.news-item-chevron {
  color: var(--text-3); font-size: 12px; flex-shrink: 0;
  transition: transform .3s var(--ease);
  will-change: transform;
}
.news-item.open .news-item-chevron { transform: rotate(180deg); }
.news-item-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s var(--ease);
}
.news-item.open .news-item-body {
  grid-template-rows: 1fr;
}
.news-item-body-inner {
  overflow: hidden;
}
.news-item-content {
  padding: 12px 16px 16px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  border-top: 1px solid var(--border);
}
.news-item-content a { color: var(--accent); text-decoration: underline; }
.news-item-content h2 { font-size: 18px; font-weight: 700; margin: 14px 0 6px; }
.news-item-content h3 { font-size: 16px; font-weight: 700; margin: 10px 0 4px; }
.news-item-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 10px; margin: 8px 0;
  color: var(--text-2); font-style: italic;
}
.news-item-content pre {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px 14px;
  font-family: 'Fira Code', monospace; font-size: 13px;
  line-height: 1.5; overflow-x: auto; white-space: pre-wrap; margin: 8px 0;
}
.news-item-content code {
  background: var(--accent-soft); padding: 2px 5px; border-radius: 4px;
  font-family: 'Fira Code', monospace; font-size: 13px;
}
.news-item-content pre code { background: none; padding: 0; }
.news-item-content hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.news-item-content ul, .news-item-content ol { padding-left: 20px; margin: 6px 0; }
.news-item-content li { margin: 3px 0; }

/* ── News image ──────────────────────────────────────── */
.news-item-img {
  width: 100%; max-height: 300px;
  object-fit: cover; border-radius: 0;
  cursor: pointer;
}

/* ── News like/footer spacing ────────────────────────── */
.news-actions {
  padding: 4px 16px 2px;
}
.news-footer {
  padding: 0 16px 14px;
}

/* ── News template accent bars ───────────────────────── */
.news-tpl-update      { border-left: 4px solid #7C3AED; }
.news-tpl-maintenance  { border-left: 4px solid #f59e0b; }
.news-tpl-event        { border-left: 4px solid #10b981; }
.news-tpl-welcome      { border-left: 4px solid #3b82f6; }
.news-tpl-rules        { border-left: 4px solid #6366f1; }

/* ── Shop — coming soon ─────────────────────────────── */
.shop-wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 16px;
}
.shop-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px; padding: 14px 2px 0;
}
.shop-header h2 {
  font-size: clamp(22px, 5vw, 28px); font-weight: 800;
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.games-wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 16px;
}
.games-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px; padding: 14px 2px 0;
}
.games-header h2 {
  font-size: clamp(22px, 5vw, 28px); font-weight: 800;
  background: linear-gradient(135deg, #10b981, #34d399);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
h2.ts-title {
  font-size: clamp(26px, 6vw, 34px);
  background: linear-gradient(135deg, #ef4444, #dc2626);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.games-coming-soon {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.games-coming-icon {
  font-size: 64px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #10b981, #34d399);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.games-coming-soon h2 {
  font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 8px;
}
.games-coming-soon p {
  font-size: 15px; line-height: 1.6;
}

/* Game card list */
.games-list { display: flex; flex-direction: column; gap: 10px; }
.game-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border-radius: var(--r-lg); padding: 16px 18px; cursor: pointer;
  transition: background .15s;
}
.game-card:hover { background: var(--surface-2); }
.game-card-icon { font-size: 28px; color: var(--accent); flex-shrink: 0; width: 44px; text-align: center; }
.game-card-info { flex: 1; min-width: 0; }
.game-card-title { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 16px; }
.game-card-desc { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.game-card-arrow { color: var(--text-3); font-size: 14px; flex-shrink: 0; }

/* 10 Sekunder game */
.ts-game {
  text-align: center; padding: 32px 16px 24px;
  background: var(--surface);
  border-radius: var(--r-lg); margin-bottom: 16px;
}
.ts-timer {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: clamp(48px, 12vw, 72px); font-weight: 700;
  color: var(--text); line-height: 1; margin-bottom: 20px;
  letter-spacing: 2px;
  transition: color .2s;
}
.ts-timer-done { color: var(--accent); }
.ts-btn {
  font-size: 18px; padding: 14px 48px; border-radius: var(--r-full);
  font-weight: 700; min-width: 180px; transition: all .15s;
}
.ts-btn-stop {
  background: #ef4444 !important; border-color: #ef4444 !important;
  animation: ts-pulse 0.8s ease-in-out infinite;
}
@keyframes ts-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  50% { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
}
.ts-result { margin-top: 18px; }
.ts-result-time { font-size: 20px; font-weight: 700; color: var(--text); }
.ts-result-diff { font-size: 15px; font-weight: 600; margin-top: 4px; }
.ts-result-msg { font-size: 14px; font-weight: 700; margin-top: 10px; }
.ts-new-best { color: #f59e0b; }
.ts-new-best i { margin-right: 4px; }
.ts-perfect { color: #22c55e; }
.ts-close { color: #f59e0b; }
.ts-far { color: #ef4444; }
.ts-confetti {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 99999; pointer-events: none;
}

.game-reset-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  float: right;
  margin-top: -2px;
}
.game-reset-badge i {
  color: var(--accent);
  font-size: 11px;
}
.game-reset-badge-days {
  font-weight: 700;
  color: var(--text);
}

/* Leaderboard */
.ts-leaderboard {
  background: var(--surface);
  border-radius: var(--r-lg); overflow: hidden;
}
.ts-leaderboard h3 {
  font-family: 'Baloo 2', sans-serif; font-weight: 700;
  font-size: 16px; padding: 14px 16px 10px;
}
.ts-leaderboard h3 i { color: #f59e0b; margin-right: 6px; }
.ts-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r-md);
  margin: 6px 12px;
}
.ts-row-even { background: var(--surface); }
.ts-row-odd { background: var(--surface-2); }
.ts-row-me { background: rgba(124,58,237,.1); }
.ts-rank {
  width: 28px; text-align: center; font-weight: 700;
  font-size: 14px; color: var(--text-3); flex-shrink: 0;
}
.ts-user {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0;
}
.ts-user span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600; font-size: 14px;
}
.ts-score { text-align: right; flex-shrink: 0; }
.ts-score-best {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-weight: 700; font-size: 14px;
}
.ts-score-diff { font-weight: 400; font-size: 11px; color: var(--text-3); }
.ts-score-latest {
  font-size: 11px; color: var(--text-3); margin-top: 2px;
}

/* History */
.ts-history {
  background: var(--surface);
  border-radius: var(--r-lg); margin-top: 16px;
}
.ts-history h3 {
  font-family: 'Baloo 2', sans-serif; font-weight: 700;
  font-size: 16px; padding: 14px 16px 10px;
  display: flex; align-items: center; gap: 8px;
  user-select: none;
}
.ts-history h3 i { color: var(--text-3); }
.ts-history-chevron {
  margin-left: auto; font-size: 12px;
  transition: transform .2s ease;
}
.ts-history-round {
  margin: 4px 12px; background: var(--surface-2);
  border-radius: var(--r-md); overflow: hidden;
}
.ts-history-round:last-child { margin-bottom: 12px; }
.ts-history-round-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer; transition: background .15s;
}
.ts-history-round-header:hover { background: rgba(124,58,237,.08); }
.ts-history-round-info { display: flex; flex-direction: column; gap: 2px; }
.ts-history-round-date {
  font-size: 14px; font-weight: 600; color: var(--text-1);
}
.ts-history-round-date i { color: var(--primary); margin-right: 6px; font-size: 12px; }
.ts-history-round-stats { font-size: 12px; color: var(--text-3); }
.ts-history-round-arrow {
  color: var(--text-3); font-size: 12px; transition: transform .2s ease;
}
.ts-history-round-body { padding: 0 0 8px; }

/* Space Invaders */
h2.si-title {
  font-size: clamp(26px, 6vw, 34px);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.si-start-area {
  text-align: center; padding: 32px 16px;
  background: var(--surface); border-radius: var(--r-lg); margin-bottom: 16px;
}
.si-desc { font-size: 15px; color: var(--text-2); margin-bottom: 20px; }
.si-play-btn { min-width: 180px; }
.si-game-container {
  background: #0a0a1a; border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: 16px; position: relative;
}
#si-canvas {
  display: block; width: 100%; touch-action: none;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.si-hud {
  display: flex; justify-content: space-between; padding: 8px 14px;
  font-size: 14px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,0.4);
}
.si-hud-score { color: #facc15; }
.si-hud-lives { color: #ef4444; }
.si-result {
  text-align: center; padding: 24px 16px;
  background: var(--surface); border-radius: var(--r-lg); margin-bottom: 16px;
}
.si-result-score {
  font-size: 28px; font-weight: 800; color: var(--primary);
  font-family: 'Baloo 2', sans-serif; margin-bottom: 12px;
}
.si-leaderboard {
  background: var(--surface); border-radius: var(--r-lg); overflow: hidden;
}
.si-leaderboard h3 {
  font-family: 'Baloo 2', sans-serif; font-weight: 700;
  font-size: 16px; padding: 14px 16px 10px;
}
.si-leaderboard h3 i { color: #f59e0b; margin-right: 6px; }
/* Snake */
h2.sn-title {
  font-size: clamp(26px, 6vw, 34px);
  color: #33ff33;
  text-shadow: 0 0 10px rgba(51,255,51,0.5);
  font-family: 'Courier New', monospace;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.sn-start-area {
  text-align: center; padding: 32px 16px;
  background: var(--surface); border-radius: var(--r-lg); margin-bottom: 16px;
}
.sn-game-container {
  background: #000; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 16px;
  touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}

/* ── CRT retro wrapper ───────────────────────────────────── */
.sn-crt {
  position: relative; max-width: 420px; margin: 0 auto;
  background: #000; border: 3px solid #1a1a1a;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 0 30px rgba(51,255,51,0.15), inset 0 0 60px rgba(0,0,0,0.5);
}
.sn-hud {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px 4px; font-family: 'Courier New', 'Lucida Console', monospace;
  font-size: 13px; font-weight: bold; color: #33ff33;
  text-shadow: 0 0 6px rgba(51,255,51,0.6);
  letter-spacing: 2px; text-transform: uppercase;
}
#sn-canvas {
  display: block; width: 100%; touch-action: none;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
/* Scanline overlay */
.sn-scanlines {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
}
/* CRT flicker animation */
.sn-crt::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.4) 100%);
}

.si-trophy { margin-left: 4px; font-size: 13px; }
.si-trophy-gold { color: #f59e0b; filter: drop-shadow(0 0 3px rgba(245,158,11,0.5)); }
.si-trophy-silver { color: #94a3b8; filter: drop-shadow(0 0 3px rgba(148,163,184,0.4)); }
.si-trophy-bronze { color: #cd7f32; filter: drop-shadow(0 0 3px rgba(205,127,50,0.4)); }

@media (max-width: 420px) {
  .ts-game { padding: 24px 12px 20px; }
  .ts-btn { padding: 12px 36px; font-size: 16px; min-width: 150px; }
  .ts-row { gap: 8px; padding: 8px 10px; margin: 5px 8px; }
  .ts-user span { font-size: 13px; }
  .ts-score-best { font-size: 13px; }
  .ts-history-round { padding: 10px 12px; margin: 4px 8px; }
}
.shop-coming-soon {
  text-align: center;
  padding: 60px 24px;
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}
.shop-coming-icon {
  width: 80px; height: 80px;
  margin: 0 auto 20px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #fff;
  animation: shopIconPulse 2.5s ease-in-out infinite;
}
@keyframes shopIconPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
.shop-coming-soon h2 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 24px; font-weight: 700;
  margin: 0 0 10px; color: var(--text-1);
}
.shop-coming-soon p {
  font-size: 15px; color: var(--text-3);
  margin: 0 0 6px; line-height: 1.6;
}

/* ── Divider in dashboard grid ───────────────────────── */
.dash-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ══════════════════════════════════════════════════════════
   Gunnar Blog Profile
   ══════════════════════════════════════════════════════════ */
.gunnar-blog-cover-wrap {
  position: relative;
}
.gunnar-blog-cover {
  position: relative;
  height: 200px;
  background: linear-gradient(135deg, rgba(34,197,94,.15), rgba(16,185,129,.12));
  background-size: cover;
  border-radius: 0;
  overflow: visible;
}

/* ── Follow button — top-right on cover ──────── */
.gunnar-follow-wrap {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
}
.gunnar-follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all .2s var(--ease);
  background: #16a34a;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.gunnar-follow-btn:hover {
  transform: translateY(-1px);
  background: #15803d;
  box-shadow: 0 6px 22px rgba(0,0,0,.5);
}
.gunnar-follow-btn:active {
  transform: translateY(0);
}
.gunnar-follow-btn.following {
  background: #1e293b;
  color: #6ee7b7;
  border: 2px solid #22c55e;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.gunnar-follow-btn.following:hover {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #ef4444;
}

/* ── Avatar — centered bottom of cover, pulsing glow ── */
.gunnar-blog-av-wrap {
  position: absolute;
  top: 200px; /* sits at bottom edge of cover */
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}
.gunnar-blog-av-ring-outer {
  display: inline-flex;
  border-radius: 50%;
  padding: 4px;
  position: relative;
  background: linear-gradient(135deg, #22c55e, #059669, #10b981, #34d399);
  background-size: 300% 300%;
  animation: gunnar-ring-gradient 4s ease infinite;
  box-shadow:
    0 0 18px rgba(34,197,94,.5),
    0 0 36px rgba(16,185,129,.3),
    0 0 54px rgba(34,197,94,.15);
  transition: box-shadow .3s;
}
.gunnar-blog-av-ring-outer:hover {
  box-shadow:
    0 0 26px rgba(34,197,94,.65),
    0 0 50px rgba(16,185,129,.4),
    0 0 74px rgba(34,197,94,.2);
}
@keyframes gunnar-ring-gradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.gunnar-blog-av-ring-outer::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(34,197,94,.35);
  animation: gunnar-glow-pulse 2.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes gunnar-glow-pulse {
  0%, 100% { opacity: .4; transform: scale(1); box-shadow: 0 0 0 rgba(34,197,94,0); }
  50%      { opacity: 1;  transform: scale(1.04); box-shadow: 0 0 20px rgba(34,197,94,.3); }
}
.gunnar-blog-av-ring-inner {
  padding: 4px;
  border-radius: 50%;
  background: var(--bg);
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.gunnar-blog-av-ring-inner img,
.gunnar-blog-av-ring-inner .avatar-ph {
  border-radius: 50%;
  display: block;
}
.gunnar-blog-av-video {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* ── Header (below cover + avatar) ──────────── */
.gunnar-blog-header {
  text-align: center;
  padding: 82px 16px 16px;
}
.gunnar-blog-bio {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.5;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.gunnar-blog-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-3);
}
.gunnar-blog-stat strong {
  color: var(--text-1);
  font-weight: 700;
}
.gunnar-blog-stat.stat-clickable {
  cursor: pointer;
}
.gunnar-blog-stat.stat-clickable:hover strong {
  color: #22c55e;
}

/* ── Blog post accordion ─────────────────────────── */
.gunnar-blog-posts {
  padding: 8px 16px;
  max-width: 620px;
  margin: 0 auto;
}
.gunnar-blog-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow .2s var(--ease);
}
.gunnar-blog-item:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.gunnar-blog-item-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .15s var(--ease);
}
.gunnar-blog-item-header:hover {
  background: var(--surface-3, rgba(124,58,237,.04));
}
.gunnar-blog-thumb {
  width: 72px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}
.gunnar-blog-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 18px;
}
.gunnar-blog-item-info {
  flex: 1;
  min-width: 0;
}
.gunnar-blog-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gunnar-blog-item-date {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}
.gunnar-blog-chevron {
  font-size: 14px;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform .3s var(--ease);
  will-change: transform;
}
.gunnar-blog-item.open .gunnar-blog-chevron {
  transform: rotate(180deg);
}
.gunnar-blog-item-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s var(--ease);
}
.gunnar-blog-item-content {
  padding: 0 16px 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
}
.gunnar-blog-item-content h2 { font-size: 18px; font-weight: 700; margin: 14px 0 6px; color: var(--text-1); }
.gunnar-blog-item-content h3 { font-size: 16px; font-weight: 700; margin: 10px 0 4px; color: var(--text-1); }
.gunnar-blog-item-content p { margin: 6px 0; }
.gunnar-blog-item-content ul, .gunnar-blog-item-content ol { margin: 6px 0 6px 20px; }
.gunnar-blog-item-content li { margin-bottom: 4px; }
.gunnar-blog-item-content blockquote { border-left: 3px solid var(--primary); padding: 4px 12px; margin: 8px 0; color: var(--text-3); font-style: italic; }
.gunnar-blog-item-content pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: monospace; font-size: 13px; overflow-x: auto; white-space: pre-wrap; margin: 8px 0; }
.gunnar-blog-item-content code { background: rgba(124,58,237,.1); padding: 1px 4px; border-radius: 4px; font-family: monospace; font-size: 13px; }
.gunnar-blog-item-content pre code { background: none; padding: 0; }
.gunnar-blog-item-content a { color: var(--primary); text-decoration: underline; }
.gunnar-blog-item-content hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.gunnar-blog-item-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }

/* ─── Gunnar feed card (simple — no accordion) ──────────────── */
.gunnar-feed-card { padding-bottom: 0; }
.gunnar-feed-label {
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}
.gunnar-feed-thumb-lg {
  width: 100%;
  display: block;
}
.gunnar-feed-body {
  padding: 14px 16px;
}
.gunnar-feed-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.gunnar-feed-date {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}
.gunnar-feed-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.gunnar-feed-actions .like-count {
  font-size: 13px;
  font-weight: 700;
  margin-left: 4px;
}

/* Gunnar blog item (profile page) actions/footer */
.gunnar-blog-item-body .post-actions {
  padding: 0 10px 6px;
}
.gunnar-blog-item-body .post-footer {
  padding: 0 14px 6px;
}

/* Gunnar title in notif detail */
.notif-detail-gunnar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  padding: 12px 16px 4px;
}

/* ── Online status ───────────────────────────────────────────── */
.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  margin-left: 5px;
  vertical-align: middle;
  box-shadow: 0 0 0 2px var(--surface);
  flex-shrink: 0;
}
.profile-online-status {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 13px;
  margin-top: 2px;
  margin-bottom: 2px;
}
.status-online {
  color: #22c55e;
  font-weight: 600;
}
.status-online i {
  font-size: 8px;
  vertical-align: middle;
  margin-right: 3px;
}
.status-offline {
  color: var(--muted);
}

/* ── iOS / Apple touch fixes ─────────────────────────────────── */
/* Only targets touch devices — no effect on desktop browsers    */
@supports (-webkit-touch-callout: none) {
  /* Prevent iOS zoom on input focus (triggers at font-size < 16px) */
  .field-input,
  .search-input,
  .comment-textarea,
  .forum-editor,
  textarea,
  select {
    font-size: 16px;
  }

  /* Fix sticky :hover states on iOS (hover doesn't un-hover on touch) */
  .post-card:hover,
  .search-user-row:hover,
  .search-history-row:hover,
  .notif-row:hover,
  .sidebar-action:hover,
  .b-nav-item:hover,
  .act-btn:hover,
  .btn-ghost:hover,
  .comment-reply-btn:hover,
  .comment-like-btn:hover {
    background: unset;
  }
  /* Re-apply hover only for devices with pointer (mouse) */
  @media (hover: hover) and (pointer: fine) {
    .post-card:hover { background: var(--surface-2); }
    .search-user-row:hover { background: var(--surface-2); }
    .search-history-row:hover { background: var(--surface-2); }
  }

  /* Smoother momentum scrolling */
  .app-content,
  .modal-box,
  .notif-detail-wrap {
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent pull-to-refresh interfering with scroll */
  .app-content {
    overscroll-behavior-y: contain;
  }

  /* Fix position:fixed elements when virtual keyboard opens */
  .bottom-nav,
  .topbar {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  /* Use JS-computed viewport height when keyboard is open */
  .app-layout,
  .sidebar {
    height: var(--app-vh, 100vh);
  }

  /* Disable long-press callout on images and links */
  img,
  a,
  .post-image-wrap img {
    -webkit-touch-callout: none;
  }
}

/* ── Report Modal ────────────────────────────────────── */
/* ── Moderation detail modal ──────────────────────────────── */
/* Moderation panel — reuses notif-detail-panel slide-in */
.mod-detail-type {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-3);
  background: var(--surface-2); padding: 4px 10px; border-radius: 20px;
}
.mod-panel-action {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 18px; background: rgba(239,68,68,.07);
  border-bottom: 1px solid var(--border);
}
.mod-panel-action-icon {
  width: 44px; height: 44px; border-radius: 50%; background: #ef4444;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; flex-shrink: 0;
}
.mod-panel-action-text {
  font-size: 15px; color: var(--text); line-height: 1.5; padding-top: 2px;
}
.mod-panel-action-text strong { display: block; margin-bottom: 2px; }
.mod-panel-action-text span { color: var(--text-2); }
.mod-panel-section { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.mod-panel-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-3); margin-bottom: 8px;
}
.mod-panel-preview {
  font-size: 14px; color: var(--text-2); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); border-radius: var(--r-sm);
  padding: 14px 16px; max-height: 300px; overflow-y: auto;
}
.mod-panel-media { text-align: center; }
.mod-panel-media img, .mod-panel-media video {
  max-width: 100%; max-height: 400px; border-radius: var(--r-sm);
  object-fit: contain;
}
.mod-panel-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-3); border-bottom: none;
}

.report-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .15s ease;
}
.report-modal {
  background: var(--surface); border-radius: 20px; width: 100%; max-width: 440px;
  max-height: 90vh; overflow-y: auto; position: relative;
  box-shadow: 0 24px 48px rgba(0,0,0,.3); animation: slideUp .2s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.report-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  background: var(--bg-2, rgba(0,0,0,.1)); border: none; border-radius: 50%;
  color: var(--text-2); font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: background .15s;
  z-index: 1;
}
.report-close:hover { background: rgba(0,0,0,.15); }
.report-header {
  padding: 24px 24px 0; font-size: 18px; font-weight: 700;
}
.report-body { padding: 16px 24px 24px; }
.report-reason {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border-radius: 12px; cursor: pointer; transition: background .12s;
  user-select: none;
}
.report-reason:hover { background: var(--bg-hover, rgba(124,58,237,.06)); }
.report-reason input[type="radio"] {
  margin-top: 3px; accent-color: var(--primary); flex-shrink: 0;
  width: 18px; height: 18px; cursor: pointer;
}
.report-reason-text { font-size: 15px; line-height: 1.4; }
.report-message {
  width: 100%; margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2, #f0f0f0);
  color: var(--text); font: inherit; font-size: 14px; resize: vertical;
  min-height: 70px; outline: none; transition: border-color .15s;
}
.report-message::placeholder { color: var(--text-3); }
.report-message:focus { border-color: var(--accent); }
.report-submit {
  display: block; width: 100%; margin-top: 16px; padding: 14px;
  background: var(--accent); color: #fff; border: none; border-radius: 14px;
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: opacity .15s;
}
.report-submit:hover { opacity: .9; }
.report-submit:disabled { opacity: .5; cursor: default; }
.report-thanks {
  text-align: center; padding: 40px 24px;
}
.report-thanks-icon {
  font-size: 40px; margin-bottom: 12px; display: block;
}
.report-thanks h3 { font-size: 18px; margin-bottom: 8px; }
.report-thanks p { font-size: 14px; color: var(--text-2); line-height: 1.5; }

/* ── WIP (Work in Progress) ────────────────────────────────── */

/* Accordion on profile */
.wip-accordion { padding: 8px 16px; max-width: 620px; margin: 0 auto; }
.wip-section-label { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; padding: 14px 0 6px; }
.wip-accordion-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.wip-accordion-header { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.wip-accordion-thumb { width: 72px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--border); }
.wip-accordion-thumb-ph { display: flex; align-items: center; justify-content: center; color: var(--text-2); font-size: 18px; }
.wip-accordion-info { flex: 1; min-width: 0; }
.wip-accordion-title { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wip-accordion-date { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.wip-accordion-chevron { font-size: 14px; color: var(--text-2); transition: transform .3s var(--ease); will-change: transform; flex-shrink: 0; }
.wip-accordion-item.open .wip-accordion-chevron { transform: rotate(180deg); }
.wip-accordion-body { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.wip-accordion-body-inner { padding: 0 16px 16px; }
.wip-completed-icon { color: var(--success, #22C55E); margin-right: 4px; }

/* WIP Project page */
.wip-project { max-width: 620px; margin: 0 auto; padding: 0 16px 32px; }
.wip-meta-card { background: var(--surface); border-radius: 14px; padding: 16px; margin-bottom: 16px; position: relative; }
.wip-meta-thumb { width: 100%; border-radius: 10px; margin-bottom: 12px; }
.wip-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.wip-meta-item { font-size: 14px; color: var(--text); }
.wip-meta-label { font-weight: 600; color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; display: block; margin-bottom: 2px; }
.wip-status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px; margin-bottom: 6px; }
.wip-meta-updated { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.wip-meta-duration { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 15px; color: var(--text-2); text-align: center; padding: 20px 0 8px; }
.wip-status-ongoing { background: rgba(168, 85, 247, .12); color: var(--accent); }
.wip-status-completed { background: rgba(34, 197, 94, .12); color: #22C55E; }

/* WIP Blocks */
.wip-blocks { margin-top: 4px; }
.wip-block { margin-bottom: 16px; position: relative; padding: 8px 12px; content-visibility: auto; contain-intrinsic-size: auto 300px; }
.wip-block-heading { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.wip-block-subtext { font-size: 14px; color: var(--text-2); margin: 6px 0 0; line-height: 1.6; }
.wip-block-img { width: 100%; border-radius: 10px; display: block; cursor: pointer; }
.wip-slider-slide img { cursor: pointer; }
.wip-images-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.wip-images-grid .wip-img-wrap { aspect-ratio: 1; }
.wip-images-grid img { width: 100%; height: 100%; border-radius: 8px; object-fit: cover; display: block; cursor: pointer; }
.wip-block-actions { display: flex; gap: 6px; margin-top: 8px; }
.wip-img-del-btn { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; z-index: 3; }
.wip-img-wrap { position: relative; }
.wip-block-img + .wip-block-img, .wip-img-wrap + .wip-img-wrap { margin-top: 6px; }
.wip-images-grid .wip-img-wrap { overflow: hidden; border-radius: 8px; margin-top: 0; }
.wip-slider-slide .wip-img-wrap { width: 100%; }
.wip-block-act-btn { width: 38px; height: 38px; border-radius: 10px; border: none; background: var(--surface); color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.wip-block-act-btn:hover { color: var(--text); }
.wip-block-act-del:hover { color: var(--danger, #EF4444); }

/* WIP upload progress ring */
.wip-upload-progress {
  position: absolute; inset: 0; margin-top: 14px;
  background: var(--primary);
  border-radius: var(--r-md, 10px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
}
.wip-upload-progress.hidden { display: none; }

/* Date divider */
.wip-date-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 12px; }
.wip-date-divider::before, .wip-date-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.wip-date-divider span { font-size: 12px; color: var(--text-2); font-weight: 600; white-space: nowrap; }

/* Add block button */
.wip-block-toolbar { display: flex; gap: 8px; margin: 16px 0; }
.wip-add-block-btn { flex: 1; border: 2px dashed var(--border); border-radius: 12px; padding: 14px; font-size: 14px; font-weight: 600; color: var(--text-2); background: transparent; cursor: pointer; transition: border-color .2s, color .2s; }
.wip-add-block-btn:hover { border-color: var(--accent); color: var(--accent); }
.wip-sort-blocks-btn { flex-shrink: 0; border: 2px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 13px; font-weight: 600; color: var(--text-2); background: transparent; cursor: pointer; transition: border-color .2s, color .2s, background .2s; white-space: nowrap; }
.wip-sort-blocks-btn:hover { border-color: var(--accent); color: var(--accent); }

/* WIP block sort list */
.wip-block-sort-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
.wip-block-sort-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border-radius: 10px; border: 1px solid var(--border); }
.wip-block-sort-thumb { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--bg); overflow: hidden; }
.wip-block-sort-info { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wip-block-sort-btns { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.wip-block-sort-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; transition: background .15s, color .15s; }
.wip-block-sort-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.wip-block-sort-btn:disabled { opacity: .3; cursor: default; }

/* Save bar */
.wip-save-bar { display: flex; gap: 8px; padding: 8px 0 12px; flex-wrap: wrap; }
.wip-save-bar .btn { flex: 1; min-width: 110px; }
.wip-complete-bar { display: flex; align-items: center; gap: 10px; padding: 12px 0 32px; }
.wip-complete-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; flex: 1; user-select: none; }
.wip-complete-check input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.wip-complete-bar .btn { flex-shrink: 0; }
.btn-success { background: #22C55E; color: #fff; border: none; border-radius: var(--r); padding: 10px 18px; font-weight: 600; cursor: pointer; font-size: 14px; }
.btn-success:hover { background: #16A34A; }
/* WIP Interact bar */
.wip-interact-bar { display: flex; align-items: center; gap: 16px; padding: 10px 4px; border-top: 1px solid var(--border); margin-top: 8px; }
.wip-like-btn, .wip-comment-btn { display: flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font-size: 15px; color: var(--text-2); padding: 6px 10px; border-radius: 10px; transition: background .15s; font-family: inherit; }
.wip-like-btn:hover, .wip-comment-btn:hover { background: var(--accent-soft); }
.wip-like-btn.liked { color: var(--accent); }
.wip-like-btn .like-icon { display: flex; align-items: center; }
.wip-like-count, #wip-comment-count { font-size: 14px; font-weight: 600; }
.wip-heart-anim { animation: wipHeartPop .5s var(--spring); }
@keyframes wipHeartPop { 0%{transform:scale(1)} 12%{transform:scale(.8)} 35%{transform:scale(1.35)} 60%{transform:scale(.95)} 100%{transform:scale(1)} }
/* WIP Comments */
.wip-show-all-comments { display: block; width: 100%; background: none; border: none; color: var(--text-3); font-size: 13px; font-family: inherit; padding: 6px 4px 2px; cursor: pointer; text-align: left; margin-bottom: 32px; }
.wip-show-all-comments:hover { color: var(--text-1); }

/* DMC block — accordion + picker */
.wip-dmc-block { padding: 4px 12px !important; }
.wip-dmc-accordion { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.wip-dmc-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.wip-dmc-title { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.wip-dmc-badge { font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 10px; }
.wip-dmc-chevron { font-size: 12px; color: var(--text-3); transition: transform .3s var(--ease); will-change: transform; }
.wip-dmc-accordion.open .wip-dmc-chevron { transform: rotate(180deg); }
.wip-dmc-body { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.wip-dmc-list { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.dmc-num { font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
/* DMC search picker (modal) */
.dmc-search-wrap { position: relative; }
.dmc-search-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 10; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; max-height: 200px; overflow-y: auto; display: none; box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.dmc-search-results:not(:empty) { display: block; }
.dmc-result-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; transition: background .1s; }
.dmc-result-item:hover { background: var(--accent-soft); }
.dmc-result-added { opacity: .5; cursor: default; }
.dmc-result-added:hover { background: none; }
.dmc-add-btn { margin-left: auto; color: var(--accent); font-size: 14px; }
.dmc-already { margin-left: auto; color: var(--accent); font-size: 12px; }
.dmc-added-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.dmc-added-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--bg); border-radius: 8px; flex-wrap: nowrap; }
.dmc-remove { background: none; border: none; color: var(--text-3); cursor: pointer; padding: 2px 6px; font-size: 13px; border-radius: 6px; flex-shrink: 0; }
.dmc-remove:hover { color: var(--danger); background: rgba(239,68,68,.08); }
/* DMC effect checkboxes — touch-friendly */
.dmc-fx-checks { display: flex; gap: 4px; margin-left: auto; flex-shrink: 0; }
.dmc-fx-cb { display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; padding: 6px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); min-height: 36px; -webkit-tap-highlight-color: transparent; }
.dmc-fx-cb:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.dmc-fx-cb input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0; flex-shrink: 0; }
.dmc-fx-cb-label { font-size: 11px; font-weight: 700; color: var(--text-2); letter-spacing: .3px; }
/* DMC effect tags (display mode) — text labels with matching color + animation */
.dmc-fx-tag { font-size: 10px; font-weight: 700; padding: 4px 7px; border-radius: 4px; letter-spacing: .3px; white-space: nowrap; line-height: 1; animation: dmcTagPop .35s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes dmcTagPop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
/* Aurora Borealis tag — animated rainbow gradient text */
.dmc-fx-tag-ab {
  border: 1px solid rgba(130,170,255,.35);
  background: linear-gradient(90deg, #a78bfa, #60a5fa, #34d399, #fbbf24, #f472b6, #a78bfa);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: dmcTagPop .35s cubic-bezier(.34,1.56,.64,1) both, dmcTagAbShift 4s linear infinite;
}
@keyframes dmcTagAbShift { 0% { background-position: 0% 0; } 100% { background-position: 300% 0; } }
/* Fairy Dust tag — golden shimmer pulse */
.dmc-fx-tag-fr {
  background: linear-gradient(90deg, #fbbf24, #fde68a, #f59e0b, #fde68a, #fbbf24);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  border: 1px solid rgba(251,191,36,.3);
  animation: dmcTagPop .35s cubic-bezier(.34,1.56,.64,1) both, dmcTagFrShift 2.5s ease-in-out infinite;
}
@keyframes dmcTagFrShift { 0% { background-position: 0% 0; } 50% { background-position: 300% 0; } 100% { background-position: 0% 0; } }
/* Crystal tag — icy pink/purple shimmer */
.dmc-fx-tag-cr {
  background: linear-gradient(90deg, #e879f9, #c4b5fd, #fbcfe8, #c4b5fd, #e879f9);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  border: 1px solid rgba(232,121,249,.25);
  animation: dmcTagPop .35s cubic-bezier(.34,1.56,.64,1) both, dmcTagCrShift 3s ease-in-out infinite;
}
@keyframes dmcTagCrShift { 0% { background-position: 0% 0; } 50% { background-position: 300% 0; } 100% { background-position: 0% 0; } }

/* DMC swatch base — no effects on the color, just a clean square */
.dmc-swatch { width: 48px; height: 24px; border-radius: 6px; flex-shrink: 0; border: 1px solid rgba(0,0,0,.1); }
/* DMC row layout — tags pushed to far right */
.wip-dmc-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); min-height: 40px; }
.wip-dmc-row:last-child { border-bottom: none; }
.wip-dmc-row .dmc-fx-tags { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* Slider / Carousel */
.wip-slider { position: relative; overflow: hidden; border-radius: 10px; background: var(--border); }
.wip-slider-track { display: flex; transition: transform .35s var(--ease); }
.wip-slider-slide { flex-shrink: 0; width: 100%; }
.wip-slider-slide img { width: 100%; display: block; object-fit: cover; }
.wip-slider-prev, .wip-slider-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.55); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 15px; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; }
.wip-slider-prev { left: 8px; }
.wip-slider-next { right: 8px; }
.wip-slider-prev:hover, .wip-slider-next:hover { background: rgba(0,0,0,.7); }
.wip-slider-dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0; }
.wip-slider-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); cursor: pointer; transition: background .2s; }
.wip-slider-dot.active { background: var(--accent); }

/* Block picker modal */
.wip-block-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px 20px; }
.wip-block-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 12px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); transition: border-color .15s, background .15s; }
.wip-block-pick:hover { border-color: var(--accent); background: rgba(168,85,247,.06); }
.wip-block-pick i { font-size: 24px; color: var(--accent); }

/* WIP Feed card */
.wip-feed-card { padding-bottom: 0; }
.wip-feed-label { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: linear-gradient(135deg, rgba(168,85,247,.12), rgba(59,130,246,.12)); color: var(--accent); margin-left: 6px; }
.wip-follow-indicator { font-size: 11px; color: #f59e0b; margin-left: 4px; }

/* WIP feed — Gunnar-style layout */
.wip-feed-status { padding: 10px 16px 0; font-size: 13px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.wip-feed-status i { font-size: 12px; }
.wip-feed-status-done { color: #10b981; }
.wip-feed-panel { display: flex; align-items: center; gap: 16px; padding: 14px 16px; }
.wip-feed-thumb { width: 88px; height: 66px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--border); }
.wip-feed-thumb-ph { display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 22px; }
.wip-feed-info { flex: 1; min-width: 0; }
.wip-feed-title { font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--text); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wip-feed-date { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.wip-feed-cta { padding: 0 16px 4px; }
.wip-feed-cta-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px; border: none; border-radius: 12px; background: linear-gradient(135deg, rgba(168,85,247,.1), rgba(59,130,246,.1)); color: var(--accent); font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background .15s, transform .1s; }
.wip-feed-cta-btn:hover { background: linear-gradient(135deg, rgba(168,85,247,.18), rgba(59,130,246,.18)); }
.wip-feed-cta-btn:active { transform: scale(.98); }

/* WIP Create form */
.wip-create-form { max-width: 500px; margin: 0 auto; padding: 0 16px 32px; }
.wip-form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 14px 0 5px; }
.wip-create-form .field-input { width: 100%; box-sizing: border-box; }
.wip-thumb-upload { border: 2px dashed var(--border); border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; transition: border-color .2s; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80px; }
.wip-thumb-upload:hover { border-color: var(--accent); }
.wip-thumb-placeholder { color: var(--text-2); font-size: 14px; }
.wip-thumb-placeholder i { font-size: 24px; display: block; margin-bottom: 6px; }
.wip-thumb-preview { max-height: 180px; width: 100%; object-fit: cover; border-radius: 10px; }
.wip-create-btn { width: 100%; margin-top: 20px; padding: 14px; font-size: 16px; font-weight: 700; }
.wip-checkbox-group { display: flex; gap: 14px; flex-wrap: wrap; padding: 4px 0; }
.wip-checkbox { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); cursor: pointer; }
.wip-checkbox input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.wip-block-upload-preview { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.wip-block-upload-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.wip-blocks-empty { text-align: center; padding: 32px 16px; color: var(--text-2); font-size: 14px; }
.wip-block-text { font-size: 14px; line-height: 1.7; color: var(--text); padding: 0 2px; white-space: pre-wrap; word-break: break-word; }
.wip-block-video { width: 100%; border-radius: 10px; max-height: 500px; background: #000; }
.wip-lazy-video { min-height: 200px; }
.wip-lazy-video[data-src] { opacity: 0; }
.wip-block-video:not([data-src]) { animation: wipVideoIn .3s ease forwards; }
@keyframes wipVideoIn { from { opacity: 0; } to { opacity: 1; } }
.wip-block-media-text { padding: 0 !important; display: flex; flex-direction: column; }
.wip-block-media-text .wip-img-wrap,
.wip-block-media-text .wip-block-video { border-radius: 10px 10px 0 0; overflow: hidden; }
.wip-block-media-text .wip-block-img { border-radius: 0; width: 100%; display: block; }
.wip-block-media-text .wip-img-del-btn { top: 6px; right: 6px; }
.wip-media-caption { font-size: 14px; line-height: 1.7; color: var(--text); padding: 10px 2px 0; white-space: pre-wrap; word-break: break-word; }
.wip-block-media-text .wip-block-actions { padding: 4px 12px 8px; }
.wip-block-divider { position: relative; padding: 0; }
.wip-divider { border: none; height: 6px; border-radius: 3px; background: var(--border, #e5e1f0); margin: 0; }

/* WIP block style pickers */
.wip-style-section { margin-top: 10px; }
.wip-style-label { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 6px; display: block; }
.wip-font-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.wip-font-btn { padding: 5px 10px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; font-size: 13px; color: var(--text); transition: border-color .15s, background .15s; }
.wip-font-btn.active { border-color: var(--accent); background: rgba(124,58,237,.08); }
.wip-font-btn:hover { border-color: var(--accent); }
.wip-color-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.wip-color-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid transparent; cursor: pointer; transition: border-color .15s, transform .1s; }
.wip-color-swatch.active { border-color: var(--accent); transform: scale(1.15); }
.wip-color-swatch:hover { transform: scale(1.1); }
.wip-color-swatch[data-color="#ffffff"], .wip-color-swatch[data-color="#f5f5f5"] { box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }

/* Page header action button */
.page-hd-action { background: none; border: none; color: var(--text-2); font-size: 16px; cursor: pointer; padding: 6px; margin-left: auto; }
.page-hd-action:hover { color: var(--text); }
.page-hd-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.page-hd-right .page-hd-action { margin-left: 0; }
.wip-hd-del { color: var(--danger, #e53e3e); }
.wip-hd-del:hover { color: #c53030; }
.wip-follow-btn-main { width: 100%; margin: 0 0 12px; font-size: 14px; font-weight: 600; gap: 8px; display: flex; align-items: center; justify-content: center; }

/* WIP public shell */
.pub-wip-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.pub-wip-topbar { flex-shrink: 0; display: flex; align-items: center; justify-content: center; height: 48px; background: var(--bg); border-bottom: 1px solid var(--border); }
.pub-wip-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0; }
.pub-wip-scroll > #page-content { max-width: 620px; margin: 0 auto; padding: 0 0 24px; }

/* WIP public CTA */
.wip-public-cta { text-align: center; padding: 32px 20px 36px; margin: 24px 12px 8px; background: #ffffff; border-radius: 16px; border: 1px solid #e2d8f5; box-shadow: 0 2px 12px rgba(124,58,237,.08); }
.wip-public-cta-icon { font-size: 32px; color: #7C3AED; margin-bottom: 12px; }
.wip-public-cta-title { font-size: 18px; font-weight: 800; color: #1a1a2e; margin: 0 0 8px; }
.wip-public-cta-text { font-size: 14px; color: #555; margin: 0 auto 20px; max-width: 340px; line-height: 1.5; }
.wip-public-cta-btn { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; padding: 12px 28px; border-radius: 12px; background: #7C3AED; color: #fff; border: none; cursor: pointer; text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION — disable expensive animations for accessibility
   ═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE POLISH — better spacing, readability, touch feel
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  /* Bigger, clearer field labels */
  .field-label { font-size: 11px; letter-spacing: .5px; }

  /* Larger comment text for readability */
  .comment-text { font-size: 14px; line-height: 1.55; }
  .comment-time { font-size: 11px; }

  /* More breathing room on posts */
  .post-header { padding: 12px 14px 8px; }
  .post-body { padding-left: 14px; padding-right: 14px; }
  .post-caption { font-size: 15px; line-height: 1.55; }
  .post-footer { padding: 8px 14px 10px; }

  /* Better modal sizing */
  .modal-box { border-radius: 16px 16px 0 0; max-height: calc(100dvh - 40px); }

  /* Profile section polish */
  .profile-username { font-size: 20px; }
  .profile-bio { font-size: 14px; line-height: 1.5; }
  .profile-stats-row .stat-num { font-size: 18px; }
  .profile-stats-row .stat-label { font-size: 11px; }

  /* Notification text */
  .notif-text { font-size: 14px; }
  .notif-time { font-size: 11px; }

  /* Forum readability */
  .forum-thread-title { font-size: 15px; }
  .forum-reply-text { font-size: 14px; line-height: 1.55; }

  /* Album titles */
  .album-card-title { font-size: 13px; }

  /* Better touch feedback */
  .btn:active, .act-btn:active, button:active {
    transform: scale(0.96);
  }
}
