/* ═══════════════════════════════════════════════════════════
   KAZJAK.EE — design system
   Minimalistlik, tume, ühtlane. Ainult live = punane.
═══════════════════════════════════════════════════════════ */

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  /* Background */
  --bg:       #0a0a0a;
  --bg2:      #111111;

  /* Surfaces */
  --s1:  rgba(255,255,255,.04);
  --s2:  rgba(255,255,255,.07);
  --s3:  rgba(255,255,255,.11);
  --s4:  rgba(255,255,255,.16);

  /* Borders */
  --line:  rgba(255,255,255,.08);
  --line2: rgba(255,255,255,.13);

  /* Text */
  --text:  #eeeeee;
  --muted: rgba(238,238,238,.52);
  --soft:  rgba(238,238,238,.3);
  --dim:   rgba(238,238,238,.18);

  /* Accent — LIVE only */
  --red:      #e03228;
  --red-soft: rgba(224,50,40,.14);
  --red-glow: 0 0 0 3px rgba(224,50,40,.25);

  /* Type */
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", monospace;

  /* Radius */
  --r-lg:  18px;
  --r-md:  12px;
  --r-sm:   8px;
  --r-xs:   5px;
  --r-pill: 999px;

  /* Easing */
  --ease: .18s cubic-bezier(.4,0,.2,1);
  --ease-spring: .28s cubic-bezier(.34,1.4,.64,1);

  /* Topbar height */
  --bar: 64px;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html {
  height: 100%;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ─── Noise layer (subtle grid texture) ─────────────────── */
.noise {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none; opacity: .06;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════════ */
@keyframes fade-up {
  from { opacity:0; transform:translateY(14px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes fade-in {
  from { opacity:0; }
  to   { opacity:1; }
}
@keyframes slide-right {
  from { opacity:0; transform:translateX(-10px); }
  to   { opacity:1; transform:translateX(0); }
}
@keyframes scale-in {
  from { opacity:0; transform:scale(.94); }
  to   { opacity:1; transform:scale(1); }
}
@keyframes live-pulse {
  0%,100% { opacity:1; }
  50%     { opacity:.4; }
}
@keyframes live-ring {
  0%   { transform:scale(1);   opacity:.7; }
  100% { transform:scale(2.2); opacity:0; }
}
@keyframes bar-enter {
  from { opacity:0; transform:translateY(-8px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes reel-appear {
  from { opacity:0; }
  to   { opacity:1; }
}

/* ═══════════════════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════════════════ */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--bar);
  padding: 0 clamp(14px, 3vw, 32px);
  display: grid;
  grid-template-columns: minmax(160px,220px) 1fr auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(10,10,10,.82);
  backdrop-filter: blur(24px) saturate(.9);
  -webkit-backdrop-filter: blur(24px) saturate(.9);
  animation: bar-enter .35s ease both;
}

/* ─── Brand ──────────────────────────────────────────────── */
.brand { display:flex; align-items:center; gap:11px; text-decoration:none; }
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: var(--red);
  font-size: 22px; font-weight: 900; color: #fff;
  transition: opacity var(--ease);
  flex-shrink: 0;
}
.brand:hover .brand-mark { opacity: .85; }
.brand-copy strong {
  display: block; font-size: 17px;
  font-weight: 900; line-height: 1; letter-spacing: -.02em;
}
.brand-copy small {
  display: block; margin-top: 3px;
  color: var(--soft);
  font: 700 9px/1 var(--mono);
  letter-spacing: .1em; text-transform: uppercase;
}

/* ─── Feed tabs ──────────────────────────────────────────── */
.feed-tabs {
  display: flex; gap: 4px; justify-content: center;
  overflow-x: auto; scrollbar-width: none;
}
.feed-tabs::-webkit-scrollbar { display: none; }

.tab {
  min-height: 36px; padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  color: var(--muted);
  background: transparent;
  font-size: 13px; font-weight: 600;
  letter-spacing: -.01em;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--s1); }
.tab.active {
  color: var(--text);
  background: var(--s2);
  border-color: var(--line2);
}
/* Live tab — red dot only */
.tab[data-filter="live"] { display:flex; align-items:center; gap:6px; }
.tab-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  animation: live-pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

/* ─── Header actions ─────────────────────────────────────── */
.public-actions, .creator-actions {
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
}

/* Base button reset for topbar */
.auth-link, .auth-primary, .creator-btn, .profile-pill {
  min-height: 38px; display: inline-flex; align-items: center;
  border-radius: var(--r-md);
  font-size: 13px; font-weight: 700;
  transition: background var(--ease), color var(--ease),
              border-color var(--ease), opacity var(--ease),
              transform var(--ease-spring);
}
.auth-link, .auth-primary, .creator-btn, .profile-pill {
  padding: 0 16px;
}
.auth-link:active, .auth-primary:active,
.creator-btn:active, .profile-pill:active {
  transform: scale(.97);
}

.auth-link {
  background: var(--s1); border: 1px solid var(--line);
  color: var(--muted);
}
.auth-link:hover { background: var(--s2); color: var(--text); border-color: var(--line2); }

.auth-primary {
  background: var(--red); color: #fff; border: 1px solid transparent;
}
.auth-primary:hover { opacity: .88; }

.creator-btn {
  background: var(--s1); border: 1px solid var(--line);
  color: var(--muted);
}
.creator-btn:hover { background: var(--s2); color: var(--text); border-color: var(--line2); }

/* Mine live'i — red */
.creator-btn.live {
  background: var(--red); color: #fff;
  border-color: transparent;
  position: relative; overflow: hidden;
}
.creator-btn.live:hover { opacity: .9; }
.creator-btn.live::before {
  content: "";
  position: absolute; top:50%; left:10px;
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.8);
  transform: translateY(-50%);
  animation: live-pulse 1.6s ease-in-out infinite;
}
.creator-btn.live { padding-left: 24px; }

.profile-pill {
  gap: 8px; background: var(--s2);
  border: 1px solid var(--line); color: var(--text);
}
.profile-pill:hover { background: var(--s3); border-color: var(--line2); }
.profile-pill-settings {
  padding-left: 8px;
  border-left: 1px solid var(--line);
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
}
.profile-avatar {
  width: 22px; height: 22px; border-radius: var(--r-xs);
  background: var(--red);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 900; color: #fff;
  flex-shrink: 0;
}

/* ─── Auth state visibility ──────────────────────────────── */
[data-auth="guest"]   .creator-actions { display: none; }
[data-auth="creator"] .public-actions  { display: none; }
[data-auth="guest"]   .user-panel,
[data-auth="guest"]   .followed-panel,
[data-auth="guest"]   .following-live { display: none; }
[data-auth="creator"] .intro-card { display: none; }

/* ═══════════════════════════════════════════════════════════
   LAYOUT GRID
═══════════════════════════════════════════════════════════ */
.left-rail {
  position: fixed;
  top: var(--bar); left: 0;
  width: min(290px, 22vw);
  height: calc(100dvh - var(--bar));
  overflow-y: auto; overflow-x: hidden;
  padding: 28px 20px 40px;
  border-right: 1px solid var(--line);
  scrollbar-width: none;
  animation: slide-right .4s .1s ease both;
}
.left-rail::-webkit-scrollbar { display: none; }

.reels-stage {
  margin: 0;
  width: 100%;
}

.right-rail {
  position: fixed;
  top: var(--bar); right: 0;
  width: min(260px, 20vw);
  height: calc(100dvh - var(--bar));
  overflow-y: auto;
  padding: 28px 20px;
  border-left: 1px solid var(--line);
  scrollbar-width: none;
  animation: slide-right .4s .15s ease both;
}
.right-rail::-webkit-scrollbar { display: none; }

@media (min-width: 1080px) {
  .reels-stage { margin: 0; }
}
@media (max-width: 1080px) {
  .right-rail { display: none; }
  .reels-stage { margin-right: 0; }
}
@media (max-width: 720px) {
  .left-rail { display: none; }
  .reels-stage { margin-left: 0; }
}

/* ═══════════════════════════════════════════════════════════
   LEFT RAIL CONTENT
═══════════════════════════════════════════════════════════ */
.intro-card {
  animation: fade-up .4s .2s ease both;
}
.live-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(224,50,40,.3);
  border-radius: var(--r-pill);
  background: var(--red-soft);
  color: var(--red);
  font: 700 10px/1 var(--mono);
  letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 16px;
}
.live-chip i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red);
  animation: live-pulse 1.6s ease-in-out infinite;
  flex-shrink: 0; font-style: normal; /* override */
}
.live-chip i::before { content: ""; } /* empty dot via css above */

.intro-card h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900; line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--text);
}

/* Gradient accent on h1 first word */
.h1-accent {
  background: linear-gradient(135deg, var(--text) 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-card p {
  font-size: 13px; line-height: 1.65;
  color: var(--muted); margin: 0 0 20px;
}

.intro-auth {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 20px;
}
.intro-auth button {
  width: 100%; height: 40px;
  border-radius: var(--r-md); font-weight: 700; font-size: 13px;
  transition: background var(--ease), opacity var(--ease), transform var(--ease-spring);
}
.intro-auth button:first-child {
  background: var(--red); color: #fff; border: none;
}
.intro-auth button:first-child:hover { opacity: .88; }
.intro-auth button:last-child {
  background: var(--s1); color: var(--muted);
  border: 1px solid var(--line);
}
.intro-auth button:last-child:hover { background: var(--s2); color: var(--text); }
.intro-auth button:active { transform: scale(.97); }

.guest-limit {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--s1);
}
.guest-limit strong {
  display: block; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--soft); margin-bottom: 5px;
}
.guest-limit span { font-size: 12px; color: var(--soft); line-height: 1.55; }

.home-steps {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}
.home-step {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--s1);
}
.home-step span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  background: var(--s2);
  color: var(--text);
  font: 800 11px/1 var(--mono);
}
.home-step p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* ─── Stats block ────────────────────────────────────────── */
.stat-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-top: 24px;
}
.stat-cell {
  padding: 14px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--s1);
  transition: background var(--ease), border-color var(--ease);
}
.stat-cell:hover { background: var(--s2); border-color: var(--line2); }
.stat-num {
  display: block; font-size: 22px; font-weight: 900;
  letter-spacing: -.03em; line-height: 1;
  color: var(--text);
}
.stat-num--red { color: var(--red); }
.stat-lbl {
  display: block; margin-top: 4px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--soft);
}

/* ─── Privacy notice ─────────────────────────────────────── */
.notice {
  margin-top: 20px; padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid rgba(255,255,255,.2);
  border-radius: var(--r-sm);
  background: var(--s1);
}
.notice-head {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 6px;
}
.notice-hint {
  font-size: 11px; color: var(--soft); line-height: 1.6;
  margin: 0;
}

/* ─── Following live section ─────────────────────────────── */
.user-panel,
.followed-panel,
.following-live,
.all-live-panel { margin-top: 14px; }
.user-panel:first-child { margin-top: 0; }
.rail-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--s1);
}
.user-panel {
  background:
    linear-gradient(145deg, rgba(224,50,40,.16), rgba(255,255,255,.035)),
    var(--s1);
}
.user-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-panel-head strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}
.user-panel-head small {
  display: block;
  margin-top: 2px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
}
.user-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 14px;
}
.user-mini-stats span {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(0,0,0,.18);
}
.user-mini-stats b {
  display: block;
  color: var(--text);
  font-size: 17px;
  line-height: 1;
}
.user-mini-stats small {
  display: block;
  margin-top: 5px;
  color: var(--soft);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 13px;
}
.quick-actions button,
.settings-card button,
.platform-card button {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.035);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease-spring);
}
.quick-actions button:first-child,
.settings-card button:first-of-type {
  background: var(--red);
  border-color: transparent;
  color: #fff;
}
.quick-actions button:hover,
.settings-card button:hover,
.platform-card button:hover {
  background: var(--s2);
  color: var(--text);
  border-color: var(--line2);
}
.quick-actions button:active,
.settings-card button:active,
.platform-card button:active { transform: scale(.98); }
.panel-title {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--soft); margin-bottom: 12px;
}
.followed-list {
  display: grid;
  gap: 6px;
}
.followed-person {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  color: var(--muted);
}
.followed-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(224,50,40,.18);
  color: #ff6f68;
  font-size: 12px;
  font-weight: 950;
}
.followed-person strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}
.followed-person small {
  display: block;
  color: var(--soft);
  font-size: 10px;
  margin-top: 2px;
}
.live-person {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted); font-size: 13px; font-weight: 600;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
  margin-bottom: 4px;
}
.live-person:hover {
  background: var(--s1); border-color: var(--line); color: var(--text);
}
.rail-empty {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--s1);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.rail-live-list {
  display: grid;
  gap: 6px;
}
.story-avatar {
  position: relative; flex-shrink: 0;
}
.story-avatar img {
  width: 36px; height: 36px; border-radius: 50%;
  display: block;
}
.story-avatar i {
  position: absolute; bottom: -3px; left: 50%;
  transform: translateX(-50%);
  padding: 1px 5px;
  background: var(--red); color: #fff;
  font: 800 7px/1 var(--mono);
  letter-spacing: .06em;
  border-radius: var(--r-pill);
  font-style: normal; white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   REELS STAGE
═══════════════════════════════════════════════════════════ */
.reel {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  animation: reel-appear .4s ease both;
}

/* ─── Video card — portrait TikTok layout ────────────────── */
.video-card {
  position: relative;
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 100vh;
  border-radius: 0;
  border: 0;
  background: var(--bg2);
  overflow: hidden;
  display: block;
  transition: border-color var(--ease), box-shadow var(--ease);
  animation: none;
  transform: none;
}
.video-card:hover {
  border-color: var(--line2);
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
}

/* ─── Media / thumbnail area — 9:16 portrait ─────────────── */
.media-art {
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: #0f0f0f;
}
/* All themes: subtle dark gradient — no loud colors in chrome */
.theme-red    .media-art { background: linear-gradient(160deg,#1a0808,#0f0f0f); }
.theme-blue   .media-art { background: linear-gradient(160deg,#080d14,#0f0f0f); }
.theme-purple .media-art { background: linear-gradient(160deg,#100a1a,#0f0f0f); }
.theme-live   .media-art { background: linear-gradient(160deg,#150808,#0f0f0f); }

/* Scanlines */
.media-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 3px,
    rgba(255,255,255,.012) 3px, rgba(255,255,255,.012) 4px
  );
}

/* Visual ring decoration */
.ring {
  position: absolute;
  width: 160px; height: 160px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.07);
  animation: live-ring 3.5s ease-out infinite;
}
.ring::before {
  content: ""; position: absolute; inset: 20px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.05);
}

/* Play button */
.play {
  position: relative; z-index: 2;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  color: var(--text);
  font-size: 18px;
  display: grid; place-items: center;
  backdrop-filter: blur(8px);
  transition: background var(--ease), transform var(--ease-spring), border-color var(--ease);
}
.play:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.3);
  transform: scale(1.1);
}
.play:active { transform: scale(.95); }

/* Ball decoration variant */
.media-art.ball .ring { width:200px; height:200px; }

/* ─── Live broadcast card ────────────────────────────────── */
.live-broadcast {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; z-index: 2;
}
.live-preview-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  opacity: 0;
  transition: opacity .25s ease;
}
.has-live-video .live-preview-video { opacity: 1; }
.has-live-video .live-broadcast {
  opacity: 0;
  pointer-events: none;
}
.live-goal-preview {
  position: absolute;
  left: 16px;
  right: 78px;
  top: 72px;
  z-index: 5;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(0,0,0,.54);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
}
.live-goal-preview strong {
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 3px;
}
.live-goal-preview span {
  font-size: 11px;
  color: rgba(255,255,255,.72);
}
.live-goal-preview i {
  display: block;
  height: 5px;
  margin-top: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  overflow: hidden;
}
.live-goal-preview em {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--red);
}
.live-orbit {
  position: absolute; inset: 0; border-radius: 0;
  pointer-events: none;
}
.live-orbit::before, .live-orbit::after {
  content: ""; position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(224,50,40,.25);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.live-orbit::before { width: 140px; height: 140px; animation: live-ring 2.8s ease-out infinite; }
.live-orbit::after  { width: 90px; height: 90px;  animation: live-ring 2.8s .7s ease-out infinite; }

.live-broadcast strong {
  position: relative; z-index: 1;
  font: 900 11px/1 var(--mono);
  letter-spacing: .14em; color: #fff;
  padding: 4px 12px;
  background: var(--red);
  border-radius: var(--r-xs);
}
.live-broadcast small {
  position: relative; z-index: 1;
  font-size: 12px; color: var(--muted); text-align: center;
  padding: 0 20px; line-height: 1.5;
}

/* ─── Reel copy — gradient overlay at bottom of media ───────── */
.reel-copy {
  position: absolute;
  inset: auto min(340px, 26vw) 0 min(320px, 24vw);
  padding: 140px 24px 34px;
  background: linear-gradient(
    0deg,
    rgba(0,0,0,.94) 0%,
    rgba(0,0,0,.6)  50%,
    transparent     100%
  );
  z-index: 3;
  display: flex; flex-direction: column; gap: 0;
  pointer-events: none;       /* clicks pass through to media */
}
.reel-copy > * { pointer-events: auto; }

.author-line {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 10px;
}
.avatar {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.14); display: grid; place-items: center;
  font-size: 12px; font-weight: 900; color: #fff;
  flex-shrink: 0; border: 1px solid rgba(255,255,255,.2);
  text-decoration: none;
}
.profile-trigger.avatar {
  border: 1px solid rgba(255,255,255,.2);
  padding: 0;
}
.author-name {
  display: block;
  max-width: 100%;
  padding: 0;
  color: #fff;
  text-align: left;
}
.author-name strong {
  display: block;
}
.avatar.amber { background: rgba(255,189,61,.25); color: #ffbd3d; }
.avatar.blue  { background: rgba(91,184,255,.2);  color: #5bb8ff; }
.author-line > div { flex: 1; min-width: 0; }
.author-line strong {
  display: block; font-size: 13px; font-weight: 800; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.author-line a { text-decoration: none; }
.author-line small {
  display: flex; align-items: center; gap: 5px;
  margin-top: 2px; font-size: 11px; color: rgba(255,255,255,.6);
}
.author-line small i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red);
  animation: live-pulse 1.6s ease-in-out infinite;
  flex-shrink: 0; font-style: normal;
}

.follow-btn {
  flex-shrink: 0;
  height: 28px; padding: 0 13px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22);
  color: #fff; font-size: 11px; font-weight: 700;
  transition: background var(--ease), transform var(--ease-spring);
}
.follow-btn:hover { background: rgba(255,255,255,.24); }
.follow-btn.following { background: rgba(255,255,255,.08); color: rgba(255,255,255,.6); }
.follow-btn:active { transform: scale(.96); }

.reel-copy h2 {
  margin: 0 0 6px; color: #fff;
  font-size: clamp(22px, 3vw, 42px);
  font-weight: 800; line-height: 1.3;
  letter-spacing: -.02em;
}
.reel-copy p {
  margin: 0 0 10px;
  font-size: clamp(13px, 1.4vw, 17px); line-height: 1.6;
  color: rgba(255,255,255,.72);
}
.tags {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.tags span {
  padding: 3px 8px;
  border-radius: var(--r-xs);
  background: rgba(0,0,0,.42); border: 1px solid rgba(255,255,255,.14);
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,.75);
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.tags span:hover { background: rgba(255,255,255,.18); color: #fff; }
.tags span.tag-active {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.38);
  color: #fff;
}
.tags .vis-badge {
  background: rgba(0,0,0,.3); border-color: rgba(255,255,255,.1);
  color: rgba(255,255,255,.45); cursor: default; font-style: italic;
}

/* ─── Action stack — TikTok-style right-side overlay ─────── */
.reel { position: relative; }

.action-stack {
  position: absolute;
  right: max(24px, min(300px, 22vw));
  bottom: 96px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  z-index: 4;
  animation: fade-in .4s .25s ease both;
}

/* Each action = circle + label below it */
.action-stack button {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: auto; min-height: unset; padding: 0;
  background: none; border: none;
  cursor: pointer; color: #fff;
  transition: transform var(--ease-spring), opacity var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.action-stack button:hover  { opacity: .85; }
.action-stack button:active { transform: scale(.88); }

/* The actual circle icon */
.action-stack button .act-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,.52);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.10);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;
  transition: background var(--ease), transform var(--ease-spring);
  box-shadow: 0 2px 12px rgba(0,0,0,.28);
}
.action-stack button:hover  .act-icon { background: rgba(255,255,255,.16); }
.action-stack button.active .act-icon {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.30);
}

/* The count/label below circle */
.action-stack button strong {
  display: block;
  font-size: 10px; font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  letter-spacing: .01em; line-height: 1;
  text-align: center;
  white-space: nowrap;
}

/* Active reaction state */
.action-stack button.active .act-icon {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.30);
  animation: icon-pop .3s var(--ease-spring) both;
}
@keyframes icon-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.28); }
  100% { transform: scale(1); }
}

/* Locked / guest state */
.action-stack button[data-locked] { opacity: .68; }
.action-stack button[data-locked] .act-icon { border-style: dashed; }

/* ─── Reel meta bar — below video card ───────────────────── */
.reel-meta-bar {
  position: absolute;
  left: min(320px, 24vw);
  bottom: 10px;
  z-index: 5;
  padding: 8px 14px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2);
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--soft);
}
.view-count { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.view-count svg { opacity: .5; }
.algo-badge {
  margin-left: auto;
  font: 700 9px/1 var(--mono);
  color: var(--dim);
  text-transform: uppercase; letter-spacing: .06em;
}

/* ─── Locked reel ────────────────────────────────────────── */
.locked-preview .video-card {
  background: var(--bg2); display: flex; flex-direction: column;
}
.locked-panel {
  padding: 48px 28px; min-height: 320px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 14px;
}
.locked-panel span {
  font: 700 10px/1 var(--mono);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--soft);
}
.locked-panel h2 {
  font-size: 22px; font-weight: 900; letter-spacing: -.025em;
  line-height: 1.2; color: var(--text); max-width: 280px;
}
.locked-panel p {
  font-size: 13px; color: var(--muted); line-height: 1.65; max-width: 300px;
}
.empty-feed-reel .video-card {
  background:
    radial-gradient(circle at 50% 36%, rgba(224,50,40,.14), transparent 34%),
    linear-gradient(160deg,#120808,#0f0f0f);
}
.empty-feed-reel .locked-panel {
  min-height: 100%;
}
.empty-feed-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.empty-feed-actions button + button {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
}
.locked-panel button {
  height: 42px; padding: 0 24px;
  background: var(--red); color: #fff;
  border-radius: var(--r-md); font-size: 14px; font-weight: 800;
  transition: opacity var(--ease), transform var(--ease-spring);
  border: none;
}
.locked-panel button:hover { opacity: .87; }
.locked-panel button:active { transform: scale(.97); }

/* ═══════════════════════════════════════════════════════════
   RIGHT RAIL
═══════════════════════════════════════════════════════════ */
.profile-card { animation: fade-up .4s .2s ease both; }

.rail-kicker {
  display: block;
  margin-bottom: 9px;
  color: var(--soft);
  font: 800 10px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.guest-state strong {
  display: block; font-size: 15px; font-weight: 900;
  letter-spacing: -.02em; margin-bottom: 8px;
}
.guest-state p { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.guest-state button {
  width: 100%; height: 38px;
  background: var(--red); color: #fff;
  border-radius: var(--r-md); font-size: 13px; font-weight: 700;
  border: none;
  transition: opacity var(--ease), transform var(--ease-spring);
}
.guest-state button:hover { opacity: .88; }
.guest-state button:active { transform: scale(.97); }

[data-auth="creator"] .guest-state  { display: none; }
[data-auth="guest"]   .creator-state { display: none; }

.creator-state {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}
.profile-photo {
  width: 44px; height: 44px; border-radius: var(--r-sm);
  background: var(--red); display: grid; place-items: center;
  font-size: 20px; font-weight: 900; color: #fff;
}
.creator-state strong { font-size: 14px; font-weight: 800; }
.verified { font-size: 11px; color: var(--soft); line-height: 1.55; margin: 0; }
.profile-tools { display: flex; flex-direction: column; gap: 7px; width: 100%; margin-top: 4px; }
.profile-tools button {
  width: 100%; height: 36px;
  background: var(--s1); border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 12px; font-weight: 700;
  color: var(--muted);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.profile-tools button:hover { background: var(--s2); color: var(--text); border-color: var(--line2); }
.profile-tools button:last-child {
  background: var(--red); color: #fff; border-color: transparent;
}
.profile-tools button:last-child:hover { opacity: .88; }
.profile-tools button[data-open-settings] {
  background: var(--s2);
  color: var(--text);
  border-color: var(--line2);
}

.settings-card,
.safety-card,
.trending-card,
.platform-card {
  margin-top: 14px;
  animation: fade-up .4s .25s ease both;
}
.settings-card,
.platform-card {
  display: grid;
  gap: 8px;
}
.settings-card .panel-title,
.platform-card .panel-title { margin-bottom: 4px; }
.platform-card {
  margin-top: 18px;
  padding-top: 14px;
  background: rgba(255,255,255,.025);
}
.platform-card button {
  min-height: 30px;
  justify-content: flex-start;
  text-align: left;
  font-size: 11px;
  background: transparent;
}
.platform-card small {
  margin-top: 4px;
  color: var(--soft);
  font-size: 10px;
}
.clean-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}
.clean-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.clean-list span {
  color: var(--red);
  font-weight: 900;
}
.trending-card {
  display: grid;
  gap: 7px;
}
.trending-card .panel-title { margin-bottom: 5px; }
.trending-card button {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 12px;
  font-weight: 700;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.trending-card button:hover {
  color: var(--text);
  border-color: var(--line2);
  background: var(--s2);
}
.trending-card button span {
  color: var(--soft);
  font: 800 10px/1 var(--mono);
}

/* ═══════════════════════════════════════════════════════════
   BOTTOM NAV (mobile)
═══════════════════════════════════════════════════════════ */
.bottom-auth {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(10,10,10,.88);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(20px);
  gap: 8px;
}
@media (max-width: 720px) {
  .bottom-auth { display: flex; }
  .reels-stage .reel { padding-bottom: 0; }
}
.bottom-auth button {
  flex: 1; height: 40px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 700;
  transition: background var(--ease), opacity var(--ease), transform var(--ease-spring);
}
.bottom-auth button:active { transform: scale(.97); }
.bottom-auth button:first-child {
  background: var(--s1); color: var(--muted);
  border: 1px solid var(--line);
}
.bottom-auth button:first-child:hover { background: var(--s2); color: var(--text); }
.bottom-auth button:nth-child(2) {
  background: var(--red); color: #fff; border: none;
}
.bottom-auth button:nth-child(2):hover { opacity: .88; }
.bottom-auth .creator-only { display: none; }
[data-auth="creator"] .bottom-auth .creator-only { display: flex; }
[data-auth="creator"] .bottom-auth button:first-child,
[data-auth="creator"] .bottom-auth button:nth-child(2) { display: none; }
.bottom-auth .live {
  background: var(--red) !important; color: #fff !important; border: none !important;
}

/* ═══════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(12px);
  /* flex column + overflow-y: auto — modal itself scrolls if card overflows viewport */
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px;
  overflow-y: auto;
  opacity: 0; pointer-events: none;
  transition: opacity var(--ease);
}
.modal.open { opacity: 1; pointer-events: all; }
.modal.open .modal-card { transform: scale(1); }

/* Body scroll lock — see full rule further below (position:fixed + top offset) */

.modal-card {
  position: relative;
  background: #161616;
  border: 1px solid var(--line2);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  width: min(420px, 100%);
  transform: scale(.94);
  transition: transform .28s cubic-bezier(.34,1.4,.64,1);
  box-shadow: 0 32px 100px rgba(0,0,0,.7);
}

.close {
  position: absolute; top: 16px; right: 18px;
  width: 30px; height: 30px; border-radius: var(--r-xs);
  background: var(--s1); border: 1px solid var(--line);
  color: var(--soft); font-size: 18px; line-height: 1;
  display: grid; place-items: center;
  transition: background var(--ease), color var(--ease);
}
.close:hover { background: var(--s2); color: var(--text); }

.eyebrow {
  font: 700 10px/1 var(--mono);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--soft); margin: 0 0 8px;
}
.modal-card h2 {
  font-size: 22px; font-weight: 900;
  letter-spacing: -.025em; margin: 0 0 8px;
}
.modal-copy {
  font-size: 13px; color: var(--muted); line-height: 1.65;
  margin: 0 0 22px;
}

/* Auth tabs */
.auth-tabs-modal {
  display: flex; gap: 4px;
  margin-bottom: 20px;
}
.auth-tabs-modal button {
  flex: 1; height: 36px;
  background: var(--s1); border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--muted); font-size: 13px; font-weight: 700;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.auth-tabs-modal button.active {
  background: var(--s3); color: var(--text); border-color: var(--line2);
}

/* Form */
.auth-form { display: none; flex-direction: column; gap: 12px; }
.auth-form.active { display: flex; }
.auth-form label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--soft);
}
.auth-form input {
  height: 42px; padding: 0 13px;
  background: var(--s1); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--text);
  font-size: 14px;
  transition: border-color var(--ease), background var(--ease);
  outline: none;
}
.auth-form input:focus { border-color: var(--line2); background: var(--s2); }
.auth-form .check {
  flex-direction: row; align-items: flex-start; gap: 10px;
  font-size: 12px; text-transform: none; letter-spacing: 0;
  color: var(--muted); font-weight: 400;
}
.auth-form .check input { width: auto; height: auto; flex-shrink: 0; }

/* Optional field label */
.field-optional {
  font-size: 10px; font-weight: 600;
  color: var(--dim); text-transform: none;
  letter-spacing: 0; margin-left: 4px;
}

/* Password match hint */
.pw-match-hint {
  font-size: 11px; font-weight: 700;
  min-height: 16px; margin-top: -4px;
  transition: color var(--ease);
}
.pw-match-hint.pw-ok  { color: #4caf7d; }
.pw-match-hint.pw-err { color: var(--red); }
.submit {
  height: 44px; width: 100%;
  background: var(--red); color: #fff;
  border-radius: var(--r-md); font-size: 14px; font-weight: 800;
  border: none; margin-top: 4px;
  transition: opacity var(--ease), transform var(--ease-spring);
}
.submit:hover { opacity: .88; }
.submit:active { transform: scale(.98); }

/* Creator grid — layout only (full card styles are in UI overhaul section at end of file) */

/* ═══════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════ */
#toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(6px);
  z-index: 300;
  padding: 10px 18px;
  background: #1e1e1e;
  border: 1px solid var(--line2);
  border-radius: var(--r-md);
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
#toast.show {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   UPLOAD + MODERATION FLOW (form components)
═══════════════════════════════════════════════════════════ */
.form-grid { display:flex; flex-direction:column; gap:12px; }
.field-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.field { display:flex; flex-direction:column; gap:5px; }
.field-label {
  font-size:11px; font-weight:700; color:var(--soft);
  text-transform:uppercase; letter-spacing:.04em;
}

input, select, textarea {
  width:100%; min-height:42px; padding:0 12px;
  background:var(--s1); border:1px solid var(--line);
  border-radius:var(--r-sm); color:var(--text);
  font-size:13.5px; outline:none;
  transition:border-color var(--ease), background var(--ease);
}
textarea { min-height:80px; padding:10px 12px; resize:vertical; }
input:focus, select:focus, textarea:focus {
  border-color:var(--line2); background:var(--s2);
}

/* ═══════════════════════════════════════════════════════════
   SEARCH (topbar search input)
═══════════════════════════════════════════════════════════ */
.search-wrap { position:relative; display:flex; align-items:center; }
.search-input {
  width:0; min-height:36px; padding:0;
  border:none; border-radius:var(--r-sm);
  background:var(--s1);
  overflow:hidden; opacity:0;
  transition:width .25s ease, padding .25s ease, opacity .2s ease;
}
.search-wrap.open .search-input {
  width:180px; padding:0 12px 0 36px; opacity:1;
  border:1px solid var(--line);
}
.search-icon {
  position:absolute; left:10px;
  width:15px; height:15px; color:var(--soft);
  pointer-events:none;
}

/* ═══════════════════════════════════════════════════════════
   GO-LIVE BUTTON PULSE (topbar)
═══════════════════════════════════════════════════════════ */
.go-live-btn {
  display:inline-flex; align-items:center; gap:8px;
  height:38px; padding:0 16px;
  background:var(--red); color:#fff;
  border-radius:var(--r-md); font-size:13px; font-weight:800;
  border:none; position:relative; overflow:hidden;
  transition:opacity var(--ease), transform var(--ease-spring);
}
.go-live-btn:hover { opacity:.88; }
.go-live-btn:active { transform:scale(.97); }
.go-live-btn .go-live-dot {
  width:7px; height:7px; border-radius:50%; background:#fff;
  animation:live-pulse 1.4s ease-in-out infinite; flex-shrink:0;
}

/* ═══════════════════════════════════════════════════════════
   COIN / GIFT UI (from live page)
═══════════════════════════════════════════════════════════ */
.coin-chip {
  display:inline-flex; align-items:center; gap:7px;
  height:38px; padding:0 14px;
  background:rgba(255,189,61,.1); border:1px solid rgba(255,189,61,.22);
  border-radius:var(--r-md); color:#ffbd3d;
  font-size:13px; font-weight:800;
  transition:background var(--ease), transform var(--ease-spring);
}
.coin-chip:hover { background:rgba(255,189,61,.17); }
.coin-chip:active { transform:scale(.96); }

/* ═══════════════════════════════════════════════════════════
   SCROLL SNAP / html overrides
═══════════════════════════════════════════════════════════ */
/* Disable snap on non-feed pages */
html.no-snap { scroll-snap-type:none; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE TWEAKS
═══════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .modal-card h2 { font-size:20px; }
  .field-row { grid-template-columns:1fr; }
}
@media (max-width: 600px) {
  .reel { padding: 0; align-items: stretch; }
  .video-card { max-width: none; border-radius: 0; border-left: 0; border-right: 0; }
  .reel-copy {
    inset: auto 66px 0 0;
    padding: 92px 12px calc(86px + env(safe-area-inset-bottom)) 14px;
  }
  .reel-copy h2 { font-size: 20px; }
  .action-stack { right: 8px; bottom: 88px; gap: 16px; }
  .action-stack button .act-icon { width: 44px; height: 44px; font-size: 20px; }
  .modal-card { padding:26px 20px; border-radius:var(--r-lg); }
  .reel-meta-bar {
    left: 14px;
    bottom: calc(58px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }
  .feed-tabs {
    position: fixed;
    top: calc(var(--bar) + 8px);
    left: 12px;
    right: 12px;
    justify-content: flex-start;
    padding: 0 2px;
  }
  .reel {
    padding-top: 0;
  }
}

@media (max-width: 720px) {
  .feed-tabs {
    top: calc(var(--bar) + 6px);
  }
  .reel {
    padding-top: 0;
  }
}

/* ─── Locked preview — hide action stack (no video) ──────── */
.locked-panel > .action-stack,
.locked-preview .action-stack { display: none; }

/* ═══════════════════════════════════════════════════════════
   GALLERY VIEW
═══════════════════════════════════════════════════════════ */
.gallery-stage {
  margin: var(--bar) auto 0;
  padding: 0 20px 40px;   /* no top padding — controls handle it */
  max-width: 900px;
}
@media (min-width: 1080px) {
  .gallery-stage { margin-left: min(290px,22vw); margin-right: min(260px,20vw); max-width: none; }
}

.gallery-controls {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: var(--bar);
  z-index: 20;
  background: var(--bg);
  padding: 12px 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.gal-filter {
  height: 34px; padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 700;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
  white-space: nowrap;
}
.gal-filter:hover { color: var(--text); background: var(--s1); }
.gal-filter.active {
  color: var(--text); background: var(--s2);
  border-color: var(--line2);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.gallery-empty {
  grid-column: 1 / -1;
  min-height: min(460px, 62vh);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--s1);
}
.gallery-empty span {
  font: 800 10px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--soft);
}
.gallery-empty strong {
  max-width: 360px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}
@media (max-width: 720px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 2px; }
  .gallery-stage { padding: 12px; }
}

.gallery-item {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg2);
  border-radius: 4px;
}
.gallery-item:hover .gal-overlay { opacity: 1; }
.gallery-item:hover .gal-thumb { transform: scale(1.04); }

.gal-thumb {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s ease;
}
/* Colour themes for gallery thumbnails */
.gal-thumb.t-red    { background: linear-gradient(160deg,#200a0a,#0f0f0f); }
.gal-thumb.t-blue   { background: linear-gradient(160deg,#0a0e16,#0f0f0f); }
.gal-thumb.t-purple { background: linear-gradient(160deg,#130b1a,#0f0f0f); }
.gal-thumb.t-live   { background: linear-gradient(160deg,#1a0808,#0f0f0f); }
.gal-thumb.t-gray   { background: linear-gradient(160deg,#141414,#0f0f0f); }

.gal-thumb-icon { font-size: 28px; opacity: .35; }
.gal-live-chip {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 7px;
  background: var(--red); border-radius: var(--r-xs);
  font: 800 8px/1 var(--mono); color: #fff;
  letter-spacing: .1em; text-transform: uppercase;
}
.gal-media-type {
  position: absolute; bottom: 8px; right: 8px;
  font-size: 10px; color: rgba(255,255,255,.5);
}

.gal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity .2s ease;
}
.gal-overlay-stats {
  display: flex; gap: 14px;
  font-size: 12px; font-weight: 700; color: #fff;
}
.gal-overlay-title {
  font-size: 11px; color: rgba(255,255,255,.75);
  padding: 0 10px; text-align: center; line-height: 1.4;
  max-width: 120px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Post lightbox */
.post-lightbox {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.post-lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox-inner {
  display: flex; gap: 0;
  width: min(860px, 100%); max-height: 90dvh;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line2);
  transform: scale(.95);
  transition: transform .28s cubic-bezier(.34,1.4,.64,1);
}
.post-lightbox.open .lightbox-inner { transform: scale(1); }
.lightbox-media {
  flex: 0 0 360px;
  aspect-ratio: 9/16;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-media .media-art { width:100%; height:100%; aspect-ratio: unset; border-radius:0; }
.lightbox-panel {
  flex: 1;
  background: #161616;
  display: flex; flex-direction: column;
  overflow: hidden;
  max-height: 90dvh;
}
.lightbox-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.lightbox-header h3 {
  margin: 0 0 6px; font-size: 16px; font-weight: 800;
  letter-spacing: -.02em; line-height: 1.3;
}
.lightbox-header p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.lightbox-stats {
  display: flex; gap: 16px; padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--soft); flex-shrink: 0;
}
.lstat { display: flex; align-items: center; gap: 5px; font-weight: 700; }
.lightbox-reactions {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.react-pill {
  height: 32px; padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--s1); border: 1px solid var(--line);
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: background var(--ease), border-color var(--ease), transform var(--ease-spring);
}
.react-pill:hover { background: var(--s2); border-color: var(--line2); }
.react-pill:active { transform: scale(.94); }
.react-pill span { font-size: 10px; font-weight: 700; color: var(--soft); }
.react-pill.active { background: var(--red-soft); border-color: rgba(224,50,40,.35); }

.lightbox-comments {
  flex: 1; overflow-y: auto;
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.comment-item { display: flex; gap: 10px; }
.comment-ava {
  width: 28px; height: 28px; border-radius: var(--r-xs);
  background: var(--s3); display: grid; place-items: center;
  font-size: 11px; font-weight: 900; color: var(--soft);
  flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-body strong {
  display: block; font-size: 12px; font-weight: 800; margin-bottom: 3px;
}
.comment-body p {
  margin: 0; font-size: 12px; color: var(--muted); line-height: 1.55;
}
.comment-time { font-size: 10px; color: var(--dim); margin-top: 3px; }
.lightbox-comment-form {
  padding: 12px 18px 14px;
  border-top: 1px solid var(--line);
  display: flex; gap: 8px; flex-shrink: 0;
}
.lightbox-comment-form input {
  flex: 1; height: 36px; font-size: 12px; min-height: unset;
}
.lightbox-comment-form button {
  height: 36px; padding: 0 14px;
  background: var(--red); color: #fff;
  border-radius: var(--r-sm); font-size: 12px; font-weight: 800;
  border: none;
  transition: opacity var(--ease);
}
.lightbox-comment-form button:hover { opacity: .88; }
.lightbox-close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 32px; height: 32px; border-radius: var(--r-xs);
  background: rgba(0,0,0,.5); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff; font-size: 18px;
  display: grid; place-items: center;
}
.lightbox-close:hover { background: rgba(255,255,255,.18); }

@media (max-width: 700px) {
  .lightbox-inner { flex-direction: column; max-height: 95dvh; }
  .lightbox-media { flex: 0 0 auto; width: 100%; aspect-ratio: 9/5; }
  .lightbox-media .media-art { aspect-ratio: unset; height: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   GALLERY TAB + VIEW TOGGLE IN TOPBAR
═══════════════════════════════════════════════════════════ */
/* Gallery tab has a grid icon */
.tab[data-filter="gallery"]::before {
  content: "⊞ ";
  font-size: 10px; opacity: .65;
}

/* ═══════════════════════════════════════════════════════════
   UPLOAD MODAL — multi-step
═══════════════════════════════════════════════════════════ */
.upload-modal .modal-card {
  width:min(520px,100%); padding:0; overflow:hidden;
  display:flex; flex-direction:column;
  height:min(90dvh, 820px);
}

.upload-steps-nav {
  display:flex; gap:0;
  border-bottom:1px solid var(--line);
  padding:0 24px;
  overflow-x:auto; scrollbar-width:none;
}
.upload-steps-nav::-webkit-scrollbar { display:none; }
.upload-step-dot {
  display:flex; align-items:center; gap:7px;
  height:44px; padding:0 12px;
  font-size:11px; font-weight:700; color:var(--dim);
  border-bottom:2px solid transparent; white-space:nowrap;
  transition:color var(--ease), border-color var(--ease);
}
.upload-step-dot.active { color:var(--text); border-color:var(--red); }
.upload-step-dot.done   { color:var(--soft); }
.upload-step-num {
  width:20px; height:20px; border-radius:50%;
  background:var(--s2); border:1px solid var(--line);
  display:grid; place-items:center;
  font-size:10px; font-weight:900;
  transition:background var(--ease), border-color var(--ease);
}
.upload-step-dot.active .upload-step-num {
  background:var(--red); border-color:transparent; color:#fff;
}
.upload-step-dot.done .upload-step-num {
  background:rgba(76,175,125,.2); border-color:rgba(76,175,125,.4); color:#4caf7d;
}

.upload-body { padding:24px 24px 20px; overflow-y:auto; overflow-x:hidden; flex:1 1 auto; min-height:0; scrollbar-width:thin; scrollbar-color:var(--line) transparent; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
.upload-panel { display:none; }
.upload-panel.active { display:flex; flex-direction:column; gap:12px; animation:fade-up .25s ease both; }

/* Drop zone */
.drop-zone {
  border:2px dashed var(--line2);
  border-radius:var(--r-md);
  padding:32px 20px;
  text-align:center;
  cursor:pointer;
  transition:border-color var(--ease), background var(--ease);
  position:relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color:var(--red); background:var(--red-soft);
}
.drop-zone input[type="file"] {
  position:absolute; inset:0; opacity:0; cursor:pointer;
  width:100%; height:100%; min-height:unset; padding:0; border:none;
}
/* .drop-zone-icon — styles moved to UI overhaul section */
.drop-zone p { font-size:13px; color:var(--muted); margin:0; line-height:1.6; }
.drop-zone strong { color:var(--text); }
.drop-zone-hint { font-size:11px; color:var(--dim); margin-top:6px !important; }
.drop-zone-selected {
  margin-top:12px; padding:10px 14px;
  background:var(--s2); border:1px solid var(--line);
  border-radius:var(--r-sm);
  display:flex; align-items:center; gap:10px;
  font-size:12px; font-weight:700; color:var(--text);
}
.drop-zone-selected .file-icon { font-size:20px; }
.drop-zone-selected .file-info { flex:1; min-width:0; }
.drop-zone-selected .file-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.drop-zone-selected .file-size { font-size:10px; color:var(--soft); font-weight:600; }

/* Visibility selector */
.vis-selector {
  display:grid; grid-template-columns:1fr 1fr;
  gap:6px; margin-top:4px;
}
.vis-option {
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:var(--r-sm); background:var(--s1);
  cursor:pointer; text-align:left;
  transition:border-color var(--ease), background var(--ease);
}
.vis-option.active { border-color:var(--red); background:var(--red-soft); }
.vis-option strong { display:block; font-size:12px; font-weight:800; margin-bottom:2px; }
.vis-option span { font-size:11px; color:var(--soft); }
.vis-option.active strong { color:var(--red); }

/* Hashtag input */
.hashtag-input-wrap { position:relative; }
.hashtag-chips {
  display:flex; flex-wrap:wrap; gap:5px; margin-top:7px;
}
.hashtag-chip {
  padding:3px 8px;
  background:var(--s2); border:1px solid var(--line);
  border-radius:var(--r-xs); font-size:11px; font-weight:600; color:var(--muted);
  display:flex; align-items:center; gap:5px;
}
.hashtag-chip button {
  font-size:13px; color:var(--dim); line-height:1;
  padding:0; width:14px; height:14px;
  transition:color var(--ease);
}
.hashtag-chip button:hover { color:var(--text); }

/* Privacy checklist */
.privacy-checks { display:flex; flex-direction:column; gap:10px; }
.privacy-check-item {
  display:flex; gap:11px; align-items:flex-start;
  padding:11px 13px;
  border:1px solid var(--line); border-radius:var(--r-sm);
  background:var(--s1); cursor:pointer;
  transition:border-color var(--ease), background var(--ease);
}
.privacy-check-item:has(input:checked) {
  border-color:rgba(76,175,125,.4); background:rgba(76,175,125,.06);
}
.privacy-check-item input { margin-top:2px; accent-color:var(--red); flex-shrink:0; }
.privacy-check-item .pci-text { font-size:12px; color:var(--muted); line-height:1.55; }
.privacy-check-item .pci-text strong { display:block; font-size:12px; color:var(--text); margin-bottom:2px; }

/* Upload footer nav */
.upload-footer {
  padding:14px 24px 20px;
  border-top:1px solid var(--line);
  display:flex; gap:8px; align-items:center;
  flex-shrink:0;
}
/* Upload footer inherits global .back-btn; just needs height match */
.upload-footer .back-btn { height:44px; }
.upload-footer .next-btn {
  flex:1; height:44px;
  background:var(--red); color:#fff;
  border-radius:var(--r-sm); font-size:13px; font-weight:800; border:none;
  letter-spacing:-.01em;
  transition:opacity var(--ease), transform var(--ease-spring);
}
.upload-footer .next-btn:hover { opacity:.88; }
.upload-footer .next-btn:active { transform:scale(.97); }
.upload-footer .next-btn:disabled { opacity:.4; cursor:not-allowed; }

/* ═══════════════════════════════════════════════════════════
   LIVE SETUP MODAL
═══════════════════════════════════════════════════════════ */
.live-setup-modal .modal-card {
  width:min(540px,100%); padding:0; overflow:hidden;
  display:flex; flex-direction:column;
  /* height: not max-height — gives flex children a definite reference to fill */
  height:min(90dvh, 860px);
  /* but allow card to be shorter on small content */
  min-height:min(60dvh, 560px);
}
/* Fade hint at bottom of scrollable body — shows content continues below */
.live-setup-body-wrap {
  position:relative; flex:1 1 auto; min-height:0; overflow:hidden;
  display:flex; flex-direction:column;
}
.live-setup-body-wrap::after {
  content:'';
  position:absolute; bottom:0; left:0; right:0;
  height:40px;
  background:linear-gradient(to bottom, transparent, rgba(17,17,17,.85));
  pointer-events:none; z-index:2;
  opacity:1;
  transition:opacity .2s;
}
.live-setup-header {
  padding:20px 24px 16px;
  border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:12px;
}
.live-setup-header .live-indicator {
  width:10px; height:10px; border-radius:50%; background:var(--red);
  animation:live-pulse 1.6s ease-in-out infinite; flex-shrink:0;
}
.live-setup-header h2 { margin:0; font-size:19px; font-weight:900; letter-spacing:-.025em; }
.live-setup-body {
  padding:20px 24px 26px;
  display:flex; flex-direction:column; gap:14px;
  /* Scroll when content overflows — footer stays pinned */
  overflow-y:auto; overflow-x:hidden;
  flex:1 1 auto; min-height:0;
  scrollbar-width:thin; scrollbar-color:var(--line) transparent;
  /* iOS Safari momentum scroll */
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}

/* Camera preview */
.cam-preview-box {
  border:1px solid var(--line); border-radius:var(--r-md);
  overflow:hidden; background:#0a0a0a;
  aspect-ratio:16/9; position:relative;
  display:flex; align-items:center; justify-content:center;
}
#live-setup-cam { width:100%; height:100%; object-fit:cover; display:block; }
.cam-placeholder {
  display:flex; flex-direction:column; align-items:center; gap:8px;
  color:var(--soft); font-size:13px;
}
.cam-placeholder span { font-size:32px; }
.cam-preview-controls {
  position:absolute; bottom:10px; left:50%;
  transform:translateX(-50%);
  display:flex; gap:6px;
}
.cam-ctrl-btn {
  height:32px; padding:0 12px;
  background:rgba(0,0,0,.55); backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,.15);
  border-radius:var(--r-pill); color:#fff;
  font-size:11px; font-weight:700;
  transition:background var(--ease);
}
.cam-ctrl-btn:hover { background:rgba(255,255,255,.18); }
.cam-ctrl-btn.active { background:var(--red); border-color:transparent; }

/* Donation goal section */
.goal-toggle-row {
  display:flex; align-items:center; justify-content:space-between;
  gap:14px;
  padding:12px 14px;
  border:1px solid var(--line); border-radius:var(--r-sm); background:var(--s1);
  cursor:pointer; transition:background var(--ease), border-color var(--ease);
}
.goal-toggle-row:has(.kzk-toggle:checked) { border-color:rgba(76,175,125,.35); background:rgba(76,175,125,.05); }
.goal-toggle-label { font-size:13px; font-weight:700; }
.goal-toggle-desc { font-size:11px; color:var(--soft); margin-top:2px; }
.kzk-toggle-wrap {
  position:relative;
  width:46px;
  height:28px;
  flex:0 0 auto;
}
.kzk-toggle {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  opacity:0;
  cursor:pointer;
  z-index:2;
}
.kzk-toggle-track {
  position:absolute;
  inset:0;
  display:block;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
  transition:background var(--ease), border-color var(--ease);
}
.kzk-toggle-thumb {
  position:absolute;
  top:4px;
  left:4px;
  width:18px;
  height:18px;
  border-radius:50%;
  background:rgba(255,255,255,.72);
  box-shadow:0 6px 18px rgba(0,0,0,.45);
  transition:transform var(--ease-spring), background var(--ease);
}
.kzk-toggle:checked + .kzk-toggle-track {
  background:linear-gradient(135deg, #e03228, #f59e0b);
  border-color:rgba(255,255,255,.18);
}
.kzk-toggle:checked + .kzk-toggle-track .kzk-toggle-thumb {
  transform:translateX(18px);
  background:#fff;
}
.goal-fields {
  display:none; flex-direction:column; gap:10px;
  padding:14px; background:var(--s1);
  border:1px solid var(--line); border-radius:var(--r-sm);
  margin-top:10px;
}
.goal-fields.visible { display:flex; animation:fade-up .2s ease both; }
.goal-amount-row { display:flex; gap:8px; align-items:center; }
.goal-currency {
  height:42px; width:36px; display:grid; place-items:center;
  background:var(--s2); border:1px solid var(--line); border-radius:var(--r-sm);
  font-weight:800; font-size:13px; color:var(--soft); flex-shrink:0;
}

/* Overlay image section */
.overlay-section {
  border:1px solid var(--line); border-radius:var(--r-sm);
  background:var(--s1); overflow:hidden;
}
.overlay-section-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:11px 14px; cursor:pointer;
  font-size:13px; font-weight:700;
}
.overlay-section-body {
  display:none; padding:14px;
  border-top:1px solid var(--line);
  gap:10px; flex-direction:column;
}
.overlay-section-body.open { display:flex; }
.overlay-type-tabs { display:flex; gap:6px; }
.ov-tab {
  flex:1; height:36px;
  background:var(--s1); border:1px solid var(--line);
  border-radius:var(--r-sm); font-size:12px; font-weight:700; color:var(--muted);
  transition:background var(--ease), color var(--ease), border-color var(--ease);
}
.ov-tab.active { background:var(--s2); color:var(--text); border-color:var(--line2); }
.overlay-img-drop {
  border:2px dashed var(--line); border-radius:var(--r-sm);
  padding:20px; text-align:center; cursor:pointer; position:relative;
  transition:border-color var(--ease);
}
.overlay-img-drop:hover { border-color:var(--line2); }
.overlay-img-drop input { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; min-height:unset; padding:0; border:none; }
.overlay-img-preview { max-width:100%; max-height:100px; border-radius:var(--r-xs); margin-top:8px; display:none; }

.live-setup-footer {
  padding:16px 24px 20px;
  border-top:1px solid var(--line);
  display:flex; gap:8px;
  background: #141414;
  flex-shrink:0; /* never shrink — always visible */
}
.live-start-btn {
  flex:1; height:44px;
  background:var(--red); color:#fff; border:none;
  border-radius:var(--r-md); font-size:14px; font-weight:900;
  display:flex; align-items:center; justify-content:center; gap:8px;
  transition:opacity var(--ease), transform var(--ease-spring);
}
.live-start-btn:hover { opacity:.9; }
.live-start-btn:active { transform:scale(.98); }
.live-start-dot {
  width:8px; height:8px; border-radius:50%; background:#fff;
  animation:live-pulse 1.4s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════
   LIVE BROADCAST OVERLAY (fullscreen)
═══════════════════════════════════════════════════════════ */
@keyframes live-enter {
  from { opacity:0; transform:scale(.97); }
  to   { opacity:1; transform:scale(1); }
}
.live-broadcast-overlay {
  position:fixed; inset:0; z-index:700;
  display:none; background:#000;
  animation:live-enter .3s ease both;
}
.live-broadcast-overlay.open { display:flex; }

.live-video-pane {
  flex:1; position:relative; background:#000; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}
#live-cam-output {
  width:100%; height:100%; object-fit:cover; display:block;
}
.live-image-layer {
  position:absolute; inset:0; pointer-events:none; z-index:3;
  display:none; align-items:center; justify-content:center;
}
.live-image-layer.visible { display:flex; }
.live-image-layer img {
  max-width:80%; max-height:80%;
  border-radius:var(--r-md); box-shadow:0 8px 32px rgba(0,0,0,.6);
}
/* Live badge */
.live-badge {
  position:absolute; top:14px; left:14px; z-index:5;
  padding:4px 10px;
  background:var(--red); border-radius:var(--r-xs);
  font:900 11px/1 var(--mono); color:#fff; letter-spacing:.12em;
  display:flex; align-items:center; gap:6px;
}
.live-badge-dot { width:6px; height:6px; border-radius:50%; background:#fff; animation:live-pulse 1.4s ease-in-out infinite; }
.live-viewer-count {
  position:absolute; top:14px; left:100px; z-index:5;
  padding:4px 10px;
  background:rgba(0,0,0,.55); backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,.15);
  border-radius:var(--r-xs); font-size:11px; font-weight:700; color:#fff;
}

/* Draggable donation goal widget */
.live-goal-widget {
  position:absolute; z-index:6;
  bottom:90px; left:50%; transform:translateX(-50%);
  background:rgba(0,0,0,.72);
  backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
  border:1px solid rgba(255,255,255,.18);
  border-radius:var(--r-md);
  padding:12px 16px;
  min-width:260px; max-width:90%;
  cursor:grab; user-select:none;
  display:none;
  transition:box-shadow .2s ease;
}
.live-goal-widget.visible { display:block; }
.live-goal-widget.dragging { cursor:grabbing; box-shadow:0 8px 32px rgba(0,0,0,.6); }
.live-goal-widget-title {
  font-size:11px; font-weight:800; color:rgba(255,255,255,.7);
  text-transform:uppercase; letter-spacing:.08em; margin-bottom:8px;
  display:flex; align-items:center; gap:6px;
}
.live-goal-widget-title .drag-hint {
  font-size:9px; color:rgba(255,255,255,.3); margin-left:auto; font-weight:600;
}
.live-goal-track {
  height:6px; background:rgba(255,255,255,.15);
  border-radius:3px; overflow:hidden; margin-bottom:8px;
}
.live-goal-fill {
  height:100%; background:linear-gradient(90deg,var(--red),#ff6040);
  border-radius:3px; transition:width .6s ease;
}
.live-goal-amounts {
  display:flex; justify-content:space-between;
  font-size:12px; font-weight:800; color:#fff;
}
.live-goal-amounts .goal-pct {
  font-size:10px; color:rgba(255,255,255,.5); font-weight:600;
}

/* Live controls bar */
.live-controls-bar {
  position:absolute; bottom:0; left:0; right:0; z-index:5;
  padding:14px 18px;
  background:linear-gradient(0deg,rgba(0,0,0,.85),transparent);
  display:flex; align-items:center; gap:10px;
}
.live-ctrl {
  height:38px; padding:0 14px;
  background:rgba(255,255,255,.12); backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,.18);
  border-radius:var(--r-sm); color:#fff; font-size:12px; font-weight:700;
  display:flex; align-items:center; gap:6px;
  transition:background var(--ease);
}
.live-ctrl:hover { background:rgba(255,255,255,.22); }
.live-ctrl.active { background:var(--red); border-color:transparent; }
.live-ctrl.end { background:rgba(224,50,40,.8); border-color:transparent; margin-left:auto; }
.live-ctrl.end:hover { background:var(--red); }

/* Live chat pane */
.live-chat-pane {
  width:320px; flex-shrink:0;
  background:#0e0e0e; border-left:1px solid var(--line);
  display:flex; flex-direction:column;
}
@media(max-width:900px) { .live-chat-pane { display:none; } }
.live-chat-header {
  padding:12px 16px; border-bottom:1px solid var(--line);
  font-size:12px; font-weight:800; letter-spacing:.04em;
  text-transform:uppercase; color:var(--soft);
  display:flex; align-items:center; gap:8px;
}
.live-chat-messages {
  flex:1; overflow-y:auto; padding:12px;
  display:flex; flex-direction:column; gap:8px;
  scrollbar-width:thin; scrollbar-color:var(--line) transparent;
}
.live-chat-msg { font-size:12px; line-height:1.5; }
.live-chat-msg .lcm-user { font-weight:800; color:var(--text); margin-right:5px; }
.live-chat-msg .lcm-text { color:var(--muted); }
.live-chat-msg.blocked-msg .lcm-text { color:var(--red); font-style:italic; }
.live-chat-input-row {
  padding:10px 12px 12px;
  border-top:1px solid var(--line);
  display:flex; gap:7px;
}
.live-chat-input-row input {
  flex:1; height:34px; font-size:12px; min-height:unset;
  background:var(--s2); border-color:var(--line);
}
.live-chat-send {
  height:34px; padding:0 12px;
  background:var(--red); color:#fff; border:none;
  border-radius:var(--r-sm); font-size:12px; font-weight:800;
  transition:opacity var(--ease);
}
.live-chat-send:hover { opacity:.88; }

/* ═══════════════════════════════════════════════════════════
   USER SETTINGS MODAL
═══════════════════════════════════════════════════════════ */
.settings-modal .modal-card {
  width:min(460px,100%); padding:0; overflow:hidden;
  display:flex; flex-direction:column;
  height:min(90dvh, 780px);
}
.settings-header {
  padding:20px 24px 16px; border-bottom:1px solid var(--line);
}
.settings-header h2 { margin:0; font-size:19px; font-weight:900; letter-spacing:-.025em; }
.settings-body { padding:20px 24px 0; display:flex; flex-direction:column; gap:16px; overflow-y:auto; overflow-x:hidden; flex:1 1 auto; min-height:0; scrollbar-width:thin; scrollbar-color:var(--line) transparent; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
.settings-section-title {
  font-size:10px; font-weight:800; text-transform:uppercase;
  letter-spacing:.08em; color:var(--soft); margin-bottom:8px;
}
.settings-ava-row {
  display:flex; align-items:center; gap:16px;
  padding:14px; background:var(--s1); border:1px solid var(--line);
  border-radius:var(--r-sm);
}
.settings-ava-preview {
  width:52px; height:52px; border-radius:12px;
  display:grid; place-items:center;
  font-size:24px; font-weight:900; color:#fff;
  flex-shrink:0;
}
.settings-ava-actions { display:flex; flex-direction:column; gap:6px; }
.settings-ava-actions button {
  height:30px; padding:0 12px;
  background:var(--s1); border:1px solid var(--line);
  border-radius:var(--r-xs); font-size:11px; font-weight:700; color:var(--muted);
  transition:background var(--ease), color var(--ease);
}
.settings-ava-actions button:hover { background:var(--s2); color:var(--text); }
.settings-footer {
  padding:16px 24px 20px; border-top:1px solid var(--line); margin-top:0;
  display:flex; gap:8px; align-items:center;
  flex-shrink:0;
}

/* ── Universal secondary button (Tühista / Tagasi) ─────── */
.back-btn {
  height:44px; padding:0 20px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.14);
  border-radius:var(--r-sm);
  font-size:13px; font-weight:700; color:var(--muted);
  display:inline-flex; align-items:center; justify-content:center;
  gap:6px; flex-shrink:0;
  transition:background var(--ease), color var(--ease), border-color var(--ease);
  cursor:pointer;
}
.back-btn:hover {
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.22);
  color:var(--text);
}
.back-btn:active { transform:scale(.98); }

.settings-save-btn {
  flex:1; height:44px;
  background:var(--red); color:#fff; border:none;
  border-radius:var(--r-sm); font-size:13px; font-weight:800;
  letter-spacing:-.01em;
  transition:opacity var(--ease), transform var(--ease-spring);
}
.settings-save-btn:hover { opacity:.88; }
.settings-save-btn:active { transform:scale(.98); }
.danger-zone {
  padding: 14px;
  border: 1px solid rgba(224,50,40,.35);
  border-radius: var(--r-sm);
  background: rgba(224,50,40,.07);
}
.danger-zone p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.delete-account-btn {
  width: 100%;
  min-height: 38px;
  border-radius: var(--r-sm);
  background: rgba(224,50,40,.18);
  border: 1px solid rgba(224,50,40,.45);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}
.delete-account-btn:hover { background: rgba(224,50,40,.28); }

/* ═══════════════════════════════════════════════════════════
   GDPR / COOKIE CONSENT GATE
═══════════════════════════════════════════════════════════ */
@keyframes gate-rise {
  from { opacity:0; transform:translateY(40px); }
  to   { opacity:1; transform:translateY(0); }
}
.cookie-gate {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  justify-content: center;
  padding: 14px;
  background: linear-gradient(0deg, rgba(0,0,0,.72), transparent);
  pointer-events: none;
}
.cookie-gate-inner {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: #141414;
  border: 1px solid var(--line2);
  border-radius: var(--r-lg);
  padding: 18px;
  animation: gate-rise .4s cubic-bezier(.34,1.2,.64,1) both;
  box-shadow: 0 20px 80px rgba(0,0,0,.66);
  pointer-events: auto;
}
@media (max-width:600px) { .cookie-gate-inner { padding: 16px; } }
.cookie-gate-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.cookie-gate-logo .ck-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--red); display: grid; place-items: center;
  font-size: 18px; font-weight: 900; color: #fff;
}
.cookie-gate-logo strong { font-size: 16px; font-weight: 900; letter-spacing: -.02em; }
.cookie-gate h2 {
  font-size: 20px; font-weight: 900; letter-spacing: -.025em;
  margin: 0 0 10px; line-height: 1.2;
}
.cookie-gate p {
  font-size: 12px; color: var(--muted); line-height: 1.55; margin: 0 0 14px;
}
.cookie-inline-link {
  color: var(--text); font-weight: 700; border: none; background: none;
  padding: 0; cursor: pointer; text-decoration: underline;
  text-decoration-color: var(--line2); text-underline-offset: 2px;
  font-size: inherit;
}
.cookie-inline-link:hover { color: #fff; }
.cookie-btns {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.cookie-accept-all {
  height: 44px; padding: 0 24px;
  background: var(--red); color: #fff;
  border-radius: var(--r-md); font-size: 14px; font-weight: 800; border: none;
  transition: opacity var(--ease), transform var(--ease-spring);
  flex: 1;
}
.cookie-accept-all:hover { opacity: .88; }
.cookie-accept-all:active { transform: scale(.97); }
.cookie-accept-required {
  height: 44px; padding: 0 20px;
  background: var(--s1); color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: 13px; font-weight: 700;
  transition: background var(--ease), color var(--ease);
}
.cookie-accept-required:hover { background: var(--s2); color: var(--text); }
.cookie-note {
  font-size: 11px; color: var(--dim); margin: 0; line-height: 1.6;
}
.cookie-gate.hidden { display: none; }

/* ═══════════════════════════════════════════════════════════
   ONBOARDING WIZARD
═══════════════════════════════════════════════════════════ */
.onboarding-modal .modal-card {
  width: min(480px, 100%);
  padding: 0;
  overflow: hidden;
}
.onboard-progress-track {
  height: 3px; background: var(--s2); border-radius: 0;
}
.onboard-progress-fill {
  height: 100%; background: var(--red);
  border-radius: 0 3px 3px 0;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.onboard-body {
  padding: 32px 28px 28px;
}
@media (max-width:500px) { .onboard-body { padding: 24px 20px 22px; } }
.onboard-step { display: none; }
.onboard-step.active {
  display: flex; flex-direction: column; gap: 0;
  animation: fade-up .3s ease both;
}
.onboard-icon {
  font-size: 36px; margin-bottom: 12px; line-height: 1;
}
.onboard-step .eyebrow { margin-bottom: 6px; }
.onboard-step h2 {
  font-size: 22px; font-weight: 900; letter-spacing: -.025em;
  margin: 0 0 8px;
}
.onboard-step > p {
  font-size: 13px; color: var(--muted); line-height: 1.65;
  margin: 0 0 20px;
}
.onboard-step label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--soft);
  margin-bottom: 12px;
}
.onboard-step input, .onboard-step textarea {
  height: 42px; padding: 0 13px;
  background: var(--s1); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--text); font-size: 14px; outline: none;
  transition: border-color var(--ease), background var(--ease);
  width: 100%;
}
.onboard-step textarea { height: 80px; padding: 10px 13px; resize: none; }
.onboard-step input:focus, .onboard-step textarea:focus {
  border-color: var(--line2); background: var(--s2);
}
.onboard-skip {
  width: 100%; height: 36px; margin-top: 6px;
  background: none; border: none; color: var(--dim);
  font-size: 12px; font-weight: 600;
  transition: color var(--ease);
}
.onboard-skip:hover { color: var(--soft); }

/* Avatar picker */
.avatar-picker {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 20px 0 4px;
}
.ava-preview-wrap { position: relative; }
.ava-preview {
  width: 80px; height: 80px; border-radius: 18px;
  display: grid; place-items: center;
  font-size: 36px; font-weight: 900; color: #fff;
  background: var(--red);
  transition: background .2s ease;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--line2);
}
.ava-colors {
  display: flex; gap: 8px;
}
.ava-color {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid transparent;
  transition: transform var(--ease-spring), border-color var(--ease);
}
.ava-color:hover { transform: scale(1.15); }
.ava-color.active { border-color: #fff; transform: scale(1.1); }
.upload-photo-btn {
  height: 36px; padding: 0 16px;
  background: var(--s1); border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 12px; font-weight: 700;
  color: var(--muted); cursor: pointer; display: flex; align-items: center;
  transition: background var(--ease), color var(--ease);
  text-transform: none !important; letter-spacing: 0 !important;
}
.upload-photo-btn:hover { background: var(--s2); color: var(--text); }

/* Summary card */
.onboard-summary {
  background: var(--s1); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px 16px;
  margin-bottom: 20px; display: flex; gap: 14px; align-items: center;
}
.onboard-summary-ava {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center; font-size: 20px; font-weight: 900; color: #fff;
  flex-shrink: 0;
}
.onboard-summary-info strong { display: block; font-size: 14px; font-weight: 800; margin-bottom: 3px; }
.onboard-summary-info span { font-size: 12px; color: var(--muted); }
.onboard-feature-list {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px;
}
.onboard-feature {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted);
}
.onboard-feature-icon {
  width: 28px; height: 28px; border-radius: var(--r-xs);
  background: var(--s2); display: grid; place-items: center;
  font-size: 14px; flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   SMART LOGIN INPUT
═══════════════════════════════════════════════════════════ */
.smart-input-wrap {
  position: relative; display: flex; align-items: center;
}
.smart-input-icon {
  position: absolute; left: 12px; z-index: 1;
  font-size: 13px; font-weight: 800; color: var(--soft);
  pointer-events: none; font-family: var(--mono);
  transition: color var(--ease);
  width: 18px; text-align: center;
  user-select: none;
}
.smart-input-icon.is-email { color: var(--red); }
.smart-input-wrap input {
  padding-left: 36px !important;
}

/* ═══════════════════════════════════════════════════════════
   AD BLOCK BANNER
═══════════════════════════════════════════════════════════ */
.adblock-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 600;
  background: #1a1a1a;
  border-top: 1px solid var(--line2);
  padding: 14px clamp(16px,4vw,40px);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.34,1.2,.64,1);
  box-shadow: 0 -8px 32px rgba(0,0,0,.4);
}
.adblock-banner.show { transform: translateY(0); }
.adblock-banner-text {
  flex: 1; min-width: 200px;
  font-size: 13px; line-height: 1.55;
}
.adblock-banner-text strong { display: block; font-weight: 800; margin-bottom: 2px; }
.adblock-banner-text span { color: var(--muted); font-size: 12px; }
.adblock-dismiss {
  height: 36px; padding: 0 16px;
  background: var(--s1); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--muted);
  font-size: 12px; font-weight: 700;
  transition: background var(--ease), color var(--ease);
  white-space: nowrap;
}
.adblock-dismiss:hover { background: var(--s2); color: var(--text); }

/* ═══════════════════════════════════════════════════════════
   LEGAL MODALS (Tingimused, KKK, Privaatsus)
═══════════════════════════════════════════════════════════ */
.legal-modal .modal-card {
  width: min(560px, 100%);
  max-height: 85dvh;
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
}
.legal-modal-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.legal-modal-header h2 { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: -.025em; }
.legal-modal-body {
  flex: 1; overflow-y: auto; padding: 20px 28px 28px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.legal-modal-body h3 {
  font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--soft); margin: 22px 0 8px;
}
.legal-modal-body h3:first-child { margin-top: 0; }
.legal-modal-body p {
  font-size: 13px; color: var(--muted); line-height: 1.75; margin: 0 0 10px;
}
.legal-modal-body ul {
  margin: 0 0 10px; padding-left: 18px;
  font-size: 13px; color: var(--muted); line-height: 1.75;
}
.legal-modal-body li { margin-bottom: 4px; }
.faq-item { margin-bottom: 18px; }
.faq-q {
  font-size: 14px; font-weight: 800; color: var(--text);
  margin-bottom: 5px; letter-spacing: -.01em;
}
.faq-a { font-size: 13px; color: var(--muted); line-height: 1.7; }
.legal-close-btn {
  position: absolute;
  top: 16px;
  right: 18px;
}

/* ═══════════════════════════════════════════════════════════
   KAZJAK PRODUCTION UI POLISH OVERRIDES
═══════════════════════════════════════════════════════════ */
.modal,
.post-lightbox,
.kzk-confirm {
  background:
    radial-gradient(circle at 50% 12%, rgba(224,50,40,.16), transparent 32%),
    rgba(0,0,0,.78);
  backdrop-filter: blur(22px) saturate(1.05);
  -webkit-backdrop-filter: blur(22px) saturate(1.05);
}

.modal,
.post-lightbox {
  z-index: 920;
}

.kzk-confirm {
  z-index: 1100;
}

.modal-card,
.lightbox-inner,
.cookie-gate-inner,
.kzk-confirm-card {
  border: 1px solid rgba(255,255,255,.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.032)),
    #111;
  box-shadow:
    0 34px 120px rgba(0,0,0,.74),
    inset 0 1px 0 rgba(255,255,255,.08);
}

.modal-card::before,
.lightbox-inner::before,
.kzk-confirm-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224,50,40,.75), transparent);
  pointer-events: none;
}

.modal.open .modal-card,
.post-lightbox.open .lightbox-inner,
.kzk-confirm.open .kzk-confirm-card {
  animation: kzk-pop .22s cubic-bezier(.34,1.3,.64,1) both;
}

@keyframes kzk-pop {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.close,
.lightbox-close {
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.13);
  color: rgba(255,255,255,.7);
}

.close:hover,
.lightbox-close:hover {
  color: #fff;
  background: rgba(224,50,40,.18);
  border-color: rgba(224,50,40,.38);
}

.auth-tabs-modal,
.upload-steps-nav {
  padding: 5px;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
}

.auth-tabs-modal button.active,
.upload-step-dot.active {
  background: rgba(224,50,40,.16);
  border-color: rgba(224,50,40,.38);
}

input,
textarea,
select {
  background: rgba(255,255,255,.055) !important;
  border-color: rgba(255,255,255,.12) !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(224,50,40,.58) !important;
  box-shadow: 0 0 0 3px rgba(224,50,40,.14);
}

.creator-grid-btn,
.creator-grid button,
.vis-option,
.upload-drop,
.settings-ava-row,
.danger-zone,
.goal-toggle-row,
.overlay-section,
.react-pill {
  background: rgba(255,255,255,.055) !important;
  border-color: rgba(255,255,255,.11) !important;
}

.creator-grid-btn:hover,
.creator-grid button:hover,
.vis-option:hover,
.react-pill:hover {
  background: rgba(255,255,255,.09) !important;
  border-color: rgba(255,255,255,.18) !important;
}

.post-lightbox {
  padding: clamp(12px, 3vw, 28px);
}

.lightbox-inner {
  position: relative;
  border-radius: 24px;
}

.lightbox-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent),
    #111;
}

.cookie-gate-inner,
.adblock-banner {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.13);
}

.kzk-confirm {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
}

.kzk-confirm.open {
  opacity: 1;
  pointer-events: auto;
}

.kzk-confirm-card {
  position: relative;
  width: min(100%, 420px);
  overflow: hidden;
  padding: 28px;
  border-radius: 22px;
  text-align: left;
}

.kzk-confirm-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 14px;
  color: #fff;
  background: var(--red);
  font: 900 22px/1 var(--mono);
}

.kzk-confirm-card h2 {
  margin: 0 0 10px;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.kzk-confirm-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.kzk-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 22px;
}

.kzk-confirm-actions button {
  min-height: 44px;
  border-radius: 13px;
  font-weight: 900;
}

.kzk-confirm-secondary {
  color: var(--muted);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}

.kzk-confirm-danger {
  color: #fff;
  background: var(--red);
  border: 1px solid transparent;
}

.kzk-confirm-danger.is-safe {
  background: rgba(255,255,255,.11);
}

@media (max-width: 640px) {
  .modal {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    overflow: hidden;
  }
  .modal-card,
  .kzk-confirm-card {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .auth-card,
  .onboarding-modal .modal-card {
    min-height: 100dvh;
    height: 100dvh;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  }
  .auth-card {
    display: flex;
    flex-direction: column;
  }
  .auth-card .close {
    top: calc(14px + env(safe-area-inset-top));
    right: 14px;
  }
  .auth-card .modal-copy {
    margin-bottom: 14px;
  }
  .auth-tabs-modal {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 0;
    margin-bottom: 10px;
    background: #161616;
  }
  .auth-tabs-modal button {
    height: 42px;
    font-size: 14px;
  }
  .auth-form {
    gap: 10px;
    padding-bottom: 12px;
  }
  .auth-form input,
  .onboard-step input,
  .onboard-step textarea {
    min-height: 46px;
    font-size: 16px;
    border-radius: 12px;
  }
  .auth-form .submit,
  .onboard-step .submit {
    min-height: 48px;
    font-size: 15px;
    border-radius: 14px;
  }
  .onboarding-modal .modal-card {
    display: flex;
    flex-direction: column;
    padding: 0;
  }
  .onboarding-modal .onboard-progress-track {
    flex: 0 0 4px;
  }
  .onboard-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: calc(22px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }
  .onboard-step.active {
    min-height: 100%;
  }
  .onboard-icon {
    font-size: 32px;
    margin-bottom: 10px;
  }
  .onboard-step h2 {
    font-size: 24px;
    line-height: 1.12;
  }
  .onboard-step > p {
    font-size: 14px;
    margin-bottom: 16px;
  }
  .onboard-step textarea {
    height: 126px;
    padding: 12px 13px;
  }
  .onboard-step .submit {
    margin-top: auto;
  }
  .onboard-skip {
    min-height: 42px;
    margin-top: 6px;
  }
  .ava-colors {
    flex-wrap: wrap;
    justify-content: center;
  }
  .ava-color {
    width: 34px;
    height: 34px;
  }
  .onboard-feature-list {
    gap: 7px;
  }
  .onboard-feature {
    font-size: 12px;
  }
  .settings-modal .modal-card,
  .upload-modal .modal-card,
  .live-setup-modal .modal-card,
  .legal-modal .modal-card {
    width: 100%;
  }
  .live-setup-modal .modal-card {
    /* height — not max-height — gives flex children a definite reference */
    height: min(calc(100dvh - 20px), 90dvh);
  }
  .live-setup-header {
    padding: 18px 20px 14px;
  }
  .live-setup-header h2 {
    font-size: 18px;
  }
  .live-setup-body {
    padding: 16px 18px 20px;
    gap: 10px;
    /* iOS Safari momentum scroll inside fixed-body modal */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .cam-preview-box {
    /* Shorter on mobile so form fields have room */
    aspect-ratio: 16 / 7;
    min-height: 130px;
    max-height: 160px;
  }
  .cam-preview-controls {
    width: calc(100% - 24px);
    justify-content: center;
    overflow-x: auto;
  }
  .cam-ctrl-btn {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 12px;
  }
  .goal-toggle-row {
    align-items: center;
    padding: 13px 14px;
  }
  .live-setup-footer {
    padding: 12px 18px 18px;
    gap: 10px;
  }
  .live-setup-footer .back-btn,
  .live-start-btn {
    height: 48px !important;
  }
  .creator-grid,
  .kzk-confirm-actions {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   MINI FOOTER
═══════════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px clamp(16px,4vw,40px);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  font-size: 11px; color: var(--dim);
  margin-top: 40px;
}
.footer-links {
  display: flex; gap: 2px; flex-wrap: wrap;
}
.footer-link {
  height: 28px; padding: 0 10px;
  background: none; border: none; border-radius: var(--r-xs);
  color: var(--dim); font-size: 11px; font-weight: 600;
  cursor: pointer;
  transition: color var(--ease), background var(--ease);
}
.footer-link:hover { color: var(--muted); background: var(--s1); }
.footer-gdpr-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs); color: var(--dim); font-size: 10px; font-weight: 600;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease);
}
.footer-gdpr-chip:hover { border-color: var(--line2); color: var(--soft); }
.footer-gdpr-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4caf7d;
}

/* ═══════════════════════════════════════════════════════════
   CREATOR GRID — premium card buttons
═══════════════════════════════════════════════════════════ */
.creator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.creator-grid-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 16px 18px;
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  transition: background var(--ease), border-color var(--ease), transform var(--ease-spring);
  cursor: pointer;
}

.creator-grid-btn:hover {
  background: var(--s2);
  border-color: var(--line2);
  transform: translateY(-1px);
}

.creator-grid-btn:active { transform: scale(.98); }

.creator-grid-btn.live { border-color: rgba(224,50,40,.3); }
.creator-grid-btn.live:hover { border-color: rgba(224,50,40,.55); background: rgba(224,50,40,.07); }

.creator-grid-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  margin-bottom: 2px;
}

.creator-grid-btn.live .creator-grid-icon {
  background: rgba(224,50,40,.15);
  border-color: rgba(224,50,40,.3);
  color: var(--red);
}

.creator-grid-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1;
}

.creator-grid-hint {
  font-size: 11px;
  color: var(--soft);
  font-weight: 500;
}

.creator-settings-link {
  text-align: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.creator-settings-link .cookie-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--soft);
}

.creator-settings-link .cookie-inline-link:hover { color: var(--text); }

/* ═══════════════════════════════════════════════════════════
   KZK COIN BADGE — for goal amounts
═══════════════════════════════════════════════════════════ */
.coin-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5a623, #d48806);
  font-size: 9px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}

.coin-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 42px; width: 42px;
  background: rgba(245,166,35,.12);
  border: 1px solid rgba(245,166,35,.28) !important;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

/* KZK coin in broadcast goal amounts */
.lg-coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5a623, #d48806);
  font-size: 7px;
  font-weight: 900;
  color: #fff;
  margin-right: 2px;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════
   CAM CTRL BTN — SVG + text alignment
═══════════════════════════════════════════════════════════ */
.cam-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cam-ctrl-btn svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   OVERLAY TABS — SVG + text
═══════════════════════════════════════════════════════════ */
.ov-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.ov-tab svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   DROP ZONE ICON — SVG variant
═══════════════════════════════════════════════════════════ */
.drop-zone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--soft);
  margin: 0 auto 14px;
}

/* ═══════════════════════════════════════════════════════════
   LIVE CTRL — SVG + text alignment
═══════════════════════════════════════════════════════════ */
.live-ctrl svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   MISC ICON HELPERS
═══════════════════════════════════════════════════════════ */
/* Inline live status dot (replaces 🔴 emoji) */
.live-dot-sm {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: live-pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Cam placeholder */
.cam-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font-size: 13px;
}

/* Gallery type badge text */
.gal-media-type {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
}

/* Lstat row alignment */
.lightbox-stats { display: flex; gap: 14px; align-items: center; }
.lstat { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--soft); font-weight: 700; }

/* onboard-feature SVG alignment */
.onboard-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════
   LOGOUT BUTTON + REMEMBER ME
═══════════════════════════════════════════════════════════ */
.logout-btn {
  display: none; /* shown only when creator */
  height: 36px; padding: 0 14px;
  background: rgba(224,50,40,.1);
  border: 1px solid rgba(224,50,40,.25);
  border-radius: var(--r-sm);
  color: rgba(224,50,40,.85);
  font-size: 12px; font-weight: 700;
  align-items: center; gap: 6px;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
  cursor: pointer;
  flex-shrink: 0;
}
.logout-btn:hover {
  background: rgba(224,50,40,.18);
  border-color: rgba(224,50,40,.45);
  color: #ff5a52;
}
[data-auth="creator"] .logout-btn { display: inline-flex; }

.remember-me-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 4px;
}
.remember-me-row input[type="checkbox"] {
  width: 15px; height: 15px;
  min-height: unset; padding: 0; border: none;
  accent-color: var(--red);
  cursor: pointer;
  flex-shrink: 0;
}

/* Body scroll lock
   NOTE: No position:fixed here — that breaks iOS Safari inner scroll.
   Background scroll is prevented by the touchmove listener in JS instead. */
body.modal-open {
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   DESKTOP RAIL LAYOUT — centered reels with visible banners
═══════════════════════════════════════════════════════════ */
@media (min-width: 1101px) {
  :root {
    --left-rail-w: clamp(270px, 21vw, 340px);
    --right-rail-w: clamp(280px, 19vw, 330px);
    --desktop-reel-w: min(500px, calc(100vw - var(--left-rail-w) - var(--right-rail-w) - 148px));
    --desktop-reel-h: min(880px, calc(100dvh - var(--bar) - 30px));
  }

  .topbar {
    grid-template-columns: var(--left-rail-w) minmax(390px, 1fr) max-content;
    gap: 16px;
  }

  .feed-tabs {
    justify-content: center;
  }

  .creator-actions,
  .public-actions {
    min-width: 0;
    gap: 9px;
  }

  .creator-btn,
  .profile-pill,
  .logout-btn {
    min-height: 34px;
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 12px;
  }

  .profile-pill .avatar-mini {
    width: 24px;
    height: 24px;
    border-radius: 8px;
  }

  .profile-pill small {
    max-width: 66px;
  }

  .left-rail {
    width: var(--left-rail-w);
    z-index: 25;
    background: rgba(10,10,10,.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .right-rail {
    width: var(--right-rail-w);
    z-index: 25;
    background: rgba(10,10,10,.84);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  html {
    scroll-snap-type: none;
  }

  body {
    height: 100dvh;
    overflow: hidden;
  }

  .reels-stage {
    position: fixed;
    top: var(--bar);
    left: var(--left-rail-w);
    right: var(--right-rail-w);
    bottom: 0;
    width: auto;
    height: calc(100dvh - var(--bar));
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-padding: 0;
    overscroll-behavior: contain;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    background:
      radial-gradient(circle at 50% 42%, rgba(224,50,40,.08), transparent 24%),
      linear-gradient(90deg, rgba(255,255,255,.035), transparent 13%, transparent 87%, rgba(255,255,255,.035));
  }

  .reels-stage::-webkit-scrollbar {
    display: none;
  }

  .reel {
    width: 100%;
    height: calc(100dvh - var(--bar));
    min-height: calc(100dvh - var(--bar));
    flex: 0 0 calc(100dvh - var(--bar));
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 22px 72px;
  }

  .video-card {
    width: var(--desktop-reel-w);
    height: var(--desktop-reel-h);
    min-height: min(640px, calc(100dvh - var(--bar) - 30px));
    aspect-ratio: 9 / 16;
    max-width: 100%;
    border-radius: 20px;
    border-left: 1px solid rgba(255,255,255,.07);
    border-right: 1px solid rgba(255,255,255,.07);
    box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 28px 90px rgba(0,0,0,.55);
  }

  .media-art {
    border-radius: inherit;
  }

  .reel-copy {
    inset: auto 0 0 0;
    padding: 118px 76px 62px 22px;
    background: linear-gradient(
      0deg,
      rgba(0,0,0,.94) 0%,
      rgba(0,0,0,.62) 48%,
      rgba(0,0,0,.16) 78%,
      transparent 100%
    );
  }

  .reel-copy h2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    font-size: clamp(26px, 2.1vw, 36px);
    line-height: 1.08;
    letter-spacing: 0;
  }

  .reel-copy p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 9px;
    font-size: 14px;
    line-height: 1.45;
  }

  .author-line {
    margin-bottom: 9px;
  }

  .tags {
    max-height: 28px;
    overflow: hidden;
    flex-wrap: nowrap;
    max-width: 100%;
  }

  .tags span {
    min-width: 0;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .action-stack {
    right: 13px;
    bottom: 76px;
    gap: 13px;
  }

  .action-stack button .act-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .reel-meta-bar {
    left: 22px;
    right: 76px;
    bottom: 24px;
    transform: none;
    max-width: none;
    width: auto;
    padding: 0;
    gap: 6px;
    background: transparent;
    border: 0;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: .9;
    overflow: hidden;
  }

  .view-count,
  .algo-badge {
    min-width: 0;
    height: 25px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(0,0,0,.55);
    border: 1px solid rgba(255,255,255,.12);
    white-space: nowrap;
  }

  .view-count {
    max-width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .algo-badge {
    margin-left: 0;
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (min-width: 1101px) and (max-height: 820px) {
  :root {
    --desktop-reel-w: min(390px, calc(100vw - var(--left-rail-w) - var(--right-rail-w) - 128px));
    --desktop-reel-h: calc(100dvh - var(--bar) - 22px);
  }

  .reel {
    padding: 14px 64px;
  }

  .reel-copy {
    padding: 92px 68px 56px 20px;
  }

  .reel-copy h2 {
    font-size: clamp(23px, 1.75vw, 30px);
  }

  .reel-copy p {
    font-size: 13px;
  }

  .action-stack {
    bottom: 64px;
  }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE APP UI — compact TikTok-style viewport
═══════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  :root {
    --bar: 56px;
    --mobile-tabs: 46px;
    --mobile-nav: 66px;
  }

  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow-x: clip;
    background: #050505;
  }

  .topbar {
    height: var(--bar);
    padding: max(6px, env(safe-area-inset-top)) 10px 6px;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    background: rgba(5,5,5,.82);
    border-bottom-color: rgba(255,255,255,.07);
  }

  .brand {
    min-width: 0;
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 20px;
  }

  .brand-copy strong {
    font-size: 20px;
    line-height: .9;
  }

  .brand-copy small {
    display: none;
  }

  .public-actions,
  .creator-actions {
    display: none !important;
  }

  .feed-tabs {
    position: fixed;
    z-index: 45;
    top: var(--bar);
    left: 0;
    right: 0;
    height: var(--mobile-tabs);
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 5px 10px;
    background: linear-gradient(180deg, rgba(5,5,5,.88), rgba(5,5,5,.56));
    border-bottom: 1px solid rgba(255,255,255,.055);
    overflow-x: auto;
    scroll-padding-inline: 10px;
  }

  .tab {
    min-height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(255,255,255,.035);
    border-color: rgba(255,255,255,.06);
  }

  .tab.active {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.16);
  }

  .tab[data-filter="gallery"],
  .tab[data-filter="dashcam"] {
    display: none;
  }

  .reels-stage {
    width: 100vw;
    margin: 0;
  }

  .reel,
  .video-card {
    width: 100vw;
    height: 100svh;
    min-height: 100svh;
  }

  .media-art {
    height: 100%;
    min-height: 100%;
  }

  .play {
    width: 48px;
    height: 48px;
    font-size: 15px;
    background: rgba(255,255,255,.12);
  }

  .ring {
    width: min(78vw, 320px);
    height: min(78vw, 320px);
  }

  .media-art.ball .ring {
    width: min(82vw, 340px);
    height: min(82vw, 340px);
  }

  .reel-copy {
    inset: auto 58px calc(var(--mobile-nav) + env(safe-area-inset-bottom) + 8px) 10px;
    padding: 82px 8px 8px;
    background: linear-gradient(0deg, rgba(0,0,0,.9) 0%, rgba(0,0,0,.42) 58%, transparent 100%);
    gap: 0;
  }

  .author-line {
    gap: 8px;
    margin-bottom: 8px;
  }

  .avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .author-line strong {
    font-size: 14px;
    line-height: 1.05;
  }

  .author-line small {
    font-size: 11px;
  }

  .follow-btn {
    height: 30px;
    padding: 0 13px;
    font-size: 12px;
    border-radius: 999px;
  }

  .reel-copy h2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 5px;
    font-size: clamp(20px, 6vw, 28px);
    line-height: 1.08;
    letter-spacing: -.04em;
  }

  .reel-copy p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 7px;
    font-size: 12px;
    line-height: 1.35;
  }

  .tags {
    gap: 4px;
    max-height: 24px;
    overflow: hidden;
  }

  .tags span {
    padding: 3px 7px;
    font-size: 10px;
  }

  .action-stack {
    right: 8px;
    bottom: calc(var(--mobile-nav) + env(safe-area-inset-bottom) + 16px);
    gap: 10px;
    z-index: 7;
  }

  .action-stack button {
    gap: 4px;
  }

  .action-stack button .act-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
    background: rgba(0,0,0,.54);
    border-color: rgba(255,255,255,.11);
    box-shadow: 0 2px 12px rgba(0,0,0,.35);
  }

  .action-stack button strong {
    font-size: 10px;
    font-weight: 850;
  }

  .reel-meta-bar {
    display: none;
  }

  .bottom-auth {
    display: flex;
    left: 10px;
    right: 10px;
    bottom: 8px;
    z-index: 70;
    justify-content: center;
    gap: 8px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    min-height: var(--mobile-nav);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 20px;
    background: rgba(8,8,8,.76);
    box-shadow: 0 18px 60px rgba(0,0,0,.56);
  }

  .bottom-auth button {
    flex: 0 1 150px;
    height: 42px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 900;
  }

  [data-auth="creator"] .bottom-auth {
    justify-content: space-between;
  }

  [data-auth="creator"] .bottom-auth .creator-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  [data-auth="creator"] .bottom-auth button:nth-child(3) {
    flex: 0 0 108px;
    color: #5aa7ff;
    background: rgba(255,255,255,.045) !important;
    border: 1px solid rgba(255,255,255,.1) !important;
  }

  [data-auth="creator"] .bottom-auth button:nth-child(4) {
    flex: 1 1 auto;
    max-width: 220px;
    background: linear-gradient(180deg, #ef362e, #d7261f) !important;
    box-shadow: 0 10px 28px rgba(224,50,40,.24);
  }

  .live-broadcast strong {
    font-size: 10px;
    padding: 4px 10px;
  }

  .live-broadcast small {
    max-width: 78vw;
    font-size: 11px;
  }

  .locked-panel {
    min-height: 100svh;
    padding: calc(var(--bar) + var(--mobile-tabs) + 20px) 22px calc(var(--mobile-nav) + 30px);
  }
}

@media (max-width: 380px) {
  .brand-copy strong {
    font-size: 18px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
  }
  .tab {
    padding: 0 11px;
    font-size: 11px;
  }
  .reel-copy h2 {
    font-size: 20px;
  }
  .action-stack button .act-icon {
    width: 36px;
    height: 36px;
  }
}

/* ─── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
  }
}
