:root {
  --bg: #07080d;
  --panel: rgba(18, 20, 28, .78);
  --panel-soft: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .13);
  --text: #f8fafc;
  --muted: #a8b0c3;
  --hot: #8b5cf6;
  --mint: #38bdf8;
  --gold: #a78bfa;
  --blue: #60a5fa;
}

* { box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(139, 92, 246, .22), transparent 26%),
    radial-gradient(circle at 85% 8%, rgba(56, 189, 248, .18), transparent 30%),
    #030407;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  overflow: hidden;
}

button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: clamp(28px, 8vw, 42px); line-height: .95; letter-spacing: 0; }
h3 { margin: 26px 0 12px; font-size: 17px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-shell {
  position: relative;
  width: min(100%, 520px);
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 90px rgba(0, 0, 0, .45);
}

.desktop-sidebar { display: none; }

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 66px;
  padding: 8px 14px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(22px);
  pointer-events: none;
}

.brand, .top-actions, .icon-btn, .wallet-pill { pointer-events: auto; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  background: transparent;
  padding: 0;
  text-align: left;
  min-width: 0;
}
.brand strong { display: block; font-size: 17px; font-weight: 900; }
.brand small { display: block; max-width: 170px; color: rgba(255, 255, 255, .68); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.logo-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn, .wallet-pill {
  display: grid;
  place-items: center;
  color: white;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .12);
}
.icon-btn { width: 42px; height: 42px; border-radius: 50%; }
.wallet-pill {
  min-width: 92px;
  height: 42px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}
.primary-icon { color: #111318; background: linear-gradient(135deg, var(--mint), var(--gold)); border: 0; }
#backBtn { position: absolute; left: 14px; }

.view {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .22s ease;
}
.active-view { opacity: 1; transform: translateY(0); pointer-events: auto; }

.feed-tabs {
  position: absolute;
  z-index: 40;
  top: 76px;
  left: 50%;
  display: flex;
  gap: 4px;
  width: min(calc(100% - 116px), 306px);
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}
.feed-tabs button {
  flex: 1;
  min-width: 0;
  height: 32px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .66);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}
.feed-tabs .active { color: white; background: rgba(255, 255, 255, .16); }

.discover-search {
  position: absolute;
  z-index: 42;
  top: 76px;
  left: 50%;
  width: min(calc(100% - 32px), 420px);
  height: 44px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background: rgba(0, 0, 0, .52);
  backdrop-filter: blur(20px);
  transform: translateX(-50%);
}
.discover-search svg {
  width: 18px;
  height: 18px;
  color: var(--mint);
}
.discover-search input {
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}
.discover-feed .video-card::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .68), transparent 22%, transparent 56%, rgba(0, 0, 0, .86)),
    radial-gradient(circle at 18% 14%, rgba(56, 189, 248, .16), transparent 24%);
}

.feed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
}
.feed::-webkit-scrollbar, .page-view::-webkit-scrollbar { display: none; }

.video-card {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  touch-action: pan-y;
  background: #0b0d14;
}
.video-card video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #0b0d14;
}
.video-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .58), transparent 26%, transparent 56%, rgba(0, 0, 0, .86)),
    radial-gradient(circle at 72% 16%, rgba(96, 165, 250, .18), transparent 26%);
}
.poster-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, .36), transparent 42%),
    linear-gradient(315deg, rgba(56, 189, 248, .3), transparent 46%),
    #12141c;
}
.poster-fallback span {
  width: 124px;
  height: 124px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 38px;
  font-weight: 900;
  background: rgba(255, 255, 255, .12);
  border: 1px solid var(--line);
}

.clip-meta {
  position: absolute;
  z-index: 5;
  left: 16px;
  right: 88px;
  bottom: 58px;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .7);
}
.creator-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  margin-bottom: 11px;
  padding: 0;
  color: white;
  background: transparent;
  font-weight: 900;
}

.empty-feed {
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 100px 28px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, .24), transparent 48%),
    linear-gradient(315deg, rgba(56, 189, 248, .18), transparent 48%),
    #080a10;
}
.empty-feed > div {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 330px;
}
.empty-feed .logo-mark {
  width: 62px;
  height: 62px;
}
.empty-feed h2 {
  font-size: 34px;
  line-height: 1;
}
.empty-feed p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  color: #111318;
  background: linear-gradient(135deg, var(--mint), var(--gold));
  box-shadow: 0 8px 24px rgba(56, 189, 248, .28);
  font-size: 12px;
  font-weight: 900;
}
.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.avatar.xl { width: 88px; height: 88px; font-size: 28px; }
.clip-meta p { font-size: 15px; line-height: 1.35; font-weight: 650; }
.caption-text {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.show-more {
  display: inline;
  margin-left: 5px;
  padding: 0;
  color: rgba(255, 255, 255, .72);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  text-shadow: inherit;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 900;
}
.tags span:not(.rating-pill) { color: var(--mint); }
.rating-pill {
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  color: white;
  background: rgba(139, 92, 246, .82);
  font-size: 10px;
  font-weight: 900;
}

.side-actions {
  position: absolute;
  z-index: 6;
  right: 10px;
  bottom: 58px;
  display: grid;
  gap: 14px;
  justify-items: center;
}
.action {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 62px;
  min-height: 52px;
  padding: 0;
  color: white;
  background: transparent;
  text-shadow: 0 3px 16px rgba(0, 0, 0, .88);
}
.action svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .75));
  transition: .16s ease;
}
.action span {
  max-width: 62px;
  color: #f6f8ff;
  font-size: 10px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.action.active svg, .action:active svg { color: var(--hot); transform: scale(1.08); }
.tip-action svg { color: var(--mint); }

.video-scrubber {
  position: absolute;
  z-index: 12;
  left: 0;
  right: 0;
  bottom: 1px;
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}
.video-scrubber::-webkit-slider-runnable-track {
  height: 3px;
  background: rgba(255, 255, 255, .24);
}
.video-scrubber::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--mint);
  appearance: none;
  box-shadow: 0 0 18px rgba(56, 189, 248, .65);
}
.video-scrubber::-moz-range-track {
  height: 3px;
  background: rgba(255, 255, 255, .24);
}
.video-scrubber::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--mint);
}

.bottom-nav {
  position: absolute;
  z-index: 55;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 7px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(22px);
}
.nav-btn {
  display: grid;
  place-items: center;
  gap: 3px;
  height: 56px;
  color: rgba(255, 255, 255, .58);
  background: transparent;
  border-radius: 14px;
  font-size: 9px;
  font-weight: 800;
}
.nav-btn svg { width: 23px; height: 23px; }
.nav-btn.active { color: white; }
.nav-btn.center svg {
  width: 42px;
  height: 30px;
  padding: 6px 12px;
  color: #111318;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mint), var(--gold));
  stroke-width: 3;
}

.page-view {
  overflow-y: auto;
  padding-bottom: 86px;
  background:
    radial-gradient(circle at 0% 0%, rgba(96, 165, 250, .2), transparent 30%),
    radial-gradient(circle at 100% 18%, rgba(139, 92, 246, .2), transparent 34%),
    #080a10;
}
.page-pad { padding: 98px 16px 22px; }
.section-head, .reward-hero, .form-panel, .profile-panel, .reward-card, .challenge-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .075);
  backdrop-filter: blur(18px);
}
.section-head, .reward-hero {
  padding: 20px;
  border-radius: 8px;
}
.section-head p, .reward-hero p { margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.eyebrow {
  margin: 0 0 8px !important;
  color: var(--mint) !important;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px !important;
  font-weight: 900;
}
.reward-total {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.reward-total strong { font-size: 26px; }
.reward-total span { color: var(--muted); font-size: 12px; text-align: right; }

.stack-list { display: grid; gap: 10px; margin-top: 12px; }
.admin-content { margin-top: 12px; }
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .075);
}
.admin-card.wide { grid-column: 1 / -1; }
.admin-card strong { font-size: 22px; }
.admin-card span, .admin-card small { color: var(--muted); font-size: 12px; font-weight: 800; }
.storage-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
}
.storage-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--hot));
}
.admin-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
}
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.challenge-admin-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
}
.challenge-admin-card p { color: var(--muted); font-size: 13px; line-height: 1.4; }
.challenge-admin-card small { color: var(--muted); font-size: 12px; font-weight: 800; }
.candidate-list { display: grid; gap: 7px; }
.candidate-row {
  display: grid;
  grid-template-columns: 30px 38px 1fr auto auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
}
.candidate-row > span { color: var(--mint); font-size: 12px; font-weight: 900; }
.candidate-row > small { white-space: nowrap; }
.candidate-row .ghost-btn { min-height: 34px; margin: 0; padding: 0 12px; font-size: 12px; }
.payout-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.payout-form input { margin: 0; }
.list-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 68px;
  padding: 12px;
  color: white;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .075);
}
.list-card.static { cursor: default; }
.rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #111318;
  background: var(--gold);
  font-size: 12px;
  font-weight: 900;
}
.list-copy { min-width: 0; flex: 1; }
.list-copy strong, .list-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-copy small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.pill {
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--mint);
  background: rgba(56, 189, 248, .12);
  font-size: 12px;
  font-weight: 900;
}

.form-panel {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 16px;
  border-radius: 8px;
}
label { color: var(--muted); font-size: 12px; font-weight: 900; }
fieldset {
  margin: 0 0 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .2);
}
legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
input, textarea, select {
  width: 100%;
  margin: 0 0 8px;
  padding: 13px 14px;
  color: white;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  outline: none;
  background: rgba(0, 0, 0, .28);
}
textarea { min-height: 92px; resize: vertical; }
select { appearance: none; }
.upload-preview {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .22);
}
.upload-dropzone {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 24px;
  color: white;
  text-align: center;
  border: 1.5px dashed rgba(167, 139, 250, .62);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, .16), transparent 48%),
    linear-gradient(315deg, rgba(56, 189, 248, .14), transparent 48%),
    rgba(255, 255, 255, .055);
  transition: .18s ease;
}
.upload-dropzone svg {
  width: 42px;
  height: 42px;
  color: var(--mint);
}
.upload-dropzone strong { font-size: 18px; }
.upload-dropzone span { color: var(--muted); font-size: 13px; font-weight: 800; }
.upload-dropzone.dragging,
.upload-dropzone.has-file {
  border-color: var(--mint);
  background:
    linear-gradient(135deg, rgba(56, 189, 248, .18), transparent 48%),
    rgba(255, 255, 255, .085);
  transform: translateY(-1px);
}
.upload-preview img {
  width: 72px;
  aspect-ratio: 9 / 14;
  object-fit: cover;
  border-radius: 6px;
}
.upload-preview span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.primary-btn {
  min-height: 45px;
  padding: 0 16px;
  color: #121318;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mint), var(--gold));
  font-weight: 900;
}
.full { width: 100%; }
.status { min-height: 20px; margin-top: 8px !important; color: var(--mint) !important; font-size: 13px; }
.muted-status { color: var(--muted) !important; }

.challenge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.challenge-card {
  min-height: 132px;
  padding: 14px;
  border-radius: 8px;
}
.challenge-card strong, .reward-card strong { display: block; }
.challenge-card p { margin: 8px 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.challenge-card span, .reward-card small { color: var(--gold); font-size: 12px; font-weight: 900; }
.reward-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
}
.reward-card button {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px;
  color: white;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  text-align: left;
}

.profile-cover {
  height: 188px;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, .48), transparent 52%),
    linear-gradient(315deg, rgba(56, 189, 248, .34), transparent 52%),
    #11141c;
}
.profile-panel {
  margin: -50px 16px 20px;
  padding: 16px;
  border-radius: 8px;
}
.profile-top { text-align: center; }
.profile-top .avatar { margin: 0 auto 12px; }
.profile-avatar-picker {
  position: relative;
  width: 88px;
  height: 88px;
  display: block;
  margin: 0 auto 12px;
  color: white;
  cursor: pointer;
}
.profile-avatar-picker .avatar { margin: 0; }
.camera-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  opacity: 0;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(8px);
  transition: .16s ease;
}
.camera-overlay svg { width: 28px; height: 28px; }
.profile-avatar-picker:hover .camera-overlay,
.profile-avatar-picker:focus-within .camera-overlay { opacity: 1; }
.profile-top p { color: var(--muted); font-size: 13px; }
.profile-bio { margin-top: 8px; line-height: 1.4; }
.profile-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.profile-action-row .follow-btn,
.profile-action-row .ghost-btn { width: 100%; margin: 0; }
.follow-btn { width: 100%; margin-top: 14px; }
.profile-section {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
}
.profile-section h3 { margin: 0 0 4px; }
.avatar-upload-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .22);
}
.avatar-upload-preview .avatar { margin: 0; }
.avatar-upload-preview span:not(.avatar) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}
.setting-row span { display: grid; gap: 3px; }
.setting-row strong { color: white; font-size: 14px; }
.setting-row small { color: var(--muted); font-size: 12px; }
.setting-row input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--mint);
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.metric-grid div {
  min-height: 64px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .075);
}
.metric-grid strong { font-size: 16px; }
.metric-grid span { color: var(--muted); font-size: 11px; font-weight: 800; }
.clip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.clip-owner-tile {
  position: relative;
  min-width: 0;
}
.clip-tile {
  width: 100%;
  aspect-ratio: 9 / 14;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, .28), transparent),
    linear-gradient(315deg, rgba(56, 189, 248, .24), transparent),
    rgba(255, 255, 255, .08);
  font-weight: 900;
}
.clip-tile img { width: 100%; height: 100%; object-fit: cover; }
.delete-clip {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 30px;
  color: white;
  border-radius: 999px;
  background: rgba(124, 58, 237, .9);
  font-size: 11px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .72);
}
.modal-card {
  position: relative;
  width: min(430px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 18, 26, .94);
  backdrop-filter: blur(24px);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .55);
}
.modal-copy {
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.confirm-row {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
}
.primary-btn:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.ghost-btn {
  min-height: 45px;
  margin-top: 8px;
  padding: 0 16px;
  color: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  font-weight: 900;
}
.sheet-card {
  align-self: end;
  width: min(520px, 100%);
  max-height: 78dvh;
  overflow-y: auto;
}
.close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.tip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0 10px;
}
.currency-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 16px 0 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
}
.currency-toggle button {
  height: 36px;
  color: var(--muted);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}
.currency-toggle .active {
  color: #111318;
  background: linear-gradient(135deg, var(--mint), var(--gold));
}
.tip-grid button {
  height: 46px;
  color: white;
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  font-weight: 900;
}
.tip-grid .selected { color: #111318; background: var(--mint); }
.tip-breakdown {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
  font-size: 13px;
}
.tip-breakdown strong { color: white; }
.comments-list { display: grid; gap: 4px; margin: 14px 0; }
.comment {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.comment p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.comment-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.comment-form input { margin: 0; }
.empty { color: var(--muted); font-size: 14px; }
.hidden { display: none !important; }

.messages-page { max-width: 980px; margin: 0 auto; }
.messages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.messages-layout {
  display: grid;
  grid-template-columns: minmax(230px, 320px) 1fr;
  gap: 12px;
  margin-top: 12px;
  min-height: 560px;
}
.message-list-panel,
.message-thread {
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  backdrop-filter: blur(18px);
}
.message-list-panel { overflow: hidden; }
.message-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.message-tabs button {
  height: 38px;
  color: var(--muted);
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}
.message-tabs .active { color: white; background: rgba(255, 255, 255, .12); }
.message-list { display: grid; gap: 4px; padding: 8px; }
.message-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 10px;
  color: white;
  text-align: left;
  border-radius: 8px;
  background: transparent;
}
.message-row.active,
.message-row:hover { background: rgba(255, 255, 255, .1); }
.message-row span { min-width: 0; flex: 1; }
.message-row strong,
.message-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-row small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.message-row i {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--mint);
  background: rgba(56, 189, 248, .12);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}
.message-thread {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
}
.thread-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.thread-head strong,
.thread-head small { display: block; }
.thread-head small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.request-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px;
  padding: 12px;
  border: 1px solid rgba(56, 189, 248, .24);
  border-radius: 8px;
  background: rgba(56, 189, 248, .09);
  color: var(--muted);
  font-size: 13px;
}
.request-banner .primary-btn { min-height: 38px; }
.thread-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 14px;
}
.message-bubble {
  max-width: min(76%, 420px);
  align-self: flex-start;
  padding: 10px 12px;
  border-radius: 16px 16px 16px 5px;
  background: rgba(255, 255, 255, .1);
}
.message-bubble.mine {
  align-self: flex-end;
  color: #111318;
  border-radius: 16px 16px 5px 16px;
  background: linear-gradient(135deg, var(--mint), var(--gold));
}
.message-bubble p { font-size: 14px; line-height: 1.35; }
.message-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.message-compose input { margin: 0; border-radius: 999px; }
.thread-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 100%;
  padding: 28px;
  text-align: center;
}
.thread-empty p { max-width: 300px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.messages-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: grid;
  justify-items: end;
  gap: 10px;
  pointer-events: none;
}
.messages-widget-toggle,
.messages-widget-panel {
  pointer-events: auto;
}
.messages-widget-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 16px;
  color: #111318;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mint), var(--gold));
  box-shadow: 0 18px 50px rgba(56, 189, 248, .24);
  font-size: 13px;
  font-weight: 900;
}
.messages-widget-toggle svg { width: 20px; height: 20px; }
.messages-widget-panel {
  width: min(760px, calc(100vw - 28px));
  height: min(660px, calc(100dvh - 92px));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 10, 16, .94);
  backdrop-filter: blur(24px);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .55);
}
.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.widget-head strong { display: block; font-size: 20px; }
.widget-actions { display: flex; gap: 8px; }
.messages-widget .messages-layout {
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 10px;
}
.messages-widget .message-list-panel,
.messages-widget .message-thread {
  min-height: 0;
}

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 180;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 12px 12px 14px;
  color: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 18, 26, .94);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .38);
  animation: toast-in .18s ease both;
  pointer-events: auto;
}
.toast.success { border-color: rgba(56, 189, 248, .32); }
.toast.error { border-color: rgba(167, 139, 250, .42); }
.toast span {
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}
.toast button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .72);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.toast button svg { width: 16px; height: 16px; }
.toast.leaving {
  opacity: 0;
  transform: translateY(-8px);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.pause-badge {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 50%;
  opacity: 0;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(14px);
  transform: translate(-50%, -50%) scale(.9);
  transition: .18s ease;
}
.pause-badge svg { width: 34px; height: 34px; fill: currentColor; stroke-width: 0; }
.pause-badge.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@media (max-width: 400px) {
  .brand small { display: none; }
  .wallet-pill { min-width: 78px; max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
  .feed-tabs { top: 74px; width: min(calc(100% - 102px), 276px); }
  .discover-search { top: 74px; width: min(calc(100% - 24px), 360px); }
  .clip-meta { right: 78px; }
  .action { width: 54px; }
  .action svg { width: 29px; height: 29px; }
  .challenge-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .messages-layout { grid-template-columns: 1fr; }
  .message-list-panel, .message-thread { min-height: 360px; }
  .bottom-nav .nav-btn span { font-size: 8px; }
  .messages-widget { right: 12px; bottom: 86px; }
  .messages-widget-panel {
    width: calc(100vw - 24px);
    height: min(640px, calc(100dvh - 118px));
  }
  .toast-stack {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (min-width: 900px) {
  .app-shell {
    width: 100%;
    max-width: none;
    box-shadow: none;
    background:
      radial-gradient(circle at 18% 12%, rgba(139, 92, 246, .18), transparent 28%),
      radial-gradient(circle at 86% 6%, rgba(56, 189, 248, .14), transparent 30%),
      #05060a;
  }
  .desktop-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: 244px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    padding: 18px 12px;
    border-right: 1px solid rgba(255, 255, 255, .1);
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(24px);
    transition: width .2s ease;
  }
  .desktop-brand {
    width: 100%;
    min-height: 52px;
    padding: 6px 8px;
    border-radius: 8px;
  }
  .desktop-nav { display: grid; align-content: start; gap: 6px; }
  .desktop-sidebar .nav-btn,
  .collapse-sidebar {
    grid-template-columns: 42px 1fr;
    justify-items: start;
    gap: 10px;
    width: 100%;
    height: 48px;
    padding: 0 10px;
    color: rgba(255, 255, 255, .72);
    text-align: left;
    border-radius: 8px;
    background: transparent;
    font-size: 14px;
  }
  .desktop-sidebar-actions {
    display: grid;
    gap: 8px;
  }
  .desktop-wallet {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }
  .desktop-sidebar .nav-btn svg,
  .collapse-sidebar svg { justify-self: center; }
  .desktop-sidebar .nav-btn.active,
  .desktop-sidebar .nav-btn:hover,
  .collapse-sidebar:hover {
    color: white;
    background: rgba(255, 255, 255, .1);
  }
  .desktop-sidebar .nav-btn.center svg {
    width: 23px;
    height: 23px;
    padding: 0;
    color: currentColor;
    border-radius: 0;
    background: transparent;
    stroke-width: 2;
  }
  .topbar,
  .bottom-nav { display: none; }
  .view {
    left: 244px;
    transition: left .2s ease, opacity .22s ease, transform .22s ease;
  }
  .feed {
    width: min(100%, 520px);
    margin: 0 auto;
    border-inline: 1px solid rgba(255, 255, 255, .08);
  }
  .feed-tabs, .discover-search { top: 18px; }
  .page-pad {
    max-width: 980px;
    margin: 0 auto;
    padding-top: 34px;
  }
  .profile-panel {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }
  .profile-cover { max-width: 760px; margin: 0 auto; border-radius: 0 0 8px 8px; }
  body.sidebar-collapsed .desktop-sidebar { width: 86px; }
  body.sidebar-collapsed .view { left: 86px; }
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .desktop-brand small,
  body.sidebar-collapsed .desktop-brand strong { display: none; }
  body.sidebar-collapsed .desktopSubmitBtn { display: none; }
  body.sidebar-collapsed .desktop-wallet {
    width: 52px;
    min-width: 52px;
    padding: 0;
    overflow: hidden;
    justify-self: center;
    font-size: 0;
  }
  body.sidebar-collapsed #desktopSubmitBtn { display: none; }
  body.sidebar-collapsed .desktop-sidebar .nav-btn,
  body.sidebar-collapsed .collapse-sidebar {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }
  body.sidebar-collapsed .collapse-sidebar svg { transform: rotate(180deg); }
}
