/* ============================================================
   FRESH STYLE — Design tokens (Light = default, Dark = opt-in)
   ============================================================ */
:root {
  color-scheme: light;
  --bg: #FFFDFC;
  --surface: #FFFFFF;
  --white: #FFFFFF;
  --surface-soft: #FFF7F1;
  --bg-light: var(--surface-soft); /* legacy alias used by a few views */
  --surface-elevated: #FFFFFF;
  --peach: #FFE6D2;

  --primary: #FF5A00;
  --primary-hover: #E94F00;
  --accent: #FF6B00; /* legacy alias, secondary orange */
  --accent-soft: #FFF0E6;

  --text: #111827;
  --text-secondary: #4B5563;
  --text-muted: #8A919B;

  --border: #ECE7E2;
  --sidebar-bg: #FFFFFF;
  --sidebar-text: #4B5563;
  --sidebar-text-active: #FF5A00;
  --sidebar-active-bg: #FFF0E6;
  --sidebar-hover: #FFF7F1;
  --sidebar-border: #ECE7E2;

  --success: #16A34A;
  --success-soft: #dcfce7;
  --danger: #EF4444;
  --danger-soft: #fee2e2;
  --warning: #F59E0B;
  --warning-soft: #ffedd5;
  --info: #0f766e;
  --info-soft: #ccfbf1;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-hero: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 3px rgba(17,24,39,.06);
  --shadow-md: 0 8px 30px rgba(17,24,39,.08);
  --shadow-lg: 0 16px 44px rgba(17,24,39,.12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #061018;
  --surface: #0D2632;
  --white: #0D2632; /* card surfaces stay themed, text uses --text */
  --surface-soft: #102D39;
  --bg-light: var(--surface-soft);
  --surface-elevated: #102D39;
  --peach: rgba(255,138,0,0.12);

  --primary: #00E5FF;
  --primary-hover: #22EAFF;
  --accent: #FF6B00;
  --accent-soft: rgba(255,107,0,0.14);

  --text: #F5FAFC;
  --text-secondary: #A8BAC3;
  --text-muted: #6F858F;

  --border: rgba(0,229,255,0.15);
  --sidebar-bg: #0B202B;
  --sidebar-text: #A8BAC3;
  --sidebar-text-active: #00E5FF;
  --sidebar-active-bg: rgba(0,229,255,0.10);
  --sidebar-hover: #102D39;
  --sidebar-border: rgba(0,229,255,0.15);

  --success: #22c55e;
  --success-soft: rgba(34,197,94,0.14);
  --danger: #f87171;
  --danger-soft: rgba(239,68,68,0.16);
  --warning: #fbbf24;
  --warning-soft: rgba(245,158,11,0.16);
  --info: #22EAFF;
  --info-soft: rgba(0,229,255,0.12);

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 8px 30px rgba(0,0,0,.45);
  --shadow-lg: 0 16px 44px rgba(0,0,0,.5), 0 0 0 1px rgba(0,229,255,0.06);
}

* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { overflow-wrap: anywhere; }
.link-plain { color: var(--text); }
.link-plain:hover { color: var(--primary); }
.divider-top { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }

/* ---- App shell ---- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand-mark { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; margin-bottom: 28px; color: var(--text); }
.brand-mark.center { justify-content: center; margin: 0 auto 24px; }
.brand-mark .flame { font-size: 1.15em; line-height: 1; filter: drop-shadow(0 0 6px var(--accent-soft)); }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav a { padding: 10px 12px; border-radius: 8px; color: var(--sidebar-text); font-size: 14px; }
.sidebar nav a:hover { background: var(--sidebar-hover); color: var(--text); }
.sidebar nav a.active { background: var(--sidebar-active-bg); color: var(--sidebar-text-active); font-weight: 600; }
.logout-form button {
  width: 100%; padding: 10px; background: transparent; border: 1px solid var(--sidebar-border); color: var(--sidebar-text);
  border-radius: 8px; cursor: pointer; font-size: 14px; font-family: inherit;
}
.logout-form button:hover { border-color: var(--accent); color: var(--text); }

.main-content { flex: 1; min-width: 0; }
.topbar { padding: 16px 32px; border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar-user { font-size: 14px; color: var(--text-muted); }
.content-inner { padding: 32px; max-width: 1100px; }

/* ---- Theme toggle ---- */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-soft); color: var(--text); cursor: pointer; flex: none;
  font-size: 16px; justify-content: center;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.theme-toggle .icon-dark { display: none; }
[data-theme="dark"] .theme-toggle .icon-light { display: none; }
[data-theme="dark"] .theme-toggle .icon-dark { display: inline; }
.marketing-header .theme-toggle, .guest-theme-toggle { background: var(--surface); }

/* ---- Guest ---- */
.guest-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--surface-soft); padding: 24px 16px; }
.guest-wrap { width: 100%; max-width: 420px; padding: 8px; position: relative; }
.guest-wrap .card { background: var(--surface); box-shadow: var(--shadow-lg); }
.guest-theme-toggle { position: absolute; top: -48px; right: 8px; }
.guest-social { display: flex; gap: 10px; margin: 4px 0 18px; }
.guest-social .btn { flex: 1; }
.guest-divider { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; margin: 4px 0 18px; }
.guest-divider::before, .guest-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.guest-foot { text-align: center; font-size: 14px; color: var(--text-muted); margin-top: 8px; }
.guest-foot a { color: var(--primary); font-weight: 600; }

/* ---- Cards / forms ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
h1 { font-size: clamp(22px, 4vw, 26px); margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.subtitle { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }

.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=datetime-local], input[type=file], textarea, select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; margin-bottom: 16px;
  font-family: inherit; background: var(--surface); color: var(--text); min-height: 44px;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-soft);
}
input:disabled, textarea:disabled, select:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 20px; border-radius: 10px; border: none; cursor: pointer;
  font-weight: 600; font-size: 14px; text-align: center; min-height: 42px;
  font-family: inherit; transition: transform .1s ease, opacity .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary { background: var(--surface-soft); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-sm { padding: 7px 14px; font-size: 13px; min-height: 34px; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 12px; min-height: 50px; }
.btn-block { width: 100%; }
.btn-outline-light { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline-light:hover { border-color: var(--primary); color: var(--primary); }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-gray { background: var(--surface-soft); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-orange { background: var(--accent-soft); color: var(--accent); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-teal { background: var(--info-soft); color: var(--info); }

.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; font-weight: 800; font-size: 12px; color: #7a4a00;
}
.rank-badge-1 { background: linear-gradient(135deg,#FFE9A8,#FFC94A); }
.rank-badge-2 { background: linear-gradient(135deg,#EDEDED,#C7C9CC); color: #4b4b4b; }
.rank-badge-3 { background: linear-gradient(135deg,#F0C29B,#CD8A5B); color: #4a2e12; }

/* Creator/Brand/Video Editor role pills on the public profile header. */
.pill-badge {
  display: inline-flex; align-items: center; padding: 2px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  vertical-align: middle; line-height: 1.8;
}
.pill-badge-creator { background: color-mix(in srgb, var(--primary) 16%, white); color: var(--primary); }
.pill-badge-brand { background: color-mix(in srgb, var(--accent, #FF8A00) 18%, white); color: var(--accent, #FF8A00); }
.pill-badge-video-editor { background: #EEF1FF; color: #4C4FEB; margin-left: 6px; }
/* Plan badge next to names. Color/animation are admin-configured per plan; icon-only (no text pill),
   label shows as a hover tooltip via the title attribute. */
.verified-badge {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--badge-color, var(--primary));
  vertical-align: -4px; margin-left: 3px; line-height: 1;
}
.verified-badge-icon { flex-shrink: 0; display: block; }
/* Compact variant: slightly smaller, for dense rows/tables. */
.verified-badge-compact {
  vertical-align: -3px; margin-left: 2px;
}
.verified-badge-pulse { animation: verifiedBadgePulse 1.8s ease-in-out infinite; }
.verified-badge-glow { animation: verifiedBadgeGlow 2.2s ease-in-out infinite; }
.verified-badge-shine { position: relative; overflow: hidden; }
.verified-badge-shine::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.75) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-20deg); animation: verifiedBadgeShine 2.4s ease-in-out infinite;
}
@keyframes verifiedBadgePulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: .85; } }
@keyframes verifiedBadgeGlow { 0%,100% { filter: drop-shadow(0 0 1px var(--badge-color, var(--primary))); } 50% { filter: drop-shadow(0 0 6px var(--badge-color, var(--primary))); } }
@keyframes verifiedBadgeShine { 0% { left: -60%; } 100% { left: 130%; } }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-soft); }
tbody tr:hover { background: var(--sidebar-hover); }
tbody tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap table { font-size: 13px; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 32px; margin-bottom: 10px; opacity: .6; }

.skeleton { background: linear-gradient(90deg, var(--surface-soft) 25%, var(--border) 37%, var(--surface-soft) 63%); background-size: 400% 100%; animation: skeletonShine 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeletonShine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.countdown { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.countdown-warn { background: var(--warning-soft); color: #9a5b00; }
.countdown-due { background: var(--danger-soft); color: var(--danger); }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: 10px 4px; font-size: 14px; color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--primary); border-color: var(--primary); }

.inline-form { display: inline-block; margin-right: 6px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mt { margin-top: 16px; }
.small { font-size: 13px; color: var(--text-muted); }

@media (max-width: 768px) { .content-inner { padding: 16px; } }

/* ============================================================
   Responsive app shell: off-canvas sidebar + header on mobile
   ============================================================ */
.sidebar { transition: transform 0.25s ease; z-index: 60; }
.sidebar-scroll { flex: 1; overflow-y: auto; }
.sidebar-close { display: none; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 40;
  padding-top: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex: none; }
.topbar-page-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hamburger-btn {
  display: none; width: 38px; height: 38px; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; flex: none;
}
.hamburger-btn span, .hamburger-btn span::before, .hamburger-btn span::after {
  content: ""; display: block; width: 18px; height: 2px; background: var(--text); position: relative;
}
.hamburger-btn span::before { position: absolute; top: -6px; }
.hamburger-btn span::after { position: absolute; top: 6px; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 50; }
.sidebar-overlay.is-open { display: block; }

.user-menu { position: relative; flex: none; }
.user-menu-trigger { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 999px; font-family: inherit; }
.user-menu-trigger:hover { background: var(--surface-soft); }
.avatar-circle {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  flex: none; object-fit: cover; overflow: hidden;
}
.avatar-circle.lg { width: 96px; height: 96px; font-size: 30px; }
.avatar-circle.md { width: 56px; height: 56px; font-size: 18px; }
img.avatar-circle { background: var(--surface-soft); }
.user-menu-name { font-size: 14px; text-align: left; line-height: 1.2; color: var(--text); }
.user-menu-name .role { display: block; font-size: 11px; color: var(--text-muted); text-transform: capitalize; }
.user-menu-caret { font-size: 10px; color: var(--text-muted); }
.user-menu-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; z-index: 70;
}
.user-menu-dropdown.is-open { display: block; }
.user-menu-dropdown a, .user-menu-dropdown button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px;
  background: none; border: none; cursor: pointer; font-family: inherit; color: var(--text);
}
.user-menu-dropdown a:hover, .user-menu-dropdown button:hover { background: var(--surface-soft); }
.user-menu-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

/* ---- Mobile bottom nav ---- */
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .app-shell { position: relative; }
  .hamburger-btn { display: inline-flex; }
  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: 260px; transform: translateX(-100%); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: block; margin-left: auto; background: none; border: none; color: var(--sidebar-text); font-size: 20px; cursor: pointer; line-height: 1; }
  .main-content { width: 100%; padding-bottom: 76px; }
  .topbar { padding: 12px 16px; }
  .user-menu-name { display: none; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around; align-items: center;
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px;
    color: var(--text-muted); padding: 6px 8px; border-radius: 10px; min-width: 44px; min-height: 44px; justify-content: center;
  }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav .icon { font-size: 18px; line-height: 1; }
  .bottom-nav-even a { flex: 1; }
  .bottom-nav a.bottom-nav-create .icon {
    width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 22px; margin-top: -22px;
    box-shadow: var(--shadow-md);
  }
}

/* ============================================================
   Footer (shown on interior pages)
   ============================================================ */
.site-footer {
  margin-top: 40px; padding: 24px 0 8px; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary); }

/* ---- Toggle switch ---- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.switch-row .switch-label { font-weight: 600; font-size: 14px; margin: 0; }
.switch-row .switch-hint { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background-color: var(--border); border-radius: 999px; transition: 0.2s; }
.switch .slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background-color: white; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background-color: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.field-hint { font-size: 12px; color: var(--text-muted); margin: -12px 0 16px; }
.avatar-upload-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

/* ============================================================
   Public profile page
   ============================================================ */
.profile-header {
  background: linear-gradient(135deg, var(--surface-soft), var(--surface)); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; color: var(--text);
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 20px;
}
[data-theme="dark"] .profile-header { background: linear-gradient(135deg, var(--surface-elevated), var(--surface)); }
.profile-header .avatar-circle { border: 3px solid var(--surface); box-shadow: var(--shadow-sm); }
.profile-header h1 { color: var(--text); margin-bottom: 2px; }
.profile-header .headline { color: var(--text-secondary); font-size: 14px; margin: 0 0 8px; }
.profile-header .meta { color: var(--text-muted); font-size: 13px; }
.profile-header .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }

.about-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.about-info-item { display: flex; align-items: flex-start; gap: 10px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.about-info-icon { font-size: 16px; line-height: 1.4; flex: none; }
.about-info-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.about-info-value { display: block; font-size: 13px; font-weight: 600; color: var(--text); word-break: break-word; }
a.about-info-value:hover { color: var(--primary); }
.profile-socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.social-cards-title { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.social-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.social-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 1px 2px rgba(0,0,0,.04); text-decoration: none; color: var(--text); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.social-card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.social-card-icon { flex: none; width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; }
.social-card-icon svg { width: 30px; height: 30px; }
.social-card-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.social-card-name { font-weight: 700; font-size: 15px; }
.social-card-handle { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-card-go { flex: none; color: var(--text-muted); font-size: 18px; }
.social-card:hover .social-card-go { color: var(--primary); }
.social-card-verified { align-self: flex-start; margin-top: 5px; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--success); background: var(--success-soft); padding: 3px 8px; border-radius: 999px; }
.social-cards-title .i3d { width: 20px; height: 20px; flex: none; }
.social-card-verified .i3d { width: 14px; height: 14px; flex: none; }
.social-cards-title .i3d svg, .social-card-verified .i3d svg { width: 100%; height: 100%; display: block; }
@media (max-width: 480px) { .social-cards { grid-template-columns: 1fr; } }
.profile-private-note { text-align: center; padding: 60px 16px; color: var(--text-muted); }

/* ============================================================
   Marketing / landing page
   ============================================================ */
.marketing-header {
  position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); color: var(--text); border-bottom: 1px solid var(--border);
}
.marketing-nav { max-width: 1180px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.marketing-nav .brand-mark { margin-bottom: 0; color: var(--text); }
.marketing-links { display: flex; align-items: center; gap: 24px; }
.marketing-links a { font-size: 14px; color: var(--text-secondary); }
.marketing-links a:hover { color: var(--primary); }
.marketing-cta { display: flex; gap: 10px; align-items: center; }
.marketing-menu-btn { display: none; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: none; cursor: pointer; }
.marketing-menu-btn span, .marketing-menu-btn span::before, .marketing-menu-btn span::after { content: ""; display: block; width: 18px; height: 2px; background: var(--text); position: relative; }
.marketing-menu-btn span::before { position: absolute; top: -6px; }
.marketing-menu-btn span::after { position: absolute; top: 6px; }
.marketing-mobile-panel { display: none; flex-direction: column; padding: 8px 24px 20px; gap: 4px; background: var(--bg); }
.marketing-mobile-panel a { padding: 10px 4px; color: var(--text-secondary); font-size: 15px; }
.marketing-mobile-panel.is-open { display: flex; }

@media (max-width: 820px) {
  .marketing-links { display: none; }
  .marketing-cta .btn-outline-light { display: none; }
  .marketing-menu-btn { display: inline-flex; }
}

.hero { background: linear-gradient(160deg, var(--surface-soft) 0%, var(--bg) 65%); padding: 56px 24px 80px; }
[data-theme="dark"] .hero { background: linear-gradient(160deg, var(--surface-elevated) 0%, var(--bg) 70%); }
.hero-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 48px; flex-wrap: wrap; }
.hero-copy { flex: 1 1 480px; }
.hero-eyebrow { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 999px; margin-bottom: 20px; }
.hero h1 { color: var(--text); font-size: clamp(30px, 5vw, 48px); line-height: 1.12; margin: 0 0 18px; max-width: 640px; }
.hero h1 .hl { color: var(--primary); }
.hero p.lead { color: var(--text-secondary); font-size: 17px; line-height: 1.6; max-width: 560px; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-trust { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-trust .stat-num { font-size: 26px; font-weight: 800; color: var(--text); }
.hero-trust .stat-lbl { font-size: 12px; color: var(--text-muted); }
.hero-panel { flex: 1 1 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-md); }
.hero-panel .panel-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.hero-panel .panel-row:last-child { border-bottom: none; }
.hero-panel .panel-title { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }

.section { max-width: 1180px; margin: 0 auto; padding: 64px 24px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.section-head h2 { font-size: clamp(22px, 3.5vw, 30px); margin: 10px 0 12px; color: var(--text); }
.section-head p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }

/* ---- Category grid ---- */
.category-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.category-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 10px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.category-card .cat-icon { font-size: 22px; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.category-card .cat-name { font-size: 13px; font-weight: 600; color: var(--text); }
.category-card .cat-count { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
@media (max-width: 1024px) { .category-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .category-grid { grid-template-columns: repeat(2, 1fr); } }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 16px; }
.feature-card h3 { font-size: 16px; margin: 0 0 8px; color: var(--text); }
.feature-card p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin: 0; }

.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; counter-reset: step; }
.step-card { position: relative; padding-left: 4px; }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; font-size: 15px; }
.step-card h3 { font-size: 15px; margin: 0 0 6px; color: var(--text); }
.step-card p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin: 0; }

.section-dark { background: var(--surface-soft); }
[data-theme="dark"] .section-dark { background: var(--surface-elevated); }

.audience-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.audience-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-sm); }
.audience-card h3 { color: var(--text); font-size: 19px; margin: 0 0 6px; }
.audience-card p.tagline { color: var(--primary); font-size: 13px; font-weight: 600; margin: 0 0 18px; }
.audience-card ul { list-style: none; padding: 0; margin: 0 0 22px; }
.audience-card li { color: var(--text-secondary); font-size: 14px; padding: 7px 0 7px 26px; position: relative; }
.audience-card li::before { content: "\2713"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

.mini-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.mini-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); text-align: center; }
.mini-card .avatar-circle { margin: 0 auto 10px; }

.cta-band { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border-radius: var(--radius-hero); padding: 48px 32px; text-align: center; margin: 0 auto 72px; max-width: 1132px; }
.cta-band h2 { color: #fff; font-size: clamp(22px,4vw,28px); margin: 0 0 10px; }
.cta-band p { color: rgba(255,255,255,0.9); margin: 0 0 26px; }
.cta-band .btn-primary { background: #fff; color: var(--primary); }

.marketing-footer { background: var(--surface-soft); color: var(--text-muted); padding: 48px 24px 24px; border-top: 1px solid var(--border); }
[data-theme="dark"] .marketing-footer { background: var(--surface-elevated); }
.marketing-footer-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.marketing-footer .brand-mark { color: var(--text); margin-bottom: 12px; }
.marketing-footer-col h4 { color: var(--text); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 14px; }
.marketing-footer-col a { display: block; color: var(--text-muted); font-size: 14px; padding: 5px 0; }
.marketing-footer-col a:hover { color: var(--primary); }
.marketing-tagline { font-style: italic; color: var(--text-muted); font-size: 13px; }
.marketing-footer-bottom { max-width: 1180px; margin: 32px auto 0; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---- Pricing / plan cards ---- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 24px; box-shadow: var(--shadow-sm); text-align: center; position: relative; }
.plan-card.is-current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-card .plan-name { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.plan-card .plan-price { font-size: 30px; font-weight: 800; color: var(--primary); margin: 10px 0; }
.plan-card .plan-price span { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.plan-card ul { list-style: none; padding: 0; margin: 18px 0; text-align: left; }
.plan-card li { padding: 6px 0 6px 22px; position: relative; font-size: 13px; color: var(--text-secondary); }
.plan-card li::before { content: "\2713"; position: absolute; left: 0; color: var(--primary); }

@media (max-width: 640px) {
  .hero { padding: 40px 16px 56px; }
  .section { padding: 44px 16px; }
  .profile-header { padding: 22px; text-align: center; justify-content: center; }
  .profile-header .actions { margin-left: 0; justify-content: center; width: 100%; }
  .cta-band { margin: 0 16px 48px; padding: 32px 20px; }
}

/* ---------- Campaign media: Instagram-style swipeable gallery ---------- */
.ig-gallery { position: relative; width: 100%; max-width: 480px; margin: 0 auto 16px; border-radius: var(--radius); overflow: hidden; background: #000; }
.ig-gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ig-gallery-track::-webkit-scrollbar { display: none; }
.ig-gallery-slide { position: relative; flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center; background: #000; overflow: hidden; }
/* Photos and videos are shown whole (object-fit: contain) — never zoomed or cut. A blurred copy fills any leftover space. */
.ig-gallery-slide .ig-bg { position: absolute; inset: -24px; background-size: cover; background-position: center; filter: blur(22px) saturate(1.15); opacity: .85; transform: scale(1.05); pointer-events: none; }
.ig-gallery-slide img, .ig-gallery-slide video { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
.ig-gallery-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.ig-gallery-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5); }
.ig-gallery-dot.is-active { background: #fff; }
.ig-gallery-counter { position: absolute; top: 10px; right: 12px; background: rgba(0,0,0,0.55); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }

/* ---------- Generic upload thumbnail grid ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.media-grid-item { position: relative; border-radius: 8px; overflow: hidden; background: var(--surface-soft); }
.media-grid-item img, .media-grid-item video { width: 100%; height: 140px; object-fit: contain; background: #0b0b0c; display: block; }
.media-grid-save { position: absolute; bottom: 6px; left: 6px; background: rgba(255,255,255,.92); color: #111; }
.media-grid-item form { position: absolute; bottom: 6px; right: 6px; }

/* ---------- Campaign capacity indicator ---------- */
.capacity-bar-track { width: 100%; height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 6px 0; }
.capacity-bar-fill { height: 100%; background: var(--primary); border-radius: 999px; }

/* ---------- 404 / error pages ---------- */
.error-page { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 16px; }
.error-page .error-code { font-size: clamp(64px, 14vw, 120px); font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 8px; }
.error-page h1 { font-size: 22px; margin-bottom: 8px; }
.error-page p { color: var(--text-muted); margin-bottom: 24px; max-width: 420px; }

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

/* ============================================================
   PHASE: Campaign card, creator card, chips, nav icons, hero pills
   ============================================================ */
.avatar-circle.sm { width: 32px; height: 32px; font-size: 13px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.chip-soft { background: var(--accent-soft); color: var(--accent); }
.chip-on-image { background: rgba(255,255,255,0.92); color: #111; position: absolute; top: 10px; right: 10px; }

.campaign-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.campaign-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); position: relative; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.campaign-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.campaign-card-featured { position: absolute; top: 10px; left: 10px; z-index: 2; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.campaign-card-banner { display: block; position: relative; aspect-ratio: 16 / 9; height: auto; display: flex; align-items: center; justify-content: center; }
.campaign-card-banner-icon { font-size: 36px; opacity: .9; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.campaign-card-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.campaign-card-brand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.campaign-card-logo { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.campaign-card-brand-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.campaign-card-title { font-size: 16px; margin: 0; line-height: 1.35; }
.campaign-card-title a { color: var(--text); }
.campaign-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); }
.campaign-card-stats > div { display: flex; flex-direction: column; align-items: center; text-align: center; }
.campaign-card-stats .stat-top { font-weight: 700; font-size: 14px; color: var(--text); }
.campaign-card-stats .stat-bottom { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.hero-stat-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero-stat-pill { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 18px; display: flex; flex-direction: column; align-items: center; box-shadow: var(--shadow-sm); min-width: 96px; }
.hero-stat-pill .stat-figure { display: inline-flex; align-items: baseline; justify-content: center; gap: 1px; line-height: 1.15; white-space: nowrap; }
.hero-stat-pill .stat-num { font-size: 18px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.hero-stat-pill .stat-plus { font-size: 18px; font-weight: 800; color: var(--primary); }
.hero-stat-pill .stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.creator-mini-card { display: flex; flex-direction: column; align-items: center; }
.creator-mini-card img.avatar-circle { object-fit: cover; }

/* ---- Sidebar: icon groups + active state ---- */
.sidebar nav a { display: flex; align-items: center; gap: 10px; }
.sidebar nav a .nav-icon { width: 18px; text-align: center; font-size: 14px; flex: none; opacity: .9; }
.nav-group + .nav-group { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--sidebar-border); }
.nav-group-label { display: block; text-transform: uppercase; font-size: 10.5px; letter-spacing: .06em; font-weight: 700; color: var(--text-muted); padding: 0 12px; margin-bottom: 6px; }

@media (max-width: 768px) {
  .campaign-card-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 480px) {
  .campaign-card-grid { grid-template-columns: 1fr; }
  .hero-stat-pills { justify-content: space-between; }
  .hero-stat-pill { flex: 1; min-width: 0; padding: 10px 8px; }
}

/* ============================================================
   PHASE 2: Wallet, notifications, messages, dashboards, tabs
   ============================================================ */

/* ---- Wallet balance hero card ---- */
.wallet-balance-card { background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 70%, #7a1f00) 100%); border-radius: var(--radius-lg); padding: 26px 24px; color: #fff; box-shadow: var(--shadow-md); margin-bottom: 18px; }
.wallet-balance-label { font-size: 13px; opacity: .85; font-weight: 600; }
.wallet-balance-value { font-size: 34px; font-weight: 800; margin: 4px 0 16px; }
.wallet-balance-actions { display: flex; gap: 10px; margin-bottom: 18px; }
.btn-light-on-primary { background: #fff; color: var(--primary); border: none; font-weight: 700; }
.btn-outline-on-primary { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.6); }
.wallet-balance-sub { display: flex; gap: 24px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.25); }
.wallet-balance-sub .stat-top { display: block; font-size: 16px; font-weight: 700; }
.wallet-balance-sub .stat-bottom { display: block; font-size: 11px; opacity: .8; margin-top: 2px; }

/* ---- Transaction rows ---- */
.transaction-list { display: flex; flex-direction: column; }
.transaction-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.transaction-row:last-child { border-bottom: none; }
.transaction-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; font-size: 15px; }
.transaction-icon.is-in { background: var(--success-soft); color: var(--success); }
.transaction-icon.is-out { background: var(--danger-soft); color: var(--danger); }
.transaction-main { flex: 1; min-width: 0; }
.transaction-desc { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transaction-amounts { text-align: right; flex: none; }
.transaction-amount { display: block; font-weight: 700; font-size: 14px; }

/* ---- Notifications ---- */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); }
.notif-item.is-unread { border-color: var(--accent-soft); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.notif-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 13px; color: var(--text-secondary); margin: 3px 0 8px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; margin-top: 4px; }

/* ---- Conversation list ---- */
.conversation-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.conversation-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.conversation-row:last-child { border-bottom: none; }
.conversation-row:hover { background: var(--sidebar-hover); }
.conversation-row.is-unread strong { color: var(--text); }
.conversation-row-main { flex: 1; min-width: 0; }
.conversation-preview { font-size: 13px; color: var(--text-muted); margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-time { font-size: 11px; color: var(--text-muted); flex: none; }
.conversation-unread { flex: none; }

/* ---- Chat shell (full-screen conversation view) ---- */
.chat-shell { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); min-height: 60vh; }
.chat-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.chat-back { color: var(--text); font-size: 18px; text-decoration: none; flex: none; }
.chat-header-name { font-weight: 700; font-size: 15px; }
.chat-thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; max-height: 480px; }
.msg-row { display: flex; flex-direction: column; max-width: 78%; }
.msg-row-out { align-self: flex-end; align-items: flex-end; }
.msg-row-in { align-self: flex-start; align-items: flex-start; }
.chat-bubble { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.chat-bubble-out { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble-in { background: var(--surface-soft); color: var(--text); border-bottom-left-radius: 4px; }
.chat-meta { margin-top: 4px; color: var(--text-muted); }
.chat-composer { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-composer textarea { flex: 1; margin: 0; resize: none; min-height: 42px; max-height: 120px; }
.chat-send { flex: none; margin-bottom: 0; }

/* ---- Generic entity row (dashboards, applications, deals lists) ---- */
.entity-list { display: flex; flex-direction: column; }
.entity-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.entity-row:last-child { border-bottom: none; }
.entity-row-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 15px; flex: none; font-weight: 700; }
.entity-row-main { flex: 1; min-width: 0; }
.entity-row-main strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-row-main .small { display: block; margin-top: 2px; }
.entity-row-status { flex: none; }

/* ---- Dashboard stat pills (reuse hero-stat-pill layout at smaller size) ---- */
.dash-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.dash-stat-pill { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: var(--shadow-sm); }
.dash-stat-pill .stat-value { font-size: 22px; font-weight: 800; color: var(--primary); }
.dash-stat-pill .stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab-link { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Leaderboard rank cards ---- */
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow-sm); }
.rank-row.top-3 { background: linear-gradient(90deg, var(--accent-soft), var(--surface)); border-color: var(--accent); }
.rank-position { width: 28px; text-align: center; font-weight: 800; color: var(--text-muted); flex: none; }
.rank-row.top-3 .rank-position { color: var(--primary); font-size: 16px; }
.rank-main { flex: 1; min-width: 0; }
.rank-main strong { display: block; font-size: 14px; }
.rank-score { text-align: right; flex: none; }
.rank-score .num { font-weight: 800; color: var(--primary); font-size: 15px; }

/* ---- Auth card polish ---- */
.guest-wrap .card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

@media (max-width: 480px) {
  .dash-stat-row { gap: 8px; }
  .dash-stat-pill { padding: 10px 6px; }
  .dash-stat-pill .stat-value { font-size: 18px; }
  .msg-row { max-width: 88%; }
}

/* ============================================================
   Crop dialog (profile photo / campaign cover / gallery photos)
   The frame is sized in JS to the exact aspect ratio, so what is
   shown inside it is exactly what gets saved.
   ============================================================ */

.crop-modal { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.66); align-items: center; justify-content: center; padding: 12px; }
.crop-modal.is-open { display: flex; }
.crop-modal-inner { position: relative; background: var(--surface); color: var(--text); border-radius: var(--radius-lg); padding: 18px 18px 16px; width: 100%; max-width: 470px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; box-shadow: var(--shadow-md); }
.crop-modal-inner h3 { margin: 0 34px 4px 0; }
.crop-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.crop-ratios { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.crop-ratio { border: 1px solid var(--border); background: var(--surface-soft); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.crop-ratio.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.crop-ratio-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.28); }
.crop-ratio:not(.is-active) .crop-ratio-tag { background: var(--accent-soft); color: var(--primary); }
.crop-stage-wrap { display: flex; justify-content: center; margin: 12px 0; }
.crop-stage { position: relative; overflow: hidden; border-radius: var(--radius); background: #111; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; flex: none; box-shadow: 0 0 0 1px var(--border); }
.crop-stage.is-grabbing { cursor: grabbing; }
.crop-img { position: absolute; max-width: none; max-height: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(to right, transparent 33.2%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.4%, rgba(255,255,255,.35) 66.6%, transparent 66.8%),
  linear-gradient(to bottom, transparent 33.2%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.4%, rgba(255,255,255,.35) 66.6%, transparent 66.8%);
  opacity: 0; transition: opacity .15s ease; }
.crop-stage.is-grabbing .crop-grid { opacity: 1; }
.crop-circle-mask { display: none; position: absolute; inset: 0; pointer-events: none; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.58); outline: 2px solid rgba(255,255,255,.95); outline-offset: -2px; }
.crop-modal.is-circle .crop-circle-mask { display: block; }
.crop-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.crop-controls .crop-zoom { flex: 1; min-width: 0; }
.crop-step { width: 34px; height: 34px; flex: none; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-soft); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.crop-frame-row { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.crop-frame-row .crop-frame { flex: 1; min-width: 0; }
.crop-preview { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin-bottom: 10px; border: 1px dashed var(--border); border-radius: var(--radius); }
.crop-preview-canvas { width: 72px; height: 72px; border-radius: 50%; background: var(--surface-soft); flex: none; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border); }
.crop-preview-text { display: flex; flex-direction: column; gap: 2px; }
.crop-meta { margin: 0 0 12px; color: var(--text-muted); }
.crop-meta.is-warn { color: #b45309; }
.crop-actions { display: flex; justify-content: flex-end; gap: 8px; }
.avatar-circle.has-photo { color: transparent; background-color: var(--surface-soft); }

/* ============================================================
   Campaign media uploader (live previews, cover, progress)
   ============================================================ */
.mu-guide { border: 1px solid var(--border); background: var(--surface-soft); border-radius: var(--radius); padding: 0; margin: 4px 0 14px; }
.mu-guide > summary { cursor: pointer; padding: 12px 14px; font-weight: 700; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mu-guide > summary::-webkit-details-marker { display: none; }
.mu-guide > summary::after { content: '\25be'; color: var(--text-muted); transition: transform .15s ease; }
.mu-guide[open] > summary::after { transform: rotate(180deg); }
.mu-guide-body { padding: 0 14px 14px; }
.mu-guide-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 10px; }
.mu-guide-table th, .mu-guide-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.mu-guide-table th { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.mu-guide-table td strong { white-space: nowrap; }
.mu-guide-tips { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.mu-guide-tips li { margin: 3px 0; }
.mu-shapes { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 4px; }
.mu-shape { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-muted); text-align: center; }
.mu-shape i { display: block; background: var(--accent-soft); border: 2px solid var(--primary); border-radius: 4px; }

.mu-cover { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 14px; align-items: center; margin: 6px 0 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.mu-cover-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-soft); border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 12px; text-align: center; padding: 6px; }
.mu-cover.has-cover .mu-cover-frame { border-style: solid; padding: 0; }
.mu-cover-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mu-cover-info strong { display: block; margin-bottom: 2px; }
.mu-cover-info p { margin: 2px 0 8px; }
@media (max-width: 560px) { .mu-cover { grid-template-columns: 1fr; } }

.mu-drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-soft); transition: border-color .15s ease, background .15s ease; }
.mu-drop.is-over { border-color: var(--primary); background: var(--accent-soft); }
.mu-drop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.mu-drop-head .small { margin: 0; }
.mu-count { font-weight: 700; font-size: 13px; color: var(--text-muted); }
.mu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mu-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 14px 6px; }
.mu-tile { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; }
.mu-tile.is-new { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.mu-tile.is-cover { outline: 3px solid var(--primary); outline-offset: -3px; }
.mu-thumb { display: block; width: 100%; aspect-ratio: 4 / 5; border: 0; padding: 0; background: #0b0b0c; position: relative; cursor: zoom-in; overflow: hidden; }
.mu-thumb img, .mu-thumb video { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.mu-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; text-shadow: 0 2px 8px rgba(0,0,0,.6); pointer-events: none; }
.mu-badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.62); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.mu-cover-flag { display: none; position: absolute; top: 6px; right: 6px; background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.mu-tile.is-cover .mu-cover-flag { display: block; }
.mu-meta { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px 0; font-size: 11px; color: var(--text-muted); }
.mu-actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px 8px; }
.mu-btn { border: 1px solid var(--border); background: var(--surface-soft); color: var(--text); font-size: 12px; font-weight: 600; border-radius: 8px; padding: 5px 9px; min-height: 30px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.mu-btn:hover { border-color: var(--primary); color: var(--primary); }
.mu-btn-cover { background: var(--accent-soft); color: var(--primary); border-color: transparent; }
.mu-btn-icon { padding: 5px 8px; }
.mu-btn-danger { color: var(--danger); margin-left: auto; }
.mu-btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.mu-status { margin: 10px 0 0; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); }
.mu-status.is-warn { background: #fef3c7; color: #92400e; }
.mu-status.is-error { background: var(--danger-soft); color: #991b1b; }
[data-theme="dark"] .mu-status.is-warn { background: #3b2f0b; color: #fcd34d; }
[data-theme="dark"] .mu-status.is-error { background: #3f1515; color: #fca5a5; }
.mu-fallback { display: block; }
.is-enhanced .mu-fallback { display: none; }
.mu-enhanced-only { display: none; }
.mu-root { position: relative; }
.is-enhanced .mu-enhanced-only { display: block; }
.is-enhanced .mu-cover.mu-enhanced-only { display: grid; }
.is-enhanced .mu-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.mu-progress { display: none; position: fixed; inset: 0; z-index: 350; background: rgba(0,0,0,.6); align-items: center; justify-content: center; padding: 16px; }
.mu-progress.is-open { display: flex; }
.mu-progress-box { background: var(--surface); color: var(--text); border-radius: var(--radius-lg); padding: 20px 22px; width: 100%; max-width: 380px; box-shadow: var(--shadow-md); }
.mu-progress-track { height: 10px; border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--border); overflow: hidden; margin: 12px 0 8px; }
.mu-progress-fill { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .15s ease; }
.mu-progress-text { margin: 0; }

/* ============================================================
   Download buttons
   ============================================================ */
.dl-btn { display: inline-flex; align-items: center; gap: 6px; }
.dl-btn.is-busy { opacity: .7; pointer-events: none; }
.media-dl-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -6px auto 14px; max-width: 480px; }
.lb-download { position: absolute; top: 10px; left: 10px; z-index: 5; display: none; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(17,24,39,.72); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.lb-download.is-visible { display: inline-flex; }
.lb-download:hover { background: rgba(17,24,39,.95); }
.lb-download.is-busy { opacity: .7; pointer-events: none; }

/* ============================================================
   Reviews (profile tab + all-reviews page)
   ============================================================ */
.stars { display: inline-flex; gap: 1px; font-size: 16px; line-height: 1; vertical-align: middle; }
.star { color: var(--border); }
.star.is-filled { color: #F5A623; }
.tab-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--accent-soft); color: var(--primary); font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.review-rating { display: flex; align-items: center; gap: 8px; }
.review-campaign { margin: 8px 0 0; }
.review-campaign-label { color: var(--text-muted); }
.review-campaign-link { color: var(--primary); font-weight: 600; }
.review-comment { margin: 8px 0 0; }
.review-date { margin: 6px 0 0; color: var(--text-muted); }
.review-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.review-summary-score { font-size: 40px; font-weight: 800; line-height: 1; }
.review-overview { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; margin-bottom: 8px; }
.review-breakdown { flex: 1 1 220px; min-width: 200px; }
.review-breakdown-row { display: grid; grid-template-columns: 34px 1fr 28px; align-items: center; gap: 8px; margin: 4px 0; }
.review-breakdown-row .capacity-bar-track { margin: 0; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ============================================================
   Media pop-up (lightbox) — shared by Browse Campaigns, admin
   campaign view and the Social Verification / Video Editor guides
   ============================================================ */

.lb-overlay { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(6, 10, 16, .82); }
.lb-overlay.is-open { display: flex; }
.lb-dialog { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 920px; max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.lb-dialog.lb-has-details { max-width: 1040px; }
.lb-close { position: absolute; top: 10px; right: 10px; z-index: 5; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(17, 24, 39, .72); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-close:hover { background: rgba(17, 24, 39, .95); }
.lb-body { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.lb-stage { position: relative; flex: 1 1 auto; min-height: 240px; background: #000; display: flex; align-items: center; justify-content: center; }
.lb-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; max-height: 68vh; min-height: 240px; }
.lb-slide img, .lb-slide video { max-width: 100%; max-height: 68vh; width: auto; height: auto; object-fit: contain; display: block; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(17, 24, 39, .7); color: #fff; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-nav:hover { background: rgba(17, 24, 39, .95); }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-nav[hidden] { display: none; }
.lb-counter { position: absolute; left: 12px; bottom: 10px; z-index: 4; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.lb-caption { padding: 12px 18px 0; }
.lb-caption strong { display: block; }
.lb-details { padding: 16px 18px 20px; }
.lb-details h3 { margin: 0 0 6px; }
.lb-details .lb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.lb-details .lb-stats { display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 0; }
.lb-details .lb-stats div { display: flex; flex-direction: column; }
.lb-details .lb-stats .lb-stat-top { font-weight: 700; font-size: 18px; }
.lb-details .lb-stats .lb-stat-bottom { font-size: 12px; color: var(--text-muted); }
.lb-details p { margin: 8px 0; white-space: pre-line; }
.lb-details .lb-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
@media (min-width: 860px) {
  .lb-dialog.lb-has-details .lb-body { flex-direction: row; }
  .lb-dialog.lb-has-details .lb-stage { flex: 1 1 58%; }
  .lb-dialog.lb-has-details .lb-side { flex: 1 1 42%; overflow-y: auto; max-height: calc(100vh - 32px); }
}
.lb-trigger { cursor: zoom-in; }
button.lb-trigger { border: 0; padding: 0; font: inherit; color: inherit; background: none; text-align: inherit; }

/* Swipeable guide gallery (Social Verification / Video Editor pages) */
.guide-gallery { position: relative; margin: 0 0 16px; }
.guide-gallery-title { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.guide-gallery-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 6px; scrollbar-width: thin; }
.guide-gallery-item { flex: 0 0 72%; max-width: 320px; scroll-snap-align: start; position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: #000; cursor: zoom-in; border: 1px solid var(--border); padding: 0; }
.guide-gallery-item img, .guide-gallery-item video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.guide-gallery-item .guide-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 38px; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); pointer-events: none; }
.guide-gallery-item .guide-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; font-size: 12.5px; text-align: left; pointer-events: none; }
.guide-gallery-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
@media (min-width: 700px) { .guide-gallery-item { flex-basis: 220px; } }

/* Campaign card media thumbnail (Browse Campaigns) */
.campaign-card-banner.has-media { padding: 0; overflow: hidden; background: #000 !important; position: relative; }
.campaign-card-banner.has-media img, .campaign-card-banner.has-media video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
/* No saved cover yet: the first photo/video is shown whole on a blurred copy of itself, never zoomed. */
.campaign-card-banner.has-media.is-fit img, .campaign-card-banner.has-media.is-fit video { position: relative; z-index: 1; object-fit: contain; }
.campaign-card-banner .banner-bg { position: absolute; inset: -16px; background-size: cover; background-position: center; filter: blur(18px) saturate(1.1); opacity: .85; pointer-events: none; }
.campaign-card-banner .media-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); pointer-events: none; }
.campaign-card-banner .media-count { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; pointer-events: none; }
button.campaign-card-banner { width: 100%; cursor: zoom-in; border: 0; font: inherit; }

/* Admin detail pages */
.admin-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.kv-list { margin: 0; padding: 0; list-style: none; }
.kv-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv-list li:last-child { border-bottom: 0; }
.kv-list .k { color: var(--text-muted); flex: 0 0 auto; }
.kv-list .v { text-align: right; word-break: break-word; }
.admin-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.admin-media-tile { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.admin-media-thumb { position: relative; aspect-ratio: 4 / 5; background: #000; display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; }
.admin-media-thumb img, .admin-media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.admin-media-thumb .media-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6); pointer-events: none; }
.admin-media-meta { padding: 8px; font-size: 12.5px; }
.admin-media-meta form { margin-top: 6px; }
.campaign-card-banner.has-media { height: 180px; }

/* ============================================================
   Workflow page (public view + admin editor)
   ============================================================ */
.wf-page { max-width: 860px; margin: 0 auto; }
.wf-preview-note { background: var(--accent-soft); border: 1px dashed var(--primary); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.wf-preview-note a { color: var(--primary); font-weight: 600; margin-left: 6px; }
.wf-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.wf-tab { padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; }
.wf-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.wf-hero { text-align: center; padding: 8px 0 22px; }
.wf-hero h1 { margin: 10px 0 8px; }
.wf-subtitle { color: var(--text-muted); font-size: 17px; max-width: 640px; margin: 0 auto 14px; }
.wf-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wf-hero .wf-buttons, .wf-footer .wf-buttons { justify-content: center; }
.wf-heading { margin: 30px 0 12px; }
.wf-heading h2 { margin: 0 0 4px; }
.wf-heading .wf-body { color: var(--text-muted); }
.wf-icon { margin-right: 8px; }
.wf-body p { margin: 8px 0; }
.wf-body ul { margin: 8px 0; padding-left: 20px; }
.wf-body li { margin: 4px 0; }
.wf-body a { color: var(--primary); text-decoration: underline; }
.wf-step { display: flex; gap: 14px; align-items: flex-start; position: relative; margin-bottom: 14px; }
.wf-step:not(:last-child)::before { content: ""; position: absolute; left: 19px; top: 44px; bottom: -16px; width: 2px; background: var(--border); }
.wf-step-num { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; position: relative; z-index: 1; }
.wf-step-card { flex: 1 1 auto; min-width: 0; margin: 0; }
.wf-step-card h3, .wf-card h3, .wf-text h3 { margin: 0 0 6px; }
.wf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 14px 0; }
.wf-card { margin: 0; }
.wf-callout { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.wf-callout-icon { font-size: 22px; line-height: 1.2; }
.wf-faq { margin: 14px 0; }
.wf-faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 8px; padding: 0 14px; }
.wf-faq-item summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.wf-faq-item[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.wf-faq-item .wf-buttons { margin-bottom: 12px; }
.wf-text { margin: 14px 0; }
.wf-media { position: relative; display: block; width: 100%; max-width: 420px; margin-top: 10px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #000; cursor: zoom-in; }
.wf-media img, .wf-media video { width: 100%; max-height: 260px; object-fit: cover; display: block; pointer-events: none; }
.wf-media .media-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6); pointer-events: none; }
.wf-footer { text-align: center; margin: 28px 0 8px; }
@media (max-width: 560px) { .wf-step { gap: 10px; } .wf-step-num { flex-basis: 34px; width: 34px; height: 34px; } .wf-step:not(:last-child)::before { left: 16px; top: 38px; } }

/* admin editor */
.wf-admin-tabs { display: flex; gap: 8px; margin: 12px 0 16px; flex-wrap: wrap; }
.wf-admin-section { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; }
.wf-admin-section > summary { cursor: pointer; padding: 10px 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; list-style: none; }
.wf-admin-section > summary::-webkit-details-marker { display: none; }
.wf-admin-section > summary .wf-admin-title { font-weight: 600; flex: 1 1 200px; min-width: 0; }
.wf-admin-section.is-hidden { opacity: .65; }
.wf-admin-body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.wf-admin-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.wf-admin-btnrow { display: grid; grid-template-columns: 1.2fr 1.6fr .9fr auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.wf-admin-btnrow.has-audience { grid-template-columns: 1.1fr 1.4fr .8fr .8fr auto auto; }
.wf-admin-btnrow input, .wf-admin-btnrow select { margin: 0; }
.wf-admin-btnrow label { display: flex; gap: 4px; align-items: center; margin: 0; font-size: 12.5px; white-space: nowrap; }
.wf-admin-btnrow label input { width: auto; }
.wf-admin-btn-item { border-bottom: 1px dashed var(--border); padding: 8px 0; }
.wf-admin-btn-tools { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.wf-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .wf-admin-btnrow, .wf-admin-btnrow.has-audience, .wf-grid-2 { grid-template-columns: 1fr; } }

/* ---------- Support tickets ---------- */
.ticket-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.ticket-msg { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.ticket-msg-user { background: var(--surface-soft); }
.ticket-msg-staff { border-color: var(--primary); background: var(--accent-soft); }
.ticket-msg-note { border-style: dashed; border-color: var(--accent); background: transparent; }
.ticket-msg-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ticket-msg-body { font-size: 14px; line-height: 1.6; word-break: break-word; }
.ticket-attachment { display: block; max-width: 260px; max-height: 220px; margin-top: 10px; border-radius: 8px; border: 1px solid var(--border); }

/* ---------- Message delivery ticks (sent / delivered / read) ---------- */
.tick { display: inline-flex; vertical-align: middle; margin-left: 4px; color: var(--text-muted); line-height: 1; }
.tick-svg { display: block; }
.tick .tick-1, .tick .tick-2, .tick .tick-clock { display: none; }
.tick[data-status="sending"] .tick-clock { display: inline; }
.tick[data-status="sent"] .tick-1 { display: inline; }
.tick[data-status="delivered"] .tick-1, .tick[data-status="delivered"] .tick-2 { display: inline; }
.tick[data-status="read"] .tick-1, .tick[data-status="read"] .tick-2 { display: inline; }
.tick[data-status="read"] { color: #34B7F1; }
.tick[data-status="failed"] { color: var(--danger); }
.tick[data-status="failed"] .tick-clock { display: inline; }
.tick-retry { color: var(--danger); font-weight: 600; }
.conversation-preview .tick { margin: 0 6px 0 0; }
.chat-live { margin-left: auto; font-size: 10px; color: var(--text-muted); }
.chat-live.is-on { color: var(--success); }
.chat-live.is-off { color: var(--danger); }
.nav-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.nav-badge[hidden] { display: none; }

/* ---- Achievements box (public profile -> About) + Founding pills ---- */
.achievement-box { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; background: var(--surface-soft); }
.achievement-title { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.achievement-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.achievement-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 13px; }
.achievement-pill-founding { background: linear-gradient(135deg, #FFB347, #FF5A00); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(255, 90, 0, .28); }
[data-theme="dark"] .achievement-pill-founding { background: linear-gradient(135deg, #FF8A00, #FF5A00); }

/* ---- KYC ---- */
.kyc-card h2 { font-size: 17px; margin: 0 0 8px; }
.kyc-doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kyc-doc-slot input[type=file] { width: 100%; }
.kyc-preview { display: block; max-width: 100%; max-height: 220px; margin-top: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); object-fit: contain; background: var(--surface-soft); }
.kyc-selfie { border: 1px dashed var(--border); border-radius: var(--radius-md); padding: 14px; background: var(--surface-soft); }
.kyc-video-wrap { position: relative; max-width: 420px; margin: 0 auto 10px; border-radius: var(--radius-md); overflow: hidden; background: #000; }
.kyc-video-wrap video { width: 100%; display: block; transform: scaleX(-1); }
.kyc-code-chip { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.65); color: #fff; padding: 6px 12px; border-radius: 999px; font-size: 14px; }
.kyc-code-chip strong { letter-spacing: 3px; font-size: 18px; }
.kyc-selfie-preview { margin: 0 auto 10px; max-height: 280px; }
.kyc-selfie-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.kyc-camera-error, .kyc-error { color: var(--danger); margin-top: 8px; }
@media (max-width: 560px) { .kyc-doc-grid { grid-template-columns: 1fr; } }

/* ---- Admin role chip + "Login as user" bar ---- */
.nav-role-chip { margin: 0 14px 10px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; text-align: center; }
.impersonation-bar { position: sticky; top: 0; z-index: 10000; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 8px 14px; background: #b42318; color: #fff; font-size: 13.5px; }
.impersonation-bar strong { color: #fff; }
.impersonation-bar .btn { background: #fff; color: #b42318; border-color: #fff; }

/* ---- Security page ---- */
.device-list { display: grid; gap: 10px; margin-top: 10px; }
.device-row { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.device-row.is-current { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.device-ico { flex: 0 0 40px; }
.device-ico .i3d { width: 36px; height: 36px; }
.device-info { flex: 1; min-width: 0; }
.device-info strong { word-break: break-word; }
.tfa-setup { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.tfa-qr { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: 12px; border: 1px solid var(--border); }
.tfa-qr svg { width: 100%; height: 100%; display: block; }
.tfa-key { display: inline-block; font-size: 15px; letter-spacing: 1px; padding: 8px 12px; background: var(--surface-soft); border-radius: 8px; word-break: break-all; }
.recovery-codes { margin: 10px 0 0; padding: 10px; background: var(--surface); border-radius: 8px; font-size: 15px; line-height: 1.7; user-select: all; }
@media (max-width: 520px) { .device-row { flex-wrap: wrap; } .device-row form { width: 100%; } .device-row form .btn { width: 100%; } }

/* ---- Chat attachments ---- */
.chat-media { display: block; max-width: min(260px, 100%); max-height: 320px; border-radius: 12px; margin-bottom: 6px; background: #000; }
.chat-media + * { margin-top: 2px; }
.chat-uploading { font-size: 13px; opacity: .85; padding: 4px 0; }
.chat-attach { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; cursor: pointer; color: var(--text-secondary); border: 1px solid var(--border); background: var(--surface); }
.chat-attach:hover { color: var(--primary); border-color: var(--primary); }

/* Scroll lock (see FSScroll in app.js): one rule for every pop-up, however many are open. */
html.fs-scroll-locked, html.fs-scroll-locked body { overflow: hidden; }

/* ============================================================
   v20 - campaign seals, boosts, admin tools, messenger redesign
   ============================================================ */
@property --bangle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes boostSpin { to { --bangle: 360deg; } }
@keyframes boostGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 0, .0), 0 4px 16px rgba(255, 90, 0, .18); } 50% { box-shadow: 0 0 0 3px rgba(255, 90, 0, .10), 0 6px 22px rgba(124, 58, 237, .25); } }
.is-boosted {
  position: relative;
  border: 2px solid transparent !important;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              conic-gradient(from var(--bangle), #ff5a00, #ffb347, #ff2d95, #7c3aed, #00d2c4, #ff5a00) border-box !important;
  animation: boostSpin 3.2s linear infinite, boostGlow 2.4s ease-in-out infinite;
}
.boost-tag { position: absolute; top: 8px; right: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 4px; background: linear-gradient(90deg, #ff5a00, #ff2d95); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; letter-spacing: .2px; }
.boost-tag .i3d { width: 13px; height: 13px; }
.mini-card.is-boosted, .profile-header.is-boosted { border-radius: var(--radius-lg, 14px); }
.profile-header.is-boosted { padding: 16px; }
@media (prefers-reduced-motion: reduce) { .is-boosted { animation: none; } }

.completed-seal { position: absolute; top: 14px; right: -34px; z-index: 4; transform: rotate(40deg); background: #16a34a; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; padding: 4px 40px; box-shadow: 0 2px 8px rgba(0,0,0,.25); pointer-events: none; }
.completed-seal.inline { position: static; display: inline-block; transform: none; border-radius: 999px; padding: 3px 12px; font-size: 12px; vertical-align: middle; box-shadow: none; }
.campaign-card { position: relative; overflow: hidden; }
.campaign-card.is-completed .campaign-card-banner { filter: grayscale(.35); }
.campaign-title-link { color: inherit; text-decoration: none; }
.campaign-title-link:hover { color: var(--primary); text-decoration: underline; }
.entity-row .campaign-title-link { display: inline; }
.entity-row[data-row-href] { cursor: pointer; }

.role-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0; }
.role-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; margin: 0; }
.role-check input { width: auto; margin: 0; }
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check-line input { width: auto; margin: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 10px; }
.feature-box { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-soft); }

.campaign-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.reason-box { position: relative; }
.reason-box > summary { list-style: none; cursor: pointer; }
.reason-box > summary::-webkit-details-marker { display: none; }
.reason-form { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(320px, 82vw); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.15)); display: flex; flex-direction: column; gap: 6px; }
.reason-form textarea { margin: 0; }
.report-evidence { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface-soft); }
.report-evidence summary { cursor: pointer; font-weight: 700; }
.evidence-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 320px; overflow: auto; }
.evidence-msg { padding: 6px 10px; border-radius: 8px; font-size: 13px; word-break: break-word; }
.evidence-msg.is-reported { background: #fff1f0; border-left: 3px solid #e5233d; }
.evidence-msg.is-reporter { background: var(--surface); border-left: 3px solid var(--border); }

/* ---------------- Messenger ---------------- */
.msgr { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; height: calc(100dvh - 130px); min-height: 520px; }
.msgr-list, .msgr-chat { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.msgr-list-head { padding: 18px 18px 0; }
.msgr-list-head h1 { font-size: 24px; margin: 0 0 12px; }
.msgr-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border); }
.msgr-tab { background: none; border: 0; padding: 8px 2px 12px; font-size: 15px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; }
.msgr-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.msgr-count { background: var(--accent-soft, #fff1e8); color: var(--primary); font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.msgr-tab.is-active .msgr-count { background: var(--primary); color: #fff; }
.msgr-rows { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.msgr-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; color: var(--text); text-decoration: none; border-left: 3px solid transparent; }
.msgr-row[hidden] { display: none; }
.msgr-row:hover { background: var(--sidebar-hover, #f7f7f9); }
.msgr-row.is-active { background: var(--accent-soft, #fff1e8); border-left-color: var(--primary); }
.msgr-avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; object-fit: cover; }
.msgr-avatar.sm { width: 38px; height: 38px; font-size: 13px; }
.msgr-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.msgr-row-top, .msgr-row-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.msgr-row-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgr-row-time { margin-left: auto; flex: none; font-size: 12px; color: var(--text-muted); }
.msgr-row-preview { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.msgr-row-preview > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.msgr-row.is-unread .msgr-row-preview { color: var(--text); font-weight: 600; }
.msgr-badge { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.msgr-badge[hidden] { display: none; }
.msgr-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.msgr-placeholder { margin: auto; text-align: center; padding: 30px; color: var(--text-muted); }
.msgr-placeholder h2 { margin: 8px 0 4px; color: var(--text); }

.msgr-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface); position: relative; }
.msgr-chat-who { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none; }
.chat-header-name { font-weight: 800; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgr .chat-back { display: none; width: 36px; height: 36px; border-radius: 10px; align-items: center; justify-content: center; font-size: 20px; }
.msgr .chat-live { margin-left: auto; }
.msgr-menu { position: relative; flex: none; }
.msgr-menu-btn { width: 44px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 12px; letter-spacing: 1px; color: var(--text); }
.msgr-menu-btn:hover { background: var(--sidebar-hover, #f7f7f9); }
.msgr-menu-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.16); padding: 6px; }
.msgr-menu-pop[hidden] { display: none; }
.msgr-menu-pop form { margin: 0; }
.msgr-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; background: none; border-radius: 10px; font-size: 15px; color: var(--text); text-decoration: none; cursor: pointer; text-align: left; font-family: inherit; }
.msgr-menu-item:hover { background: var(--sidebar-hover, #f7f7f9); }
.msgr-menu-item.is-danger { color: #d92d20; }
.msgr-menu-item .mi { width: 20px; text-align: center; opacity: .8; }

.msgr .chat-thread { flex: 1; min-height: 0; max-height: none; overflow-y: auto; padding: 18px; gap: 10px; background: var(--surface); overscroll-behavior: contain; }
.chat-date { align-self: center; margin: 6px 0; }
.chat-date span { display: inline-block; background: var(--surface-soft, #f4f4f6); color: var(--text-muted); font-size: 13px; font-weight: 600; padding: 6px 16px; border-radius: 999px; }
.msgr .msg-row { flex-direction: row; align-items: flex-end; gap: 8px; max-width: 78%; }
.msgr .msg-row-out { align-self: flex-end; }
.msgr .msg-row-in { align-self: flex-start; }
.msg-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; object-fit: cover; margin-bottom: 22px; }
.msg-col { display: flex; flex-direction: column; min-width: 0; }
.msgr .msg-row-out .msg-col { align-items: flex-end; }
.msgr .chat-bubble { padding: 11px 16px; border-radius: 20px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.msgr .chat-bubble-out { background: var(--primary); color: #fff; border-bottom-right-radius: 8px; }
.msgr .chat-bubble-in { background: var(--surface-soft, #f1f1f4); color: var(--text); border-bottom-left-radius: 8px; }
.msgr .chat-meta { margin-top: 4px; font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

.msgr .chat-composer { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.msgr .chat-attach { width: 46px; height: 46px; flex: none; border-radius: 14px; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); background: var(--surface); }
.chat-inputwrap { position: relative; flex: 1; min-width: 0; }
.chat-inputwrap textarea { width: 100%; margin: 0; min-height: 46px; max-height: 120px; resize: none; border-radius: 14px; padding: 12px 46px 12px 16px; box-sizing: border-box; line-height: 1.35; }
.chat-emoji-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 22px; cursor: pointer; line-height: 1; padding: 4px; }
.chat-emoji-pop { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 30; width: 268px; max-width: 86vw; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.16); }
.chat-emoji-pop[hidden] { display: none; }
.chat-emoji-pop button { border: 0; background: none; font-size: 21px; cursor: pointer; border-radius: 8px; padding: 4px 0; }
.chat-emoji-pop button:hover { background: var(--sidebar-hover, #f4f4f6); }
.msgr .chat-send { flex: none; height: 46px; min-width: 46px; padding: 0 22px; border: 0; border-radius: 14px; background: var(--primary); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.msgr .chat-send:disabled { opacity: .5; cursor: not-allowed; }
.chat-send-ico { display: none; }
.msgr-blocked { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-soft, #f6f6f8); color: var(--text-muted); font-size: 14px; }
.msgr-blocked .inline-form { margin: 0; }

.msgr-modal { position: fixed; inset: 0; z-index: 200; background: rgba(15, 17, 26, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.msgr-modal[hidden] { display: none; }
.msgr-modal-card { width: min(440px, 100%); max-height: 90dvh; overflow: auto; background: var(--surface); border-radius: 18px; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.msgr-modal-card h2 { margin: 0 0 6px; font-size: 20px; }
.msgr-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

@media (max-width: 900px) {
  .msgr { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 172px); min-height: 420px; gap: 0; }
  .msgr.has-chat .msgr-list { display: none; }
  .msgr:not(.has-chat) .msgr-chat { display: none; }
  .msgr-list, .msgr-chat { border-radius: 16px; }
  .msgr .chat-back { display: inline-flex; }
  .msgr .msg-row { max-width: 88%; }
  .chat-header-name { font-size: 16px; }
  .msgr .chat-send { padding: 0; width: 46px; }
  .msgr .chat-send-text { display: none; }
  .msgr .chat-send-ico { display: block; }
  .msgr .chat-thread { padding: 14px 12px; }
  .msgr .chat-composer { padding: 10px 12px; gap: 8px; }
}
@media (max-width: 380px) {
  .msg-avatar { width: 30px; height: 30px; font-size: 11px; margin-bottom: 20px; }
  .msgr .chat-bubble { padding: 9px 13px; font-size: 14px; }
}

/* leaderboard: positions are always bold (#1, #2, ...), with the medal next to the top three */
.rank-position { width: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.rank-position .rank-no { font-weight: 900; font-size: 17px; letter-spacing: -.3px; color: var(--text); }
.rank-row.top-3 .rank-position .rank-no { color: var(--primary); font-size: 19px; }
.rank-position .rank-medal .i3d { width: 20px; height: 20px; }

/* admin: copy boxes + highlighted ids */
.txid-chip { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 800; font-size: 14px; background: #fff7e6; color: #8a4b00; border: 1px solid #ffd58a; border-radius: 8px; padding: 4px 10px; word-break: break-all; user-select: all; }
.reveal-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reveal-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }

/* Avatar fallback (initials shown when a photo fails to load) */
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; text-align: center; overflow: hidden; }
img.avatar-circle, .msgr-avatar, .msg-avatar { object-fit: cover; }

/* ---- Uploaded site logo (Admin -> Settings -> Branding). Width comes from the <img width> attribute, height follows the ratio. ---- */
.brand-logo { display: block; max-width: min(230px, 55vw); height: auto; object-fit: contain; }
.brand-logo-dark { display: none; }
[data-theme="dark"] .brand-logo-light + .brand-logo-dark { display: block; }
[data-theme="dark"] .brand-logo-light:has(+ .brand-logo-dark) { display: none; }
.brand-mark .brand-logo { margin: 0; }
.auth-hero .brand-logo { background: none; padding: 0; border-radius: 0; box-shadow: none; } /* the uploaded logo is shown exactly as uploaded: no box, no colour behind it */
[data-theme="dark"] .auth-hero .brand-logo-light:has(+ .brand-logo-dark) { display: block; }
[data-theme="dark"] .auth-hero .brand-logo-light + .brand-logo-dark { display: none; }

/* Boosted creators / brands in the home page "Verified" sections */
.mini-card { position: relative; }
.mini-card.is-boosted { border-color: var(--primary); box-shadow: 0 6px 22px color-mix(in srgb, var(--primary) 18%, transparent); }
.mini-card-featured { position: absolute; top: 10px; right: 10px; z-index: 2; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
.mini-card-featured .i3d { width: 12px; height: 12px; }

/* ---- Header icon (favicon-sized) before the website name ---- */
.brand-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.brand-icon img { width: 28px; height: 28px; object-fit: contain; border-radius: 0; background: none; display: block; }
.auth-brand-mark.has-icon { background: none; padding: 0; box-shadow: none; border-radius: 0; }
.auth-brand-mark.has-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Placeholder shown by the image guard (assets/js/app.js) instead of a broken-image icon */
img.img-missing{object-fit:contain;background:rgba(138,143,152,.12);}

/* Boost length options */
.boost-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 6px 0 12px; }
.boost-option { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; position: relative; }
.boost-option input { position: absolute; opacity: 0; pointer-events: none; }
.boost-option:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.boost-option-len { font-weight: 700; font-size: 14px; }
.boost-option-price { color: var(--text-muted); font-size: 13px; }

/* Admin SEO: page list + Google preview */
.seo-list { display: flex; flex-direction: column; gap: 8px; }
.seo-row { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.seo-row > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.seo-row > summary::-webkit-details-marker { display: none; }
.seo-row[open] > summary { border-bottom: 1px solid var(--border); }
.seo-row-main { display: flex; flex-direction: column; min-width: 180px; flex: 1; }
.seo-url { font-size: 12px; color: var(--text-muted); word-break: break-all; }
.seo-row-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.seo-edit { padding: 14px; }
.seo-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 860px) { .seo-edit-grid { grid-template-columns: 1fr; } }
.serp { background: #fff; color: #202124; border: 1px solid #dfe1e5; border-radius: 12px; padding: 14px 16px; font-family: Arial, Helvetica, sans-serif; max-width: 600px; }
.serp-site { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.3; color: #202124; margin-bottom: 4px; }
.serp-fav { width: 28px; height: 28px; border-radius: 50%; background: #f1f3f4; color: #5f6368; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.serp-url { font-size: 12px; color: #4d5156; word-break: break-all; }
.serp-title { font-size: 20px; line-height: 1.3; color: #1a0dab; margin: 2px 0 4px; }
.serp-desc { font-size: 14px; line-height: 1.58; color: #4d5156; }
.serp-sitelinks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; margin-top: 16px; padding-left: 38px; }
.serp-sl-title { font-size: 16px; color: #1a0dab; }
.serp-sl-desc { font-size: 13px; line-height: 1.5; color: #4d5156; }
.serp-switch { margin: 6px 0 12px; display: flex; gap: 8px; }
.serp-home.serp-mobile { max-width: 360px; }
.serp-home.serp-mobile .serp-sitelinks { grid-template-columns: 1fr; padding-left: 0; }
.serp-home.serp-mobile .serp-sl-desc { display: none; }

/* ===== v26: Boosts & messaging page (responsive) ===== */
.boost-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-top: 12px; }
.boost-box { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-soft); min-width: 0; }
.boost-head { margin-bottom: 10px; }
.boost-opts { display: flex; flex-direction: column; gap: 10px; }
.boost-opt { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto auto; gap: 10px; align-items: end; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.boost-field { min-width: 0; }
.boost-field label { display: block; font-size: 12px; margin: 0 0 4px; color: var(--text-muted); font-weight: 600; }
.boost-field input, .boost-field select, .boost-inline input, .boost-inline select { width: 100%; min-width: 0; margin: 0; }
.boost-inline { display: flex; gap: 8px; min-width: 0; }
.boost-inline input { flex: 1 1 70px; }
.boost-inline select { flex: 1 1 90px; }
.boost-free { max-width: 320px; }
.boost-tick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin: 0; padding-bottom: 10px; white-space: nowrap; }
.boost-tick input { width: auto; margin: 0; }
.boost-del { color: var(--danger); }
.boost-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; align-items: end; }
.boost-add > div, .boost-add input, .boost-add select { min-width: 0; width: 100%; margin-bottom: 0; }
@media (max-width: 560px) {
  .boost-opt { grid-template-columns: 1fr 1fr; }
  .boost-len { grid-column: 1 / -1; }
  .boost-tick { padding-bottom: 0; }
  .btn-block-mobile { width: 100%; }
}

/* ===== v26: Media optimization page ===== */
.mo-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.mo-check { border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px; padding: 10px 12px; font-size: 13px; background: var(--surface-soft); min-width: 0; overflow-wrap: anywhere; }
.mo-check strong { display: block; margin-bottom: 2px; }
.mo-check.ok { border-left-color: var(--success); } .mo-check.warn { border-left-color: var(--accent); } .mo-check.bad { border-left-color: var(--danger); }
.mo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 4px 18px; }
.mo-grid > div { min-width: 0; }
.mo-folders { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.mo-folder { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.mo-folder input { width: auto; margin: 3px 0 0; }

/* ===== v26: Admin dashboard ===== */
.dash-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dash-card { margin-top: 18px; min-width: 0; }
.dash-card h2 { font-size: 17px; margin: 0 0 12px; }
.dash-attn { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.dash-tile { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); color: var(--text); text-decoration: none; min-width: 0; transition: transform .15s, border-color .15s; }
.dash-tile:hover { border-color: var(--primary); transform: translateY(-1px); }
.dash-tile.has { border-color: var(--accent); background: var(--accent-soft); }
.dash-tile-icon { flex: none; display: flex; width: 38px; height: 38px; align-items: center; justify-content: center; }
.dash-tile-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-tile-n { font-size: 22px; font-weight: 800; line-height: 1.1; }
.dash-tile:not(.has) .dash-tile-n { color: var(--text-muted); }
.dash-tile-l { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-tile-go { color: var(--text-muted); }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 12px; margin-top: 18px; }
.dash-kpi { display: block; text-decoration: none; color: inherit; min-width: 0; }
.dash-kpi:hover { border-color: var(--primary); }
.dash-kpi-note { margin-top: 2px; }
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px; }
.dash-chart { display: flex; align-items: flex-end; gap: 5px; height: 130px; padding: 4px 0 18px; }
.dash-bar { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.dash-bar span { display: block; width: 100%; min-height: 3px; background: var(--primary); border-radius: 4px 4px 0 0; opacity: .85; }
.dash-bar i { position: absolute; left: 0; right: 0; bottom: -17px; text-align: center; font-size: 10px; font-style: normal; color: var(--text-muted); }
.dash-list { display: flex; flex-direction: column; }
.dash-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 14px; min-width: 0; }
.dash-row:last-child { border-bottom: 0; }
.dash-row:hover { color: var(--primary); }
.dash-row > :first-child { min-width: 0; }
.dash-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.dash-health { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.dash-hcard { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 13px; background: var(--surface-soft); min-width: 0; }
.dash-hcard.ok { border-left-color: var(--success); } .dash-hcard.warn { border-left-color: var(--accent); } .dash-hcard.bad { border-left-color: var(--danger); }
.dash-hcard span { color: var(--text-secondary); }
.dash-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 8px; }
.dash-quick-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; min-width: 0; }
.dash-quick-item:hover { border-color: var(--primary); color: var(--primary); }

/* ===== v26: Smooth video player ===== */
.fsp { position: relative; display: block; background: #000; overflow: hidden; }
.fsp > video { display: block; width: 100%; height: 100%; background: #000; }
.fsp-spin { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: fspSpin .8s linear infinite; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 3; }
.fsp.is-loading .fsp-spin { opacity: 1; }
.fsp-msg { position: absolute; inset: auto 8px 8px 8px; z-index: 4; padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.72); color: #fff; font-size: 13px; text-align: center; display: none; }
.fsp.has-msg .fsp-msg { display: block; }
.fsp-msg button { margin-left: 8px; padding: 3px 10px; border-radius: 8px; border: 0; background: #fff; color: #000; font-weight: 700; cursor: pointer; }
@keyframes fspSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fsp-spin { animation-duration: 2s; } }
