/* ============================================================
   Zypp Creators League — Dashboard Design System
   16:9 fixed-canvas · dark futuristic · glass morphism
   ============================================================ */

/* ── Custom font import ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ── Root design tokens ─────────────────────────────────────── */
:root {
  --brand: #3fb75f;
  --brand-dim: rgba(63, 183, 95, .15);
  --brand-glow: rgba(63, 183, 95, .35);

  --dark: #080b14;
  --dark2: #0c1020;
  --card-bg: #111827;
  --card-bg2: #161d2e;
  --card-bg3: #1a2236;

  --border: rgba(255, 255, 255, .08);
  --border-bright: rgba(255, 255, 255, .14);

  --text: #e8eaf2;
  --text-dim: #a8b2cc;
  --muted: #6b7a9b;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, .4), 0 1px 4px rgba(0, 0, 0, .25);
  --shadow-glow: 0 0 40px var(--brand-glow);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);

  --trans-fast: 0.15s cubic-bezier(.4, 0, .2, 1);
  --trans-med: 0.28s cubic-bezier(.4, 0, .2, 1);
  --trans-spring: 0.4s cubic-bezier(.34, 1.56, .64, 1);

  /* Nav height — used for mainContent offset */
  --nav-h: 78px;

  /* Layout spacing — fluid: tightest on small screens, comfortable on large */
  --gap: clamp(10px, 1.2vw, 16px);
  --pad: clamp(12px, 1.4vh, 20px) clamp(14px, 1.6vw, 24px);
}

/* ── Keyframe animations ─────────────────────────────────────── */

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .45;
    transform: scale(1.6);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes glowPulse {

  0%,
  100% {
    box-shadow: 0 0 12px rgba(63, 183, 95, .2), inset 0 0 12px rgba(63, 183, 95, .04);
  }

  50% {
    box-shadow: 0 0 32px rgba(63, 183, 95, .5), inset 0 0 20px rgba(63, 183, 95, .08);
  }
}

@keyframes numberPop {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.12);
    color: var(--brand);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes borderGlow {

  0%,
  100% {
    border-color: rgba(63, 183, 95, .2);
  }

  50% {
    border-color: rgba(63, 183, 95, .55);
  }
}

@keyframes reelCountdown {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

@keyframes trendingPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .35;
  }
}

@keyframes rotateGradient {
  from {
    filter: hue-rotate(0deg);
  }

  to {
    filter: hue-rotate(30deg);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Base ────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.dashboard-body {
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  min-width: 320px;
  /* hard floor — nothing below 320px */
  overflow-x: hidden;
  /* kill horizontal scroll at ALL sizes */
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 80% 55% at 8% 0%, rgba(63, 183, 95, .09) 0%, transparent 100%),
    radial-gradient(ellipse 60% 45% at 95% 100%, rgba(52, 152, 219, .06) 0%, transparent 100%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(168, 85, 247, .03) 0%, transparent 100%);
}

.dashboard-body .text-muted,
.dashboard-body small.text-muted {
  color: var(--muted) !important;
}

/* ══════════════════════════════════════════════════════════════
   ROW 1 — NAVBAR (3-zone grid: logo | KPI strip | controls)
   ══════════════════════════════════════════════════════════════ */

.dash-nav {
  background: rgba(8, 11, 20, .96);
  border-bottom: 1px solid var(--border-bright);
  display: grid;
  grid-template-columns: clamp(170px, 17vw, 270px) 1fr auto;
  /* fluid left zone */
  align-items: center;
  gap: clamp(12px, 1.4vw, 22px);
  padding: 0 clamp(14px, 1.8vw, 28px);
  min-height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(63, 183, 95, .06);
}

/* Left zone */
.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

/* ── ZCL Logo — spinning ring + breathing glow ───────────────── */
.zcl-logo-wrap {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  border-radius: 10px;
  animation: logo-ambient 3s ease-in-out infinite;
}

/* Spinning conic-gradient ring */
.zcl-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 13px;
  background: conic-gradient(
    from 0deg,
    transparent  0%,
    #3fb75f     22%,
    #a8ff78     36%,
    #f59e0b     50%,
    #3fb75f     64%,
    transparent 75%,
    transparent 100%
  );
  animation: logo-ring-spin 3s linear infinite;
  z-index: 0;
}

/* Fill mask — hides gradient inside the ring, shows only the border */
.zcl-logo-wrap::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: #080b14;
  border-radius: 9px;
  z-index: 1;
}

.zcl-logo-wrap img {
  position: relative;
  z-index: 2;
  animation: logo-glow 3s ease-in-out infinite;
}

@keyframes logo-ring-spin {
  to { transform: rotate(360deg); }
}

@keyframes logo-glow {
  0%,100% { filter: drop-shadow(0 0 6px  rgba(63,183,95,.55)); }
  50%     { filter: drop-shadow(0 0 18px rgba(63,183,95,.95)) brightness(1.12); }
}

@keyframes logo-ambient {
  0%,100% { box-shadow: 0 0 18px rgba(63,183,95,.2),  0 0 40px rgba(63,183,95,.06); }
  50%     { box-shadow: 0 0 34px rgba(63,183,95,.44), 0 0 70px rgba(63,183,95,.16); }
}

/* Centre zone — KPI strip */
.nav-kpi-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  min-width: 0;
}

/* Override stat-card inside the nav strip */
.nav-kpi-strip .stat-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px 14px;
  border-radius: 12px;
  height: 72px;
  overflow: hidden;
  /* NO animation: none — let per-card ::after handle it */
  position: relative;
}

/* ── Per-card ::after border glow (opacity only = GPU, zero repaint) ── */
.nav-kpi-strip .stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  will-change: opacity;
  animation: kpi-glow 2.5s ease-in-out infinite;
}

@keyframes kpi-glow {
  0%,100% { opacity: .3; }
  50%     { opacity: 1;  }
}

.nav-kpi-strip .stat-card-posts::after   { border: 1.5px solid rgba(63,183,95,1);   box-shadow: 0 0 14px rgba(63,183,95,.55),  0 0 30px rgba(63,183,95,.2);  }
.nav-kpi-strip .stat-card-engage::after  { border: 1.5px solid rgba(231,76,60,1);   box-shadow: 0 0 14px rgba(231,76,60,.55),  0 0 30px rgba(231,76,60,.2);  }
.nav-kpi-strip .stat-card-views::after   { border: 1.5px solid rgba(52,152,219,1);  box-shadow: 0 0 14px rgba(52,152,219,.55), 0 0 30px rgba(52,152,219,.2); }
.nav-kpi-strip .stat-card-decibel::after { border: 1.5px solid rgba(168,85,247,1);  box-shadow: 0 0 14px rgba(168,85,247,.55), 0 0 30px rgba(168,85,247,.2); }

/* ── Inner top-light overlay (::before) ─────────────────────── */
.nav-kpi-strip .stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 55%;
  border-radius: 12px 12px 0 0;
  pointer-events: none;
  opacity: .6;
}

.nav-kpi-strip .stat-card-posts::before   { background: radial-gradient(ellipse at 50% 0%, rgba(63,183,95,.3)  0%, transparent 75%); }
.nav-kpi-strip .stat-card-engage::before  { background: radial-gradient(ellipse at 50% 0%, rgba(231,76,60,.3)  0%, transparent 75%); }
.nav-kpi-strip .stat-card-views::before   { background: radial-gradient(ellipse at 50% 0%, rgba(52,152,219,.3) 0%, transparent 75%); }
.nav-kpi-strip .stat-card-decibel::before { background: radial-gradient(ellipse at 50% 0%, rgba(168,85,247,.3) 0%, transparent 75%); }

/* ── Per-card background tint ───────────────────────────────── */
.nav-kpi-strip .stat-card-posts   { background: linear-gradient(160deg, rgba(63,183,95,.09)  0%, transparent 60%); border-top: 2px solid rgba(63,183,95,.8); }
.nav-kpi-strip .stat-card-engage  { background: linear-gradient(160deg, rgba(231,76,60,.09)  0%, transparent 60%); border-top: 2px solid rgba(231,76,60,.8); }
.nav-kpi-strip .stat-card-views   { background: linear-gradient(160deg, rgba(52,152,219,.09) 0%, transparent 60%); border-top: 2px solid rgba(52,152,219,.8); }
.nav-kpi-strip .stat-card-decibel { background: linear-gradient(160deg, rgba(168,85,247,.09) 0%, transparent 60%); border-top: 2px solid rgba(168,85,247,.8); }

/* ── Icon — show & color ─────────────────────────────────────── */
.nav-kpi-strip .stat-icon {
  display: block;
  font-size: .85rem;
  margin-bottom: 1px;
  line-height: 1;
}

.nav-kpi-strip .stat-card-posts   .stat-icon { color: rgba(63,183,95,.9);   filter: drop-shadow(0 0 4px rgba(63,183,95,.6));  }
.nav-kpi-strip .stat-card-engage  .stat-icon { color: rgba(231,76,60,.9);   filter: drop-shadow(0 0 4px rgba(231,76,60,.6));  }
.nav-kpi-strip .stat-card-views   .stat-icon { color: rgba(52,152,219,.9);  filter: drop-shadow(0 0 4px rgba(52,152,219,.6)); }
.nav-kpi-strip .stat-card-decibel .stat-icon { color: rgba(168,85,247,.9);  filter: drop-shadow(0 0 4px rgba(168,85,247,.6)); }

/* ── Value text glow ─────────────────────────────────────────── */
.nav-kpi-strip .stat-card-posts   .stat-val { filter: drop-shadow(0 0 7px rgba(63,183,95,.55)); }
.nav-kpi-strip .stat-card-engage  .stat-val { filter: drop-shadow(0 0 7px rgba(231,76,60,.55)); }
.nav-kpi-strip .stat-card-views   .stat-val { filter: drop-shadow(0 0 7px rgba(52,152,219,.55)); }
.nav-kpi-strip .stat-card-decibel .stat-val { filter: drop-shadow(0 0 7px rgba(168,85,247,.55)); }

/* ── Label text — accent tint ───────────────────────────────── */
.nav-kpi-strip .stat-card-posts   .stat-label { color: rgba(63,183,95,.8);  letter-spacing: .07em; }
.nav-kpi-strip .stat-card-engage  .stat-label { color: rgba(231,76,60,.8);  letter-spacing: .07em; }
.nav-kpi-strip .stat-card-views   .stat-label { color: rgba(52,152,219,.8); letter-spacing: .07em; }
.nav-kpi-strip .stat-card-decibel .stat-label { color: rgba(168,85,247,.8); letter-spacing: .07em; }

.nav-kpi-strip .stat-val {
  font-size: clamp(1.5rem, 1.75vw, 2rem);
  margin-bottom: 3px;
  line-height: 1;
}

.nav-kpi-strip .stat-label {
  font-size: clamp(.62rem, .65vw, .75rem);
  letter-spacing: .06em;
  white-space: nowrap;
}

.kpi-progress-wrap {
  display: none;
  /* hidden in nav — fits within card height */
}

/* Right zone */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Brand + live badge */
.nav-brand {
  font-weight: 800;
  font-size: 1rem;
  color: var(--brand);
  letter-spacing: -.02em;
  text-shadow: 0 0 24px var(--brand-glow);
  line-height: 1.1;
}

.live-badge {
  background: rgba(46, 204, 113, .07);
  border: 1px solid rgba(46, 204, 113, .55);
  color: #2ecc71;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(46,204,113,.9), 0 0 22px rgba(46,204,113,.5);
  animation: live-glow-pulse 2.2s ease-in-out infinite;
}

/* Scanning sweep beam */
.live-badge::before {
  content: '';
  position: absolute;
  top: 0; left: -70%; width: 55%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(46,204,113,.35), transparent);
  animation: live-scan 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes live-scan {
  0%   { left: -70%; }
  100% { left: 130%; }
}

@keyframes live-glow-pulse {
  0%,100% {
    box-shadow: 0 0 10px rgba(46,204,113,.28), 0 0 22px rgba(46,204,113,.08), inset 0 0 8px rgba(46,204,113,.04);
    border-color: rgba(46,204,113,.55);
  }
  50% {
    box-shadow: 0 0 20px rgba(46,204,113,.55), 0 0 42px rgba(46,204,113,.18), inset 0 0 14px rgba(46,204,113,.1);
    border-color: rgba(46,204,113,.9);
  }
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #2ecc71;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 8px rgba(46,204,113,1), 0 0 16px rgba(46,204,113,.6);
  animation: live-dot-pulse 1.2s ease-in-out infinite;
}

/* Expanding ripple ring on the dot */
.live-dot::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px solid rgba(46,204,113,.65);
  animation: live-ripple 1.2s ease-out infinite;
}

@keyframes live-dot-pulse {
  0%,100% { transform: scale(1);   opacity: 1; }
  50%     { transform: scale(1.25); opacity: .8; }
}

@keyframes live-ripple {
  0%   { transform: scale(1);    opacity: .8; }
  100% { transform: scale(2.8);  opacity: 0;  }
}

/* ── Cards ───────────────────────────────────────────────────── */
.dash-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--trans-med), box-shadow var(--trans-med), transform var(--trans-med);
  position: relative;
  overflow: hidden;
}

/* Subtle top shimmer stripe */
.dash-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, .12) 40%,
      rgba(255, 255, 255, .18) 60%,
      transparent 100%);
  pointer-events: none;
}

/* ── Animated border glow ────────────────────────────────────── */
.dash-card {
  animation: card-border-glow 3s ease-in-out infinite;
}

@keyframes card-border-glow {
  0%, 100% {
    border-color: rgba(63,183,95,.25);
    box-shadow: 0 0 0 1px rgba(63,183,95,.1), var(--shadow-card);
  }
  50% {
    border-color: rgba(63,183,95,.65);
    box-shadow: 0 0 10px rgba(63,183,95,.35), 0 0 20px rgba(63,183,95,.12), var(--shadow-card);
  }
}

.dash-card:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(63,183,95,.15);
  transform: translateY(-1px);
}

.dash-card:hover::after {
  opacity: 1;
}

.chart-row-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-header-row {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  text-align: center;
  transition: transform var(--trans-med), box-shadow var(--trans-med), border-color var(--trans-med);
  position: relative;
  overflow: hidden;
  animation: fadeInUp .5s cubic-bezier(.34, 1.56, .64, 1) both;
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 0%, rgba(63, 183, 95, .08), transparent 65%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--trans-med);
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .45);
}

.stat-icon {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.stat-val {
  font-size: clamp(1.4rem, 1.75vw, 2rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 3px;
  letter-spacing: -.03em;
  font-family: 'JetBrains Mono', monospace;
  background: linear-gradient(to right, #ffffff 30%, #a0a8cc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.stat-val.db-score {
  background: none;
  -webkit-text-fill-color: var(--brand);
}

.stat-label {
  color: var(--muted);
  font-size: clamp(.65rem, .68vw, .8rem);
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Colored top borders */
.stat-card-posts {
  border-top: 2px solid #3fb75f;
}

.stat-card-engage {
  border-top: 2px solid #e74c3c;
}

.stat-card-views {
  border-top: 2px solid #3498db;
}

.stat-card-decibel {
  border-top: 2px solid #a855f7;
}

/* Hover glows */
.stat-card-posts:hover {
  box-shadow: 0 6px 28px rgba(63, 183, 95, .25), 0 0 0 1px rgba(63, 183, 95, .2) !important;
  border-color: rgba(63, 183, 95, .35) !important;
}

.stat-card-engage:hover {
  box-shadow: 0 6px 28px rgba(231, 76, 60, .25), 0 0 0 1px rgba(231, 76, 60, .2) !important;
  border-color: rgba(231, 76, 60, .35) !important;
}

.stat-card-views:hover {
  box-shadow: 0 6px 28px rgba(52, 152, 219, .25), 0 0 0 1px rgba(52, 152, 219, .2) !important;
  border-color: rgba(52, 152, 219, .35) !important;
}

.stat-card-decibel:hover {
  box-shadow: 0 6px 28px rgba(168, 85, 247, .25), 0 0 0 1px rgba(168, 85, 247, .2) !important;
  border-color: rgba(168, 85, 247, .35) !important;
}

/* Gradient numbers */
.stat-card-posts .stat-val {
  background: linear-gradient(135deg, #fff 30%, #3fb75f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card-engage .stat-val {
  background: linear-gradient(135deg, #fff 30%, #e74c3c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card-views .stat-val {
  background: linear-gradient(135deg, #fff 30%, #3498db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card-decibel .stat-val.db-score {
  background: linear-gradient(135deg, var(--brand) 25%, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: unset;
}

/* Icon glows */
.stat-card-posts .stat-icon {
  color: #3fb75f;
  filter: drop-shadow(0 0 8px rgba(63, 183, 95, .7));
}

.stat-card-engage .stat-icon {
  color: #e74c3c;
  filter: drop-shadow(0 0 8px rgba(231, 76, 60, .7));
}

.stat-card-views .stat-icon {
  color: #3498db;
  filter: drop-shadow(0 0 8px rgba(52, 152, 219, .7));
}

.stat-card-decibel .stat-icon {
  color: #a855f7;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, .7));
}

/* ── Custom Tabs ─────────────────────────────────────────────── */
.custom-tabs {
  gap: 3px;
  border-bottom: none;
}

.custom-tabs .nav-link {
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  border-radius: var(--radius-xs);
  padding: 3px 10px;
  font-size: .69rem;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: all var(--trans-fast);
  letter-spacing: .03em;
}

.custom-tabs .nav-link.active {
  background: var(--brand-dim);
  color: var(--brand);
  border-color: rgba(63, 183, 95, .35);
  box-shadow: 0 0 10px rgba(63, 183, 95, .15);
}

.custom-tabs .nav-link:hover:not(.active) {
  background: rgba(255, 255, 255, .07);
  color: var(--text-dim);
}

/* ── LinkedIn post card ──────────────────────────────────────── */
.linkedin-post {
  background: rgba(10, 102, 194, .06);
  border: 1px solid rgba(10, 102, 194, .18);
  border-radius: 10px;
  padding: 11px 12px;
  transition: border-color var(--trans-fast), background var(--trans-fast);
}

.linkedin-post:hover {
  background: rgba(10, 102, 194, .10);
  border-color: rgba(10, 102, 194, .35);
}

/* ── Instagram post card ─────────────────────────────────────── */
.instagram-post {
  background: rgba(225, 48, 108, .05);
  border: 1px solid rgba(225, 48, 108, .15);
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 10px;
  transition: border-color var(--trans-fast), background var(--trans-fast);
}

.instagram-post:hover {
  background: rgba(225, 48, 108, .09);
  border-color: rgba(225, 48, 108, .32);
}

/* ── Platform dot + legend ───────────────────────────────────── */
.platform-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.platform-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--trans-fast);
  gap: 8px;
}

.platform-legend-row:hover {
  background: rgba(255, 255, 255, .05);
}

.platform-legend-row.plat-active {
  background: var(--brand-dim);
  border-left: 2px solid var(--brand);
}

/* ── Sentiment legend ────────────────────────────────────────── */
.sent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: .78rem;
}

.sent-row .sent-label {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ── Reel platform tabs ──────────────────────────────────────── */
.reel-plat-tabs {
  display: flex;
  align-items: center;
  gap: 1px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px;
  padding: 2px;
}

.reel-tab {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .35);
  border-radius: 6px;
  width: 26px;
  height: 24px;
  font-size: .72rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--trans-fast), color var(--trans-fast);
  flex-shrink: 0;
}

.reel-tab[data-platform="all"] {
  width: auto;
  padding: 0 8px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .25px;
}

.reel-tab.active {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}

.reel-tab:hover:not(.active) {
  color: rgba(255, 255, 255, .7);
}

/* ── 9:16 Reel Carousel ──────────────────────────────────────── */
.reel-card {
  padding: 14px 16px;
}

.reel-placeholder {
  aspect-ratio: 9/16;
  border-radius: 18px;
  background: var(--card-bg2);
  border: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.reel-stage {
  display: flex;
  justify-content: center;
  width: 100%;
}

.post-reel {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  border-radius: 18px;
  overflow: hidden;
  background: #070a13;
  border: 1px solid var(--border);
  display: none;
  cursor: pointer;
  transition: border-color var(--trans-med), box-shadow var(--trans-med);
  box-shadow: 0 8px 36px rgba(0, 0, 0, .6);
}

.post-reel.active {
  display: block;
  animation: fadeIn .35s ease;
}

.post-reel:hover {
  border-color: rgba(63, 183, 95, .45);
  box-shadow: 0 0 36px rgba(63, 183, 95, .12);
}

.reel-media {
  position: absolute;
  inset: 0;
}

.reel-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.reel-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reel-text-bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-icon {
  font-size: 5rem;
  opacity: .18;
}

.reel-play-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, .7);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(8px);
  letter-spacing: .05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.reel-countdown-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, .08);
  z-index: 10;
  transform-origin: left;
}

.reel-countdown-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #86efac);
  transform-origin: left;
  animation: reelCountdown 30s linear forwards;
  border-radius: 0 2px 2px 0;
}

.reel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 13px 16px;
  background: linear-gradient(transparent 0%, rgba(0, 0, 0, .55) 38%, rgba(0, 0, 0, .97) 100%);
}

.reel-tag {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .2);
}

.reel-caption {
  font-size: .74rem;
  color: #cdd;
  line-height: 1.5;
  margin: 5px 0 7px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reel-metrics {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: .72rem;
  color: #d0dcdc;
}

.reel-metrics i {
  font-size: .78rem;
}

/* ── Carousel dots ───────────────────────────────────────────── */
.carousel-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  cursor: pointer;
  transition: all var(--trans-spring);
  box-shadow: 0 0 4px rgba(0, 0, 0, .4);
}

.carousel-dot.active {
  background: var(--brand);
  width: 18px;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(63, 183, 95, .55);
}

/* ── Post card author / platform labels ──────────────────────── */
.post-platform {
  font-size: .68rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .09em;
}

.author-avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--trans-fast);
}

.author-avatar:hover {
  opacity: .8;
}

.post-ext-link {
  color: rgba(255, 255, 255, .55);
  font-size: .8rem;
  text-decoration: none;
  transition: color var(--trans-fast);
}

.post-ext-link:hover {
  color: #fff;
}

/* ── Hashtag Performance Table ───────────────────────────────── */
.ht-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .75rem;
}

.ht-table thead tr {
  border-bottom: 1px solid var(--border);
}

.ht-table th {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: .62rem;
  letter-spacing: .07em;
  padding: 3px 8px 7px;
  text-align: left;
}

.ht-table th:nth-child(3),
.ht-table th:nth-child(4) {
  text-align: right;
}

.ht-row {
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  cursor: pointer;
  transition: background var(--trans-fast);
}

.ht-row:last-child {
  border-bottom: none;
}

.ht-row:hover {
  background: rgba(63, 183, 95, .07);
}

.ht-row.ht-active {
  background: rgba(63, 183, 95, .13);
  border-left: 2px solid var(--brand);
}

.ht-tag {
  color: var(--brand);
  font-weight: 700;
  padding: 6px 8px;
  white-space: nowrap;
  font-size: .76rem;
}

.ht-plats {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .84rem;
}

.ht-num {
  padding: 6px 8px;
  text-align: right;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

.ht-num.green {
  color: var(--brand);
}

/* ── Top Creators Table ──────────────────────────────────────── */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .75rem;
}

.lb-table thead tr {
  border-bottom: 1px solid var(--border);
}

.lb-table th {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: .62rem;
  letter-spacing: .07em;
  padding: 3px 8px 8px;
  text-align: right;
  white-space: nowrap;
}

.lb-table th:nth-child(1),
.lb-table th:nth-child(2) {
  text-align: left;
}

.lb-tr {
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  cursor: pointer;
  transition: background var(--trans-fast);
}

.lb-tr:last-child {
  border-bottom: none;
}

.lb-tr:hover {
  background: rgba(63, 183, 95, .07);
}

.lb-tr.lb-tr-active {
  background: rgba(63, 183, 95, .13);
  border-left: 3px solid rgba(63, 183, 95, .7);
}

.lb-expand-row td {
  background: rgba(63, 183, 95, .04);
  border-bottom: 1px solid var(--border);
}

/* Rank gradient backgrounds */
.lb-rank-gold {
  background: linear-gradient(90deg, rgba(255, 193, 7, .08) 0%, transparent 60%);
  border-left: 2px solid rgba(255, 193, 7, .5);
}

.lb-rank-silver {
  background: linear-gradient(90deg, rgba(176, 190, 197, .07) 0%, transparent 60%);
  border-left: 2px solid rgba(176, 190, 197, .4);
}

.lb-rank-bronze {
  background: linear-gradient(90deg, rgba(188, 143, 95, .07) 0%, transparent 60%);
  border-left: 2px solid rgba(188, 143, 95, .4);
}

.lb-rank-gold:hover {
  background: linear-gradient(90deg, rgba(255, 193, 7, .14) 0%, rgba(63, 183, 95, .04) 100%);
}

.lb-rank-silver:hover {
  background: linear-gradient(90deg, rgba(176, 190, 197, .12) 0%, rgba(63, 183, 95, .04) 100%);
}

.lb-rank-bronze:hover {
  background: linear-gradient(90deg, rgba(188, 143, 95, .12) 0%, rgba(63, 183, 95, .04) 100%);
}

.lb-rank-cell {
  padding: 6px 4px 6px 2px;
  font-size: .9rem;
  width: 30px;
  text-align: center;
  line-height: 1;
}

.lb-num {
  color: var(--text-dim);
  font-weight: 700;
  font-size: .74rem;
  font-family: 'JetBrains Mono', monospace;
}

.lb-rank-gold .lb-rank-cell {
  filter: drop-shadow(0 0 6px rgba(255, 193, 7, .65));
}

.lb-rank-silver .lb-rank-cell {
  filter: drop-shadow(0 0 6px rgba(176, 190, 197, .55));
}

.lb-rank-bronze .lb-rank-cell {
  filter: drop-shadow(0 0 6px rgba(188, 143, 95, .55));
}

.lb-creator-cell {
  padding: 6px 10px 6px 2px;
}

.lb-creator-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .68rem;
  font-weight: 700;
  color: #fff;
}

.lb-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  font-size: .8rem;
}

.lb-sub {
  font-size: .62rem;
  color: var(--text-dim);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-metric {
  padding: 6px 8px;
  text-align: right;
  color: var(--text);
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  white-space: nowrap;
}

.lb-score-cell {
  padding: 6px 8px;
  text-align: right;
  color: var(--brand);
  font-weight: 800;
  font-size: .82rem;
  white-space: nowrap;
  background: linear-gradient(90deg, transparent 40%, rgba(63, 183, 95, .07));
  border-left: 1px solid rgba(63, 183, 95, .12);
}

.lb-tr:hover .lb-score-cell {
  background: linear-gradient(90deg, transparent 20%, rgba(63, 183, 95, .16));
}

.lb-pts {
  color: var(--muted);
  font-size: .6rem;
  font-weight: 400;
  margin-left: 2px;
}

.lb-tr:nth-child(even) {
  background: rgba(255, 255, 255, .014);
}

#leaderboardMonthSelect option {
  background: #1a1a2e;
  color: var(--text);
}

/* ── Trending Now ────────────────────────────────────────────── */
.trend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 4px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--trans-fast);
  margin-bottom: 1px;
}

.trend-item:hover {
  background: rgba(255, 255, 255, .05);
}

.trend-rank {
  font-size: 1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.trend-content {
  flex: 1;
  min-width: 0;
}

.trend-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.trend-tag-name {
  font-weight: 700;
  font-size: .82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trend-bar-wrap {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, .07);
  border-radius: 2px;
  overflow: hidden;
  min-width: 24px;
}

.trend-bar {
  height: 100%;
  border-radius: 2px;
  transition: width .7s cubic-bezier(.4, 0, .2, 1);
}

.trend-score {
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}

.trend-meta {
  font-size: .65rem;
  color: var(--muted);
}

.trend-velocity {
  font-size: .63rem;
  font-weight: 600;
  color: #2ecc71;
}

.trend-velocity.down {
  color: #e74c3c;
}

#trendPulse {
  animation: trendingPulse 1.8s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT ENGINE — 16:9 THREE-ROW DASHBOARD
   Row 1: nav (74px)
   Row 2: primaryRow (flex: 1)
   Row 3: bottomRow (220px)
   ══════════════════════════════════════════════════════════════ */

/* Main canvas */
#mainContent {
  height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(10px, 1.4vh, 20px) clamp(14px, 1.8vw, 26px) clamp(12px, 1.6vh, 20px);
  gap: var(--gap);
}

/* ── ROW 2: Primary content ──────────────────────────────────── */
#primaryRow {
  display: flex;
  gap: var(--gap);
  flex: 1;
  min-height: 0;
}

/* Col 1: Latest Post (9:16 reel) */
#reelCard {
  flex: 0 0 clamp(190px, 17vw, 300px);
  /* fluid: 190px → 300px */
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#reelCard #postCarousel {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#reelCard .reel-stage {
  width: 100%;
  display: flex;
  justify-content: center;
}

#reelCard .post-reel {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 9/16;
}

#reelCard .reel-placeholder {
  width: 100%;
  aspect-ratio: 9/16;
}

/* Col 2: LinkedIn */
#linkedinCol {
  flex: 0 0 clamp(240px, 22vw, 430px);
  /* fluid: 240px → 430px */
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Col 3: Instagram */
#instagramCol {
  flex: 0 0 clamp(220px, 21vw, 410px);
  /* fluid: 220px → 410px */
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Col 4: Leaderboard (fills remaining space — always gets at least 200px) */
#leaderboardCol {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
}

/* All main-col children fill their wrapper height */
.main-col>.dash-card {
  flex: 1;
  min-height: 0;
}

/* Wider name column in leaderboard */
#leaderboardCol .lb-name {
  max-width: 200px;
}

/* Feed lists */
#linkedinList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#instagramList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ── ROW 3: Analytics strip ──────────────────────────────────── */
#bottomRow {
  display: flex;
  gap: var(--gap);
  height: clamp(168px, 18vh, 210px);
  /* compact; content fits without scroll */
  flex-shrink: 0;
}

.bottom-card {
  min-height: 0;
  overflow: hidden;
}

/* Equal-width with platform and sentiment cards */
#hashtagPerfCard {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#hashtagPerfCard #hashtagList {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  /* no scrollbar */
}

/* Proportional analytics cards */
#platformCard {
  flex: 1;
  min-width: 0;
}

#sentimentCard {
  flex: 1;
  min-width: 0;
}

/* ── Bottom card glow accents ────────────────────────────────── */
#hashtagPerfCard {
  box-shadow: 0 0 22px rgba(63,183,95,0.18), var(--shadow-card);
  border-color: rgba(63,183,95,0.35);
}

#platformCard {
  box-shadow: 0 0 22px rgba(10,102,194,0.22), var(--shadow-card);
  border-color: rgba(10,102,194,0.35);
}

#sentimentCard {
  box-shadow: 0 0 22px rgba(168,85,247,0.18), var(--shadow-card);
  border-color: rgba(168,85,247,0.32);
}

#trendingList {
  overflow: hidden;
  /* no scrollbar — content must fit the card height */
  flex: 1;
  min-height: 0;
}

.pulse-chart-wrap {
  position: relative;
  flex: 1;
  min-height: 50px;
}

#creatorSpotlight {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════════
   BOTTOM ANALYTICS STRIP — COMPACT · NO-SCROLL
   Hashtag Performance | Platform | Sentiment
   ──────────────────────────────────────────────────────────────────
   WHY #bottomRow scoped selectors:
     Specificity (1,1,0) beats every class-only media-query rule (0,1,0).
     Font sizes are in px — immune to html{font-size} scaling at
     TV / 4K breakpoints that push the base up to 16–26 px.
     Result: these five cards always stay compact & scroll-free.
   ══════════════════════════════════════════════════════════════════ */

/* ── 1. Kill ALL inner scrollbars ────────────────────────────── */
#hashtagPerfCard #hashtagList {
  overflow: hidden;
  scrollbar-width: none;
}

#hashtagPerfCard #hashtagList::-webkit-scrollbar {
  display: none;
}

/* platformLegend has inline style="overflow-y:auto" → needs !important */
#platformLegend {
  overflow: hidden !important;
}

#sentimentLegend {
  overflow: hidden;
}

#platformLegend::-webkit-scrollbar,
#sentimentLegend::-webkit-scrollbar {
  display: none;
}

/* ── 2. Card header row inside the strip ─────────────────────── */
#bottomRow .card-header-row {
  font-size: 11px;
  padding-bottom: 6px;
  letter-spacing: .05em;
}

#bottomRow #trendUpdated {
  font-size: 7px;
}

#bottomRow #trendPulse {
  font-size: 7px;
}

/* ── 3. Trending items ────────────────────────────────────────── */
#bottomRow .trend-item {
  padding: 3px 3px;
  margin-bottom: 0;
}

#bottomRow .trend-top {
  gap: 5px;
  margin-bottom: 1px;
}

#bottomRow .trend-rank {
  font-size: 13px;
  width: 20px;
  line-height: 1.2;
}

#bottomRow .trend-tag-name {
  font-size: 8px;
}

#bottomRow .trend-bar-wrap {
  height: 3px;
  min-width: 18px;
}

#bottomRow .trend-score {
  font-size: 11px;
}

#bottomRow .trend-meta {
  font-size: 10px;
  line-height: 1.2;
}

#bottomRow .trend-velocity {
  font-size: 10px;
}

/* ── 4. Hashtag table ─────────────────────────────────────────── */
#bottomRow .ht-table th {
  font-size: 10px;
  padding: 2px 5px 5px;
}

#bottomRow .ht-tag {
  font-size: 11px;
  padding: 4px 5px;
}

#bottomRow .ht-num {
  font-size: 11px;
  padding: 4px 5px;
}

#bottomRow .ht-plats {
  font-size: 13px;
  padding: 4px 5px;
  gap: 3px;
}

/* ── 5. Platform legend ───────────────────────────────────────── */
#bottomRow .platform-legend-row {
  padding: 1px 2px;
  gap: 2px;
  margin-bottom: 1px;
  border-radius: 4px;
}

#bottomRow .platform-dot {
  width: 6px;
  height: 6px;
}

/* ── 6. Sentiment & SOV ───────────────────────────────────────── */
#bottomRow .sent-row {
  font-size: 11px;
  padding: 2px 0;
}

#bottomRow .sent-row .sent-label {
  gap: 5px;
}

#bottomRow #sovPct {
  font-size: 11px;
}

/* ── 7. Pulse chart — fill remaining height naturally ─────────── */
#bottomRow .pulse-chart-wrap {
  min-height: 40px;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(63, 183, 95, .5);
}

/* ── Skeleton shimmer ────────────────────────────────────────── */
.skeleton-row {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--card-bg2) 25%, var(--card-bg3) 50%, var(--card-bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

/* ── Admin upload zones ──────────────────────────────────────── */
.upload-zone {
  border: 2px dashed rgba(255, 255, 255, .15);
  border-radius: 10px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--trans-med), background var(--trans-med);
}

.upload-zone:hover {
  border-color: var(--brand);
  background: rgba(63, 183, 95, .06);
}

.upload-zone.drag {
  border-color: var(--brand);
  background: rgba(63, 183, 95, .1);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════════ */

/* ── Large / Full HD 1600–1799px — give leaderboard plenty of room ── */
@media (min-width: 1600px) and (max-width: 1799px) {
  :root {
    --gap: 14px;
  }

  /* clamp() already handles these well; just ensure nav padding is generous */
  .dash-nav {
    padding: 0 28px;
  }

  #mainContent {
    padding: 14px 28px 16px;
  }

  #leaderboardCol {
    min-width: 240px;
  }
}

/* ── Medium desktop 1200–1599px — laptop-friendly ──────────── */
@media (min-width: 1200px) and (max-width: 1599px) {
  :root {
    --nav-h: 70px;
    --gap: 12px;
    /* 5px was absurdly tight; 12px looks clean on a 1366-1440 laptop */
  }

  #mainContent {
    padding: 12px 18px 14px;
  }

  /* columns: let the base clamp() handle sizing — no rigid override needed */

  #bottomRow {
    height: clamp(162px, 18vh, 195px);
  }
}

/* ── Small desktop 992–1199px ───────────────────────────────── */
@media (min-width: 992px) and (max-width: 1199px) {
  :root {
    --nav-h: 66px;
    --gap: 10px;
  }

  .dash-nav {
    grid-template-columns: clamp(150px, 16vw, 220px) 1fr auto;
    gap: 12px;
    padding: 0 16px;
  }

  .nav-kpi-strip .stat-card {
    height: 56px;
    padding: 5px 8px;
  }

  .nav-kpi-strip .stat-val {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
  }

  .nav-kpi-strip .stat-icon {
    display: none;
  }

  .kpi-progress-wrap {
    display: none;
  }

  #mainContent {
    padding: 10px 16px 12px;
  }

  /*
   * CRITICAL FIX: clamp() base values already give us fluid columns.
   * At 1100px: reel≈187px, LI≈242px, IG≈231px = 660px + leaderboard(200px min) + 4×10px gaps = 900px. OK.
   * At 992px:  reel≈190px (min), LI≈240px (min), IG≈220px (min) = 650px + 200px + 40px = 890px. Just fits.
   * These explicit overrides remove any leftover rigidity from wider screens.
   */
  #reelCard {
    flex: 0 0 clamp(175px, 16.5vw, 210px);
  }

  #linkedinCol {
    flex: 0 0 clamp(220px, 22vw, 280px);
  }

  #instagramCol {
    flex: 0 0 clamp(200px, 21vw, 265px);
  }

  #leaderboardCol {
    flex: 1;
    min-width: 185px;
  }

  #hashtagPerfCard {
    flex: 0 0 clamp(175px, 16.5vw, 210px);
  }

  #bottomRow {
    height: clamp(150px, 16vh, 185px);
  }

  #leaderboardCol .lb-name {
    max-width: 120px;
  }
}

/* ── Tablet 768–991px: 2-row nav, scrollable layout ────────── */
@media (min-width: 768px) and (max-width: 991px) {
  :root {
    --nav-h: 110px;
    --gap: 12px;
  }

  /* 2-row nav */
  .dash-nav {
    grid-template-columns: 1fr auto;
    grid-template-rows: 54px auto;
    gap: 0;
    padding: 0;
    min-height: var(--nav-h);
  }

  .nav-left {
    grid-column: 1;
    grid-row: 1;
    padding: 0 16px;
    height: 54px;
  }

  .nav-right {
    grid-column: 2;
    grid-row: 1;
    padding: 0 16px;
    height: 54px;
  }

  .nav-kpi-strip {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 7px 16px 9px;
    border-top: 1px solid var(--border);
    background: rgba(8, 11, 20, .7);
    gap: 10px;
    height: 56px;
  }

  .nav-kpi-strip .stat-card {
    height: 42px;
    padding: 5px 10px;
  }

  .nav-kpi-strip .stat-val {
    font-size: 1.1rem;
  }

  .nav-kpi-strip .stat-icon {
    display: none;
  }

  .kpi-progress-wrap {
    display: none;
  }

  /* Natural scroll layout */
  #mainContent {
    height: auto;
    overflow: visible;
    padding: 12px 16px;
    gap: 12px;
  }

  #primaryRow {
    flex-wrap: wrap;
    flex: none;
    height: auto;
  }

  /* Reel: portrait strip */
  #reelCard {
    flex: 0 0 200px;
    height: 440px;
  }

  /* LinkedIn + Instagram side by side */
  #linkedinCol {
    flex: 1;
    min-width: 260px;
    height: 440px;
  }

  #instagramCol {
    flex: 1;
    min-width: 260px;
    height: 440px;
  }

  /* Leaderboard: full row below */
  #leaderboardCol {
    flex: 0 0 100%;
    height: 320px;
  }

  .main-col>.dash-card {
    height: 100%;
  }

  #linkedinList {
    max-height: 350px;
  }

  #instagramList {
    max-height: 350px;
  }

  #leaderboard {
    max-height: 240px;
    overflow-y: auto;
  }

  /* Analytics: wrap */
  #bottomRow {
    flex-wrap: wrap;
    height: auto;
    gap: 10px;
  }

  #hashtagPerfCard {
    flex: 0 0 200px;
    height: 180px;
  }

  #trendingCard {
    flex: 1;
    min-width: 240px;
    height: 180px;
  }

  #pulseCard {
    flex: 1;
    min-width: 200px;
    height: 180px;
  }

  #platformCard {
    flex: 0 0 200px;
    height: 180px;
  }

  #sentimentCard {
    flex: 1;
    min-width: 220px;
    height: 180px;
  }

  .lb-name {
    max-width: 130px;
  }
}

/* ── Mobile < 768px ─────────────────────────────────────────── */
@media (max-width: 767px) {
  :root {
    --nav-h: 126px;
    --gap: 10px;
  }

  /* 3-zone nav becomes 2-row: [logo + buttons] [2x2 KPI grid] */
  .dash-nav {
    grid-template-columns: 1fr auto;
    grid-template-rows: 50px auto;
    gap: 0;
    padding: 0;
    min-height: var(--nav-h);
  }

  .nav-left {
    grid-column: 1;
    grid-row: 1;
    padding: 0 12px;
    height: 50px;
    gap: 8px;
  }

  .nav-brand {
    font-size: .88rem;
  }

  .nav-right {
    grid-column: 2;
    grid-row: 1;
    padding: 0 12px;
    height: 50px;
    gap: 7px;
  }

  .nav-kpi-strip {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    padding: 8px 12px 10px;
    border-top: 1px solid var(--border);
    background: rgba(8, 11, 20, .7);
    gap: 8px;
    height: 76px;
  }

  .nav-kpi-strip .stat-card {
    height: 100%;
    flex: none;
    padding: 5px 10px;
  }

  .nav-kpi-strip .stat-val {
    font-size: 1.15rem;
  }

  .nav-kpi-strip .stat-icon {
    display: none;
  }

  .kpi-progress-wrap {
    display: none;
  }

  #fetchNowBtn .d-none {
    display: none !important;
  }

  /* Natural scroll */
  #mainContent {
    height: auto;
    overflow: visible;
    padding: 10px 12px 14px;
    gap: 10px;
  }

  /* Stack all primary columns */
  #primaryRow {
    flex-direction: column;
    flex: none;
    height: auto;
    gap: 10px;
  }

  /* Reel: landscape on mobile */
  #reelCard {
    flex: none;
    height: auto;
  }

  #reelCard #postCarousel {
    aspect-ratio: 16/9;
    flex: none;
  }

  #reelCard .post-reel {
    aspect-ratio: 16/9 !important;
    border-radius: 10px;
  }

  #reelCard .reel-placeholder {
    aspect-ratio: 16/9;
    border-radius: 10px;
  }

  #reelCard .reel-countdown-bar {
    display: none;
  }

  .reel-overlay {
    padding: 28px 10px 10px;
  }

  .reel-caption {
    font-size: .68rem;
    -webkit-line-clamp: 2;
  }

  .reel-metrics {
    font-size: .66rem;
    gap: 8px;
  }

  #linkedinCol,
  #instagramCol,
  #leaderboardCol {
    flex: none;
    height: auto;
  }

  .main-col>.dash-card {
    height: auto;
    flex: none;
  }

  #linkedinList {
    max-height: 260px;
  }

  #instagramList {
    max-height: 260px;
  }

  #leaderboard {
    max-height: 300px;
    overflow-y: auto;
  }

  /* Hide extra leaderboard columns on mobile to save horizontal space */
  .lb-table th:nth-child(n+4),
  .lb-table td:nth-child(n+4) {
    display: none;
  }

  .lb-name {
    max-width: 120px;
  }

  /* Analytics: stack vertically on mobile */
  #bottomRow {
    flex-direction: column;
    height: auto;
    gap: 10px;
  }

  .bottom-card {
    flex: none !important;
    height: 160px;
  }

  #hashtagPerfCard {
    height: auto;
    max-height: 220px;
    flex: none;
  }

  #trendingList {
    max-height: 110px;
  }

  .trend-bar-wrap {
    display: none;
  }
}

/* ── Very small phones (≤ 380px) ────────────────────────────── */
@media (max-width: 380px) {
  :root {
    --nav-h: 120px;
  }

  .nav-kpi-strip {
    grid-template-columns: 1fr 1fr;
    height: 70px;
    padding: 6px 10px 8px;
  }

  .nav-kpi-strip .stat-val {
    font-size: 1rem;
  }

  .nav-kpi-strip .stat-label {
    font-size: .55rem;
  }

  .nav-left img[height="75"] {
    height: 44px !important;
  }

  .live-badge {
    font-size: .55rem;
    padding: 2px 6px;
  }

  #mainContent {
    padding: 8px 10px 12px;
    gap: 8px;
  }

  .reel-caption {
    font-size: .65rem;
  }

  .reel-metrics {
    font-size: .62rem;
    gap: 6px;
  }

  .lb-name {
    max-width: 90px;
  }
}

/* ── TV / Large-monitor mode 1800–2199px (FHD TV at 1920px CSS) ─── */
/*
 * Most smart TVs (Samsung Tizen, LG webOS, Hisense) render at 1920×1080 CSS px
 * regardless of native panel resolution.  13px base is TOO SMALL at 2-3m viewing
 * distance.  We step up to 16px so the dashboard is comfortably readable on a
 * 55-75" screen from a couch/boardroom distance.
 */
@media screen and (min-width: 1800px) and (max-width: 2199px) {
  html {
    font-size: 16px;
  }

  /* ↑ from 13px — the single most impactful TV fix */

  :root {
    --nav-h: 80px;
    --gap: 12px;
  }

  .dash-nav {
    padding: 0 28px;
    gap: 18px;
    grid-template-columns: clamp(180px, 17vw, 260px) 1fr auto;
    min-height: var(--nav-h);
  }

  /* KPI strip */
  .nav-kpi-strip {
    gap: 12px;
    padding: 10px 0;
  }

  .nav-kpi-strip .stat-card {
    height: 60px;
    padding: 6px 16px;
    border-radius: 11px;
    animation: none;
  }

  .nav-kpi-strip .stat-val {
    font-size: 1.45rem;
    margin-bottom: 2px;
    line-height: 1;
  }

  .nav-kpi-strip .stat-label {
    font-size: .6rem;
    letter-spacing: .05em;
    white-space: nowrap;
  }

  .nav-kpi-strip .stat-icon {
    display: none;
  }

  .kpi-progress-wrap {
    display: none;
  }

  .live-badge {
    font-size: .6rem;
    padding: 2px 9px;
  }

  .live-dot {
    width: 7px;
    height: 7px;
  }

  /* Main canvas */
  #mainContent {
    padding: 10px 28px 12px;
    gap: 12px;
  }

  /* Cards */
  .dash-card {
    padding: 11px 15px;
    border-radius: 12px;
  }

  .card-header-row {
    font-size: .7rem;
    padding-bottom: 8px;
    letter-spacing: .07em;
  }

  /*
   * Column widths at 1920px with 16px base:
   * At this DPR the clamp() base already gives sensible px values.
   * We only pin them explicitly to keep everything proportional.
   */
  #reelCard {
    flex: 0 0 clamp(230px, 15vw, 280px);
  }

  #linkedinCol {
    flex: 0 0 clamp(320px, 22vw, 390px);
  }

  #instagramCol {
    flex: 0 0 clamp(305px, 21vw, 375px);
  }

  #leaderboardCol {
    flex: 1;
    min-width: 220px;
  }

  #hashtagPerfCard {
    flex: 0 0 clamp(230px, 15vw, 280px);
  }

  /* Bottom row — compact content fits comfortably at 185px */
  #bottomRow {
    height: 185px;
    gap: 12px;
  }

  /* Leaderboard */
  .lb-table th {
    font-size: .58rem;
    padding: 2px 7px 6px;
  }

  .lb-rank-cell {
    font-size: .92rem;
    width: 26px;
    padding: 5px 2px;
  }

  .lb-avatar {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: .63rem;
  }

  .lb-creator-cell {
    padding: 5px 9px 5px 2px;
  }

  .lb-creator-inner {
    gap: 6px;
  }

  .lb-name {
    font-size: .73rem;
    max-width: 190px;
  }

  .lb-sub {
    font-size: .58rem;
  }

  .lb-metric {
    font-size: .68rem;
    padding: 5px 7px;
  }

  .lb-score-cell {
    font-size: .80rem;
    padding: 5px 7px;
  }

  /* Trending */
  .trend-item {
    padding: 4px 4px;
    margin-bottom: 1px;
  }

  .trend-rank {
    font-size: .93rem;
    width: 20px;
  }

  .trend-tag-name {
    font-size: .76rem;
  }

  .trend-score {
    font-size: .72rem;
  }

  .trend-meta {
    font-size: .59rem;
  }

  .trend-bar-wrap {
    height: 4px;
  }

  /* Hashtag table */
  .ht-table th {
    font-size: .57rem;
    padding: 2px 6px 6px;
  }

  .ht-tag {
    font-size: .73rem;
    padding: 5px 7px;
  }

  .ht-num {
    font-size: .70rem;
    padding: 5px 7px;
  }

  .ht-plats {
    font-size: .80rem;
    padding: 5px 7px;
    gap: 4px;
  }

  /* Platform legend */
  .platform-legend-row {
    padding: 1px 2px;
    border-radius: 5px;
  }

  .platform-dot {
    width: 6px;
    height: 6px;
  }

  /* Reel */
  .author-avatar {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: .6rem;
  }

  .reel-overlay {
    padding: 42px 11px 11px;
  }

  .reel-caption {
    font-size: .67rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    margin: 3px 0 5px;
  }

  .reel-metrics {
    font-size: .64rem;
    gap: 8px;
  }

  .reel-tag {
    font-size: .58rem;
    padding: 1px 7px;
  }

  .post-platform {
    font-size: .61rem;
  }

  .reel-tab {
    width: 25px;
    height: 23px;
    font-size: .67rem;
    border-radius: 5px;
  }

  .reel-tab[data-platform="all"] {
    padding: 0 7px;
    font-size: .58rem;
  }

  .custom-tabs .nav-link {
    font-size: .59rem;
    padding: 2px 7px;
  }
}

/* ── 2K / QHD 2200–3399px — proportional scale between TV modes */
@media (min-width: 2200px) and (max-width: 3399px) {
  html {
    font-size: 17px;
  }

  /* slightly bigger for QHD/2K displays */
  :root {
    --nav-h: 86px;
    --gap: 15px;
  }

  .dash-nav {
    padding: 0 36px;
    gap: 24px;
    grid-template-columns: clamp(200px, 16vw, 320px) 1fr auto;
  }

  .nav-kpi-strip {
    gap: 14px;
  }

  .nav-kpi-strip .stat-card {
    height: 64px;
    padding: 6px 18px;
    border-radius: 12px;
    animation: none;
  }

  .nav-kpi-strip .stat-val {
    font-size: 1.5rem;
    margin-bottom: 2px;
  }

  .nav-kpi-strip .stat-label {
    font-size: .6rem;
  }

  .nav-kpi-strip .stat-icon {
    display: none;
  }

  .kpi-progress-wrap {
    display: none;
  }

  #mainContent {
    padding: 12px 36px 14px;
    gap: 15px;
  }

  .dash-card {
    padding: 12px 16px;
    border-radius: 13px;
  }

  .card-header-row {
    font-size: .73rem;
    padding-bottom: 8px;
  }

  /* fluid columns — clamp() scales naturally at 2560px */
  #reelCard {
    flex: 0 0 clamp(260px, 13vw, 340px);
  }

  #linkedinCol {
    flex: 0 0 clamp(380px, 19vw, 500px);
  }

  #instagramCol {
    flex: 0 0 clamp(360px, 18vw, 480px);
  }

  #leaderboardCol {
    flex: 1;
    min-width: 240px;
  }

  #hashtagPerfCard {
    flex: 0 0 clamp(260px, 13vw, 340px);
  }

  #bottomRow {
    height: 195px;
    gap: 15px;
  }

  .lb-name {
    max-width: 220px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   4K / UHD ≥ 3400px — TWO VARIANTS (TV  vs  Desktop monitor)
   CSS can't read HDMI/DP signal, but hover:hover + pointer:fine
   reliably separates mouse-driven monitors from TV remotes/touch.
   ══════════════════════════════════════════════════════════════════ */

/* ── Variant A: 4K TV / large-screen wall display ────────────────
   No hover, coarse pointer (TV remote / touchscreen at distance).
   75" panels, 3 m viewing distance → 26px = same visual density
   as 13px on a 1920px desktop. Column widths: 2× desktop values.  */
@media (min-width: 3400px) {
  html {
    font-size: 26px;
  }

  :root {
    --nav-h: 140px;
    --gap: 20px;
  }

  .dash-nav {
    padding: 0 48px;
    gap: 32px;
    min-height: var(--nav-h);
    grid-template-columns: clamp(340px, 11.5vw, 500px) 1fr auto;
  }

  .nav-kpi-strip {
    gap: 20px;
    padding: 16px 0;
  }

  .nav-kpi-strip .stat-card {
    height: 108px;
    padding: 10px 32px;
    border-radius: 20px;
    animation: none;
  }

  .nav-kpi-strip .stat-icon {
    display: none;
  }

  .kpi-progress-wrap {
    display: none;
  }

  .nav-kpi-strip .stat-val {
    font-size: 1.55rem;
    margin-bottom: 2px;
    line-height: 1;
  }

  .nav-kpi-strip .stat-label {
    font-size: .62rem;
    letter-spacing: .05em;
    white-space: nowrap;
  }

  .live-badge {
    font-size: .62rem;
    padding: 2px 8px;
    border-radius: 20px;
  }

  .live-dot {
    width: 6px;
    height: 6px;
  }

  #mainContent {
    padding: 16px 48px 20px;
    gap: 20px;
  }

  .dash-card {
    padding: 10px 14px;
    border-radius: 20px;
    border-width: 2px;
  }

  .card-header-row {
    font-size: .72rem;
    padding-bottom: 7px;
    border-bottom-width: 2px;
    letter-spacing: .07em;
  }

  #reelCard {
    flex: 0 0 clamp(380px, 11vw, 480px);
  }

  #linkedinCol {
    flex: 0 0 clamp(600px, 17.5vw, 740px);
  }

  #instagramCol {
    flex: 0 0 clamp(570px, 16.5vw, 700px);
  }

  #leaderboardCol {
    flex: 1;
    min-width: 360px;
  }

  #hashtagPerfCard {
    flex: 0 0 clamp(380px, 11vw, 480px);
  }

  #bottomRow {
    height: 205px;
    gap: 20px;
  }

  /* compact content; was 360px TV-scale */

  .post-reel {
    border-radius: 36px;
    border-width: 2px;
  }

  .reel-overlay {
    padding: 80px 20px 20px;
  }

  .reel-caption {
    font-size: .68rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    margin: 3px 0 4px;
  }

  .reel-metrics {
    font-size: .65rem;
    gap: 14px;
  }

  .reel-tag {
    font-size: .58rem;
    padding: 2px 14px;
  }

  .reel-play-badge {
    font-size: .6rem;
    padding: 3px 12px;
  }

  .reel-icon {
    font-size: 5rem;
  }

  .carousel-dot {
    width: 5px;
    height: 5px;
  }

  .carousel-dot.active {
    width: 18px;
    border-radius: 3px;
  }

  .reel-tab {
    width: 26px;
    height: 24px;
    font-size: .72rem;
    border-radius: 12px;
  }

  .reel-tab[data-platform="all"] {
    width: auto;
    padding: 0 7px;
    font-size: .58rem;
  }

  .author-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: .6rem;
  }

  .post-platform {
    font-size: .62rem;
  }

  .lb-table th {
    font-size: .6rem;
    padding: 2px 7px 6px;
  }

  .lb-rank-cell {
    font-size: .95rem;
    width: 26px;
    padding: 5px 2px;
  }

  .lb-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: .65rem;
  }

  .lb-creator-cell {
    padding: 5px 8px 5px 2px;
  }

  .lb-creator-inner {
    gap: 6px;
  }

  .lb-name {
    font-size: .75rem;
    max-width: 400px;
  }

  .lb-sub {
    font-size: .6rem;
  }

  .lb-metric {
    padding: 5px 7px;
    font-size: .7rem;
  }

  .lb-score-cell {
    padding: 5px 7px;
    font-size: .82rem;
  }

  .ht-table th {
    font-size: .58rem;
    padding: 2px 6px 6px;
  }

  .ht-tag {
    font-size: .75rem;
    padding: 5px 6px;
  }

  .ht-num {
    font-size: .72rem;
    padding: 5px 6px;
  }

  .ht-plats {
    font-size: .82rem;
    padding: 5px 6px;
    gap: 8px;
  }

  .platform-legend-row {
    padding: 1px 2px;
    border-radius: 10px;
  }

  .platform-dot {
    width: 6px;
    height: 6px;
  }

  .trend-item {
    padding: 4px 3px;
    margin-bottom: 1px;
    border-radius: 12px;
  }

  .trend-rank {
    font-size: .95rem;
    width: 20px;
  }

  .trend-tag-name {
    font-size: .78rem;
  }

  .trend-score {
    font-size: .74rem;
  }

  .trend-meta {
    font-size: .6rem;
  }

  .trend-bar-wrap {
    height: 4px;
  }

  .trend-velocity {
    font-size: .58rem;
  }

  .custom-tabs .nav-link {
    font-size: .6rem;
    padding: 2px 6px;
    border-radius: 12px;
    border-width: 2px;
  }

  .linkedin-post {
    padding: 10px 12px;
    border-radius: 20px;
  }

  .instagram-post {
    padding: 10px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
  }
}

/* ── Variant B: 4K Ultra HD DESKTOP MONITOR — 3840 × 2160 ────────
   Mini LED · 144 Hz · ~65 cm viewing · mouse + keyboard detected
   via (hover: hover) + (pointer: fine) — overrides the TV block.

   DPI note: Windows default for 27-32" 4K = 150 % → 2560 CSS px
   (handled by 2200-3399 range).  This block fires at 100 % DPI
   (3840 CSS px) which power users choose for maximum pixel estate.

   Font: 20 px  (1.54 × desktop 13px — sharp, not TV-giant)
   Columns: vw-based so they proportionally fill 3840 px width.
   ────────────────────────────────────────────────────────────── */
@media (min-width: 3400px) and (hover: hover) and (pointer: fine) {

  /* ── Base scale ──────────────────────────────────────────────── */
  html {
    font-size: 20px;
  }

  :root {
    --nav-h: 112px;
    --gap: 22px;
  }

  /* ── Navigation bar ──────────────────────────────────────────── */
  .dash-nav {
    padding: 0 52px;
    gap: 26px;
    min-height: var(--nav-h);
    /*
     * Left zone: 10.5 vw = 403 px at 3840  — logo + live badge breathe.
     * Centre:    1fr  — KPI strip gets all remaining space.
     * Right:     auto — admin buttons.
     */
    grid-template-columns: clamp(290px, 10.5vw, 430px) 1fr auto;
  }

  /* KPI strip — compact card, large crisp number */
  .nav-kpi-strip {
    gap: 18px;
    padding: 14px 0;
  }

  .nav-kpi-strip .stat-card {
    height: 82px;
    padding: 8px 24px;
    border-radius: 14px;
    animation: none;
  }

  .nav-kpi-strip .stat-val {
    font-size: 1.65rem;
    margin-bottom: 2px;
    line-height: 1;
  }

  .nav-kpi-strip .stat-label {
    font-size: .60rem;
    letter-spacing: .06em;
    white-space: nowrap;
  }

  .nav-kpi-strip .stat-icon {
    display: none;
  }

  .kpi-progress-wrap {
    display: none;
  }

  .live-badge {
    font-size: .64rem;
    padding: 3px 12px;
    border-radius: 20px;
  }

  .live-dot {
    width: 8px;
    height: 8px;
  }

  /* ── Main canvas — 2160 − 112 = 2048 px usable ──────────────── */
  #mainContent {
    padding: 16px 52px 18px;
    gap: 22px;
  }

  /* ── Cards ───────────────────────────────────────────────────── */
  .dash-card {
    padding: 14px 18px;
    border-radius: 16px;
    border-width: 1px;
    /* thin border = crisp on Mini LED */
  }

  .card-header-row {
    font-size: .76rem;
    padding-bottom: 10px;
    border-bottom-width: 1px;
    letter-spacing: .07em;
  }

  /* ── Column widths — vw-proportional for 3840 px viewport ───────
   *  Viewport: 3840 px
   *  Horiz padding: 2 × 52 = 104 px  →  usable: 3736 px
   *  4 gaps: 4 × 22 = 88 px
   *  Available for columns: 3736 − 88 = 3648 px
   *
   *  Reel    : 11.5 vw = 441 px  →  9:16 reel is 441 × 783 px
   *  LinkedIn: 17.5 vw = 672 px
   *  Instagram:16.5 vw = 634 px
   *  Hashtag  :11.5 vw = 441 px
   *  Leaderboard: 3648 − (441+672+634+441) = 1460 px (rich data table)
   * ──────────────────────────────────────────────────────────── */
  #reelCard {
    flex: 0 0 clamp(390px, 11.5vw, 520px);
  }

  #linkedinCol {
    flex: 0 0 clamp(580px, 17.5vw, 760px);
  }

  #instagramCol {
    flex: 0 0 clamp(550px, 16.5vw, 720px);
  }

  #leaderboardCol {
    flex: 1;
    min-width: 360px;
  }

  #hashtagPerfCard {
    flex: 0 0 clamp(390px, 11.5vw, 520px);
  }

  /* ── Bottom row ─── canvas=2048, 20vh=432px → clamp to 310-400 */
  #bottomRow {
    height: 210px;
    gap: 22px;
  }

  /* compact content; was clamp(310,20vh,400) */

  /* ── Reel card ────────────────────────────────────────────────── */
  .post-reel {
    border-radius: 26px;
    border-width: 1px;
  }

  .reel-placeholder {
    border-radius: 26px;
  }

  .reel-overlay {
    padding: 70px 18px 18px;
  }

  .reel-caption {
    font-size: .74rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    margin: 5px 0 7px;
    line-height: 1.55;
  }

  .reel-metrics {
    font-size: .70rem;
    gap: 14px;
  }

  .reel-tag {
    font-size: .62rem;
    padding: 3px 12px;
    border-radius: 20px;
  }

  .reel-play-badge {
    font-size: .64rem;
    padding: 4px 13px;
    border-radius: 20px;
  }

  .reel-icon {
    font-size: 5.5rem;
  }

  /* Tabs inside reel card */
  .reel-tab {
    width: 30px;
    height: 28px;
    font-size: .74rem;
    border-radius: 8px;
  }

  .reel-tab[data-platform="all"] {
    width: auto;
    padding: 0 10px;
    font-size: .64rem;
  }

  /* Carousel dots — slightly bigger for crisp Mini LED pixel grid */
  .carousel-dot {
    width: 7px;
    height: 7px;
  }

  .carousel-dot.active {
    width: 24px;
    border-radius: 3.5px;
    box-shadow: 0 0 12px rgba(63, 183, 95, .65);
  }

  /* ── Post author ─────────────────────────────────────────────── */
  .author-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: .68rem;
  }

  .post-platform {
    font-size: .68rem;
  }

  /* ── Feed post cards ─────────────────────────────────────────── */
  .linkedin-post {
    padding: 14px 16px;
    border-radius: 14px;
  }

  .instagram-post {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 13px;
  }

  /* ── Leaderboard — the widest column; show all metadata ─────── */
  .lb-table th {
    font-size: .65rem;
    padding: 4px 10px 9px;
  }

  .lb-rank-cell {
    font-size: 1.10rem;
    width: 34px;
    padding: 7px 3px;
  }

  .lb-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: .70rem;
  }

  .lb-creator-cell {
    padding: 7px 14px 7px 2px;
  }

  .lb-creator-inner {
    gap: 10px;
  }

  .lb-name {
    font-size: .85rem;
    max-width: 420px;
  }

  .lb-sub {
    font-size: .66rem;
    margin-top: 2px;
  }

  .lb-metric {
    font-size: .78rem;
    padding: 7px 10px;
  }

  .lb-score-cell {
    font-size: .94rem;
    padding: 7px 10px;
  }

  .lb-pts {
    font-size: .64rem;
  }

  /* ── Hashtag performance table ───────────────────────────────── */
  .ht-table th {
    font-size: .64rem;
    padding: 4px 9px 9px;
  }

  .ht-tag {
    font-size: .82rem;
    padding: 7px 9px;
  }

  .ht-num {
    font-size: .80rem;
    padding: 7px 9px;
  }

  .ht-plats {
    font-size: .90rem;
    padding: 7px 9px;
    gap: 6px;
  }

  /* ── Platform legend ─────────────────────────────────────────── */
  .platform-legend-row {
    padding: 1px 2px;
    border-radius: 8px;
    gap: 2px;
  }

  .platform-dot {
    width: 9px;
    height: 9px;
  }

  /* ── Trending list ───────────────────────────────────────────── */
  .trend-item {
    padding: 6px 5px;
    margin-bottom: 2px;
    border-radius: 8px;
  }

  .trend-rank {
    font-size: 1.05rem;
    width: 26px;
  }

  .trend-tag-name {
    font-size: .88rem;
  }

  .trend-score {
    font-size: .84rem;
  }

  .trend-meta {
    font-size: .68rem;
  }

  .trend-bar-wrap {
    height: 5px;
  }

  .trend-velocity {
    font-size: .65rem;
  }

  /* ── Navigation pills / tabs ─────────────────────────────────── */
  .custom-tabs .nav-link {
    font-size: .66rem;
    padding: 4px 11px;
    border-radius: 8px;
    border-width: 1px;
  }

  /* ── Sentiment rows ──────────────────────────────────────────── */
  .sent-row {
    font-size: .84rem;
    padding: 5px 0;
  }
}