/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:        #165AD9;
  --brand-light:  #E8F0FF;
  --red-btn:      #E31B54;
  --border:       #EAECF0;
  --border-input: #D0D5DD;
  --bg-sidebar:   #F2F4F7;
  --bg-nav:       #F9FAFB;
  --bg-page:      #FFFFFF;
  --text-title:   #101828;
  --text-nav:     #344054;
  --text-muted:   #667085;
  --match-green:  #079455;
  --match-orange: #F79009;
  --match-red:    #D92D20;
  --shadow-xs:    0px 1px 2px rgba(16,24,40,0.05);
  --shadow-md:    0px 4px 8px -2px rgba(16,24,40,0.1), 0px 2px 4px -2px rgba(16,24,40,0.06);
  --shadow-fab:   0px 0px 1px rgba(23,27,40,0.25), 0px 2px 4px rgba(23,27,40,0.15);
  --tr: 0.22s cubic-bezier(0.4,0,0.2,1);
  /* Sidebar width — toggled by JS */
  --sb-w: 85px;
}

html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-title);
  display: flex;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* =====================================================================
   SIDEBAR
   Two states:
     collapsed  → width 72px, inner pill 56px, labels hidden
     expanded   → width 220px, inner pill 204px, labels visible
   ===================================================================== */
.sb {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sb-w);
  padding: 8px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width var(--tr);
  overflow: visible; /* allow chevron to overflow */
}

.sb-inner {
  flex: 1;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  overflow: hidden;
  transition: width var(--tr);
}

/* ---- Top section ---- */
.sb-top {
  display: flex;
  flex-direction: column;
  padding: 16px 8px 0;
  gap: 16px;
}

/* Logo row */
.sb-logo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  overflow: hidden;
}
/* Logomark: always visible, shown in collapsed state */
.sb-logo-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity var(--tr), width var(--tr);
}
.sb-logo-mark svg { display: block; }

/* Full wordmark: hidden collapsed, shown expanded */
.sb-logo-full {
  opacity: 0;
  width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  transition: opacity var(--tr), width var(--tr);
}
.sb-logo-full svg { display: block; flex-shrink: 0; }

/* Button group */
.sb-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Create: 36×36 collapsed, full-width expanded */
.btn-create {
  height: 36px;
  background: var(--red-btn);
  box-shadow: var(--shadow-xs);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  transition: background var(--tr);
  overflow: hidden;
  white-space: nowrap;
}
.btn-create:hover { background: #c5174a; }
.btn-create svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 1.67; stroke-linecap: round; flex-shrink: 0; }
.btn-create-label {
  font-family: 'Inter'; font-size: 13px; font-weight: 600; color: #fff;
  opacity: 0; width: 0; overflow: hidden;
  transition: opacity var(--tr), width var(--tr);
}

/* Auto posting button */
.btn-autopost {
  height: 36px;
  background: #FFFFFF;
  border: 1px solid #6FA1FF;
  box-shadow: var(--shadow-xs);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  transition: background var(--tr);
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
}
.btn-autopost:hover { background: #F0F5FF; }
.btn-autopost svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-autopost-label {
  font-family: 'Inter'; font-size: 13px; font-weight: 600; color: var(--brand);
  opacity: 0; width: 0; overflow: hidden;
  transition: opacity var(--tr), width var(--tr);
}
.autopost-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22C55E; flex-shrink: 0;
  opacity: 0; width: 0; overflow: hidden;
  transition: opacity var(--tr), width var(--tr);
}

/* Nav items */
.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-btn {
  height: 40px;
  border-radius: 6px;
  display: flex; align-items: center;
  padding: 0 8px;
  gap: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
  overflow: hidden;
  white-space: nowrap;
}
.nav-btn:hover { background: rgba(0,0,0,0.05); }
.nav-btn.active { background: #FFFFFF; color: #44516a;}
.nav-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.nav-btn-label {
  font-family: 'Inter'; font-size: 13px; font-weight: 400;
  color: inherit;
  opacity: 0; width: 0; overflow: hidden;
  transition: opacity var(--tr), width var(--tr);
}

/* ---- Bottom section ---- */
.sb-bottom {
  display: flex;
  flex-direction: column;
  padding: 0 8px 16px;
  gap: 16px;
}
.sb-foot-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-avatar {
  width: 32px; height: 32px;
  border-radius: 9999px;
  background: #D9E5CC;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter'; font-size: 13px; font-weight: 600; color: #374151;
  border: 0.75px solid rgba(0,0,0,0.08);
  cursor: pointer; flex-shrink: 0;
}
.sb-user-row {
  display: flex; align-items: center; gap: 8px;
  overflow: hidden;
}
.sb-user-info {
  opacity: 0; width: 0; overflow: hidden;
  transition: opacity var(--tr), width var(--tr);
}
.sb-user-name { font-size: 12px; font-weight: 600; color: var(--text-title); white-space: nowrap; }
.sb-user-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ---- EXPANDED STATE ---- */
body.sb-expanded {
  --sb-w: 20%;
}
body.sb-expanded .sb-logo-mark {
  opacity: 0; width: 0; overflow: hidden;
}
body.sb-expanded .sb-logo-full {
  opacity: 1; width: auto;
}
body.sb-expanded .btn-create-label {
  opacity: 1; width: auto;
}
body.sb-expanded .btn-autopost-label {
  opacity: 1; width: auto;
}
body.sb-expanded .autopost-dot {
  opacity: 1; width: 7px;
}
body.sb-expanded .nav-btn-label {
  opacity: 1; width: auto;
}
body.sb-expanded .sb-user-info {
  opacity: 1; width: auto;
}

/* ---- Chevron toggle ---- */
/* Sits right at the right edge of the sidebar pill */
.sb-chevron {
  position: fixed;
  top: 25px;
  /* JS will update left via inline style */
  left: 65px; /* collapsed default: 72px - 28px/2 ≈ 56px */
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border-input);
  backdrop-filter: blur(4px);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 101;
  box-shadow: var(--shadow-md);
  transition: left var(--tr);
}
.sb-chevron svg {
  width: 16px; height: 16px;
  stroke: #344054; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform var(--tr);
}
body.sb-expanded .sb-chevron svg { transform: rotate(180deg); }

/* =====================================================================
   MAIN CONTENT
   margin-left tracks --sb-w via CSS variable
   ===================================================================== */
.main {
  margin-left: var(--sb-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  /* Critical: constrain width so grid always fits */
  min-width: 0;
  transition: margin-left var(--tr);
}

/* ---- Top bar ---- */
.topbar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 16px 16px;
  gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.btn-back {
  width: 36px; height: 36px;
  background: #FFFFFF; border: 1px solid var(--border-input);
  box-shadow: var(--shadow-xs); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; color: #475467;
}
.btn-back svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.67; stroke-linecap: round; stroke-linejoin: round; }

.page-title {
  font-family: 'Inter'; font-weight: 600; font-size: 24px; line-height: 32px;
  color: var(--text-title); white-space: nowrap;
}

/* Search */
.search-box {
  display: flex; align-items: center;
  padding: 6px 8px; gap: 8px;
  width: 280px; height: 36px;
  background: #FFFFFF; border: 1px solid var(--border-input);
  box-shadow: var(--shadow-xs); border-radius: 8px;
  flex-shrink: 0;
  transition: border-color var(--tr);
}
.search-box:focus-within { border-color: var(--brand); }
.search-box svg { width: 20px; height: 20px; stroke: var(--text-muted); fill: none; stroke-width: 1.67; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.search-box input {
  border: none; outline: none; width: 100%;
  font-family: 'Inter'; font-size: 14px; color: var(--text-muted); background: transparent;
}
.search-box input::placeholder { color: var(--text-muted); }

/* ---- Filter bar ---- */
/* Must be visible — no height clipping, overflow-x scroll */
.filter-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 16px 16px 16px 16px;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 8px;
  height: 26px;
  background: #FFFFFF;
  border: 0.5px solid;
  border-radius: 6px;
  font-family: 'Inter'; font-weight: 500; font-size: 12px; line-height: 18px;
  color: var(--text-nav);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: all var(--tr);
}
.chip:hover { border-color: #888; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #FFFFFF; }

/* Scroll arrow */
.filter-arrow {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: #FFFFFF; border: 1px solid var(--border);
  box-shadow: var(--shadow-md); border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.filter-arrow svg { width: 16px; height: 16px; stroke: #344054; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* -- Sub-nav (under Ad Inspirations) -- */
.sub-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 8px;
}
.sub-btn {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 8px 0 34px;
  border-radius: 6px;
  font-family: 'Inter'; font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
  transition: background var(--tr), color var(--tr), opacity var(--tr), max-height var(--tr);
}
.sub-btn:hover { background: rgba(0,0,0,0.04); color: var(--text-nav); }
.sub-btn.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
/* Show sub-items only when sidebar is expanded */
body.sb-expanded .sub-btn {
  opacity: 1;
  max-height: 40px;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: all;
  height: 34px;
}

/* ---- Masonry grid ---- */
.grid-wrap {
  padding: 10px 16px 40px;
  flex: 1;
}

.masonry {
  column-count: 6;
  column-gap: 8px;
}

/* Card */
.card {
  break-inside: avoid;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  cursor: pointer;
  position: relative;
  background: #E5E7EB;
  display: block;
}
/* ---- Card image wrapper, skeleton & lazy fade-in ---- */
.card-img-wrap {
  position: relative;
  width: 100%;
  display: block;
  background: #E5E7EB;
  /* min-height prevents layout collapse before image loads */
  min-height: 120px;
}

/* Shimmer skeleton shown while image loads */
.card-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #E5E7EB 0%,
    #F3F4F6 40%,
    #E5E7EB 80%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Lazy image — invisible until loaded */
.card img.lazy {
  width: 100%; display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.3s ease;
}
/* Fade in when loaded */
.card img.lazy.loaded {
  opacity: 1;
}
/* Hide skeleton once image has loaded */
.card img.lazy.loaded ~ .card-skeleton {
  opacity: 0;
  pointer-events: none;
}
.card:hover img { transform: scale(1.04); }

/* ---- Sidebar sign-in block ---- */
.sb-signin-block {
  display: flex;
  align-items: center;
  gap: 0;
  /* margin: 0 8px 10px; */
  padding: 10px 10px;
  background: var(--brand-light);
  border: 1px solid #C5D8FC;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--tr);
  overflow: hidden;
  min-height: 48px;
}
.sb-signin-block:hover { background: #dce8fb; }

.sb-signin-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: white;
}
.sb-signin-icon svg { stroke: white; }

.sb-signin-text {
  display: flex;
  flex-direction: column;
  margin-left: 10px;
  overflow: hidden;
  opacity: 0;
  max-width: 0;
  transition: opacity var(--tr), max-width var(--tr);
  white-space: nowrap;
}
body.sb-expanded .sb-signin-text {
  opacity: 1;
  max-width: 160px;
}
.sb-signin-title {
  font-family: 'Inter'; font-size: 13px; font-weight: 600;
  color: var(--brand);
}
.sb-signin-sub {
  font-family: 'Inter'; font-size: 11px; font-weight: 400;
  color: var(--text-muted);
}

.card-hover {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.28);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--tr);
}
.card:hover .card-hover { opacity: 1; }
.play-circle {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.92); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.play-circle svg { width: 16px; height: 16px; fill: var(--brand); margin-left: 2px; }

/* Ratio badge: top-left */
.badge-ratio {
  position: absolute; top: 8px; left: 8px;
  display: flex; gap: 4px;
}
.bdg {
  display: flex; align-items: center;
  padding: 2px 4px;
  background: #0C111D; border-radius: 4px;
  font-family: 'Inter'; font-weight: 400; font-size: 11px; line-height: 15px;
  color: #FFFFFF; white-space: nowrap;
}

/* Match badge: bottom-right pill */
.badge-match {
  position: absolute; bottom: 8px; right: 8px;
  display: flex; align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--border); border-radius: 9999px;
  font-family: 'Inter'; font-weight: 600; font-size: 11px; line-height: 18px;
  color: #FFFFFF; white-space: nowrap;
}
.badge-match.green  { background: var(--match-green); }
.badge-match.orange { background: var(--match-orange); }
.badge-match.red    { background: var(--match-red); }

.card.hidden { display: none; }

/* =====================================================================
   MODAL
   ===================================================================== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--tr);
}
.overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: #FFFFFF; border-radius: 16px; overflow: hidden;
  display: flex; width: 100%; max-width: 820px; max-height: 90vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: translateY(10px) scale(0.97);
  transition: transform var(--tr);
}
.overlay.open .modal { transform: translateY(0) scale(1); }

.m-media {
  position: relative; width: 46%; flex-shrink: 0;
  background: #111; overflow: hidden;
  /* Lock aspect ratio so the panel never resizes when swapping img→video */
  aspect-ratio: 9/16;
  min-height: 0;
}
.m-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-play-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.m-play-btn {
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.9); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.15s;
}
.m-play-btn:hover { transform: scale(1.08); }
.m-play-btn svg { width: 22px; height: 22px; fill: var(--brand); margin-left: 3px; }
.m-ratio-bdg {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.72); color: #fff;
  font-family: 'Inter'; font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
}
.m-info {
  flex: 1; padding: 28px;
  display: flex; flex-direction: column;
  overflow-y: auto; position: relative;
}
.m-close {
  position: absolute; top: 16px; right: 16px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border-input);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: #fff; transition: background var(--tr);
}
.m-close:hover { background: var(--bg-sidebar); }
.m-close svg { width: 14px; height: 14px; stroke: var(--text-muted); fill: none; stroke-width: 2.2; stroke-linecap: round; }
.m-title {
  font-family: 'Inter'; font-weight: 700; font-size: 20px; line-height: 1.3;
  color: var(--text-title); padding-right: 36px; margin-bottom: 6px;
}
.m-age {
  display: flex; align-items: center; gap: 5px;
  font-family: 'Inter'; font-size: 13px; color: var(--text-muted);
  margin-bottom: 20px;
}
.m-age svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.m-why { font-family: 'Inter'; font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.match-box { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; }
.match-strong { font-size: 13px; font-weight: 700; color: #16A34A; margin-bottom: 14px; }
.mrow { margin-bottom: 14px; }
.mrow:last-child { margin-bottom: 0; }
.mrow-top { display: flex; justify-content: space-between; margin-bottom: 5px; }
.mrow-title { font-family: 'Inter'; font-size: 13px; font-weight: 600; color: var(--text-title); }
.mrow-sub { font-family: 'Inter'; font-size: 12px; color: var(--text-muted); }
.mtrack { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.mfill { height: 100%; background: var(--brand); border-radius: 3px; transition: width 0.55s cubic-bezier(.4,0,.2,1); }
.m-footer { margin-top: auto; padding-top: 20px; }
.credit-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: #FFFBEB; border: 1px solid #FCD34D;
  color: #92400E; font-family: 'Inter'; font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px; margin-bottom: 12px;
}
.credit-dot { width: 7px; height: 7px; border-radius: 50%; background: #F59E0B; flex-shrink: 0; }
.btn-recreate {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px;
  background: var(--brand); color: #fff; border-radius: 8px;
  font-family: 'Inter'; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background var(--tr); box-shadow: var(--shadow-xs);
}
.btn-recreate:hover { background: #1149b0; }
.btn-recreate svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* =====================================================================
   MOBILE BOTTOM NAV
   height 76px, padding 8px 16px, gap 14px, bg #F9FAFB
   ===================================================================== */
.mob-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  flex-direction: row; justify-content: space-between; align-items: center;
  padding: 8px 16px; gap: 14px;
  height: 76px;
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  z-index: 100;
}
.mob-item {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 8px; gap: 2px;
  height: 60px; border-radius: 6px;
  font-family: 'Inter'; font-weight: 400; font-size: 12px; line-height: 18px;
  color: var(--text-nav); cursor: pointer; flex-shrink: 0;
  transition: background var(--tr);
}
.mob-item svg { width: 24px; height: 24px; }
.mob-item.active { background: var(--brand-light); }
.mob-item.active svg { color: var(--brand); }
.mob-item.active span { color: var(--brand); }

/* FAB: 40×40, #165AD9 */
.mob-fab {
  width: 40px; height: 40px;
  background: var(--brand); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-fab);
  cursor: pointer; transition: background var(--tr);
  text-decoration: none; flex-shrink: 0;
}
.mob-fab:hover { background: #1149b0; }
.mob-fab svg { width: 24px; height: 24px; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .masonry { column-count: 3; }
}

@media (max-width: 768px) {
  .sb, .sb-chevron { display: none; }
  .main { margin-left: 0 !important; padding-bottom: 76px; }
  .mob-nav { display: flex; }
  .topbar { padding: 4px 16px; gap: 12px; height: 48px; }
  .page-title { font-size: 18px; line-height: 28px; }
  .btn-back { width: 32px; height: 32px; }
  .search-box { display: none; }
  .filter-bar { padding: 16px 16px; }
  .grid-wrap { padding: 10px 16px 16px; }
  .masonry { column-count: 2; column-gap: 6px; }
  .card { margin-bottom: 6px; }
  .modal { flex-direction: column; max-height: 92vh; }
  .m-media { width: 100%; max-height: 43vh; }
  .m-info { padding: 18px; }
  .m-title { font-size: 17px; }
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ---- Mobile sub-nav buttons (inside bottom nav) ---- */
.mob-sub-btn {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  height: 60px;
  border-radius: 6px;
  font-family: 'Inter'; font-weight: 400; font-size: 10px; line-height: 1.3;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  background: none;
  border: none;
  transition: background var(--tr), color var(--tr);
}
.mob-sub-btn svg { flex-shrink: 0; }
.mob-sub-btn:hover { background: rgba(0,0,0,0.04); color: var(--text-nav); }
.mob-sub-btn.active { background: var(--brand-light); color: var(--brand); }
.mob-sub-btn.active svg { stroke: var(--brand); }

/* Ads icon item in mobile nav */
.mob-insp {
  color: var(--text-muted);
  flex-direction: row;
  gap: 2px;
  font-size: 10px;
  padding: 6px 8px;
}
.mob-insp.active { color: var(--brand); }
.mob-insp svg { color: currentColor; }

/* Mobile nav: allow wrapping when there are more items */
.mob-nav {
  gap: 4px;
  padding: 8px 10px;
}

/* badge-dur: duration only, no ratio */
.badge-dur {
  position: absolute; top: 8px; left: 8px;
  display: flex; gap: 4px;
}

/* ---- Hover video on card ---- */
.card-hover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  display: block;
  border-radius: 4px;
}
/* Keep card-img-wrap relative so video can be positioned inside */
.card-img-wrap { position: relative; }

/* ---- Modal video player ---- */
.modal-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 5;
  display: block;
}
