/* Client delivery portal — IG main-feed style: full-width project cards with carousels. */

:root {
  --bg: #000;
  --surface: #121212;
  --surface-2: #1a1a1a;
  --border: #262626;
  --text: #fafafa;
  --muted: #a8a8a8;
  --link: #e0f1ff;
  --ig-blue: #0095f6;
  --ig-red: #ed4956;
  --ig-gradient: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  --accent: #0095f6;
  --col-w: 480px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }

/* ======== Top nav ======== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  padding-block: 10px;
  padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
  max-width: var(--col-w);
  margin-inline: auto;
}
.brand {
  font-weight: 800;
  letter-spacing: -0.025em;
  font-size: 15px;
  color: var(--text);
  text-align: center;
  text-decoration: none;
}
.nav-utility,
.nav-home {
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}
.nav-utility {
  justify-self: end;
  color: var(--ig-red);
}
.nav-home {
  justify-self: start;
  color: var(--muted);
}
.nav-home:hover { color: var(--text); }
.nav-spacer { width: 36px; }
.col {
  width: 100%;
  max-width: var(--col-w);
  margin-inline: auto;
}

/* ======== Profile header ======== */
.profile { padding: 24px 16px 12px; }
.profile-top {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
}
.avatar-wrap {
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  padding: 3px;
}
.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 36px;
  color: var(--accent);
  overflow: hidden;
  border: 3px solid #000;
  box-sizing: content-box;
}
.profile-stats {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}
.profile-stats .num { display: block; font-weight: 800; font-size: 18px; line-height: 1.1; }
.profile-stats .label { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.profile-meta { margin-bottom: 12px; }
.profile-meta .display-name { font-weight: 800; font-size: 14px; }
.profile-meta .pronoun { color: var(--muted); font-size: 12px; font-weight: 500; margin-left: 6px; }
.profile-meta .bio { font-size: 14px; line-height: 1.5; margin: 6px 0 0; }
.profile-meta .bio strong { font-weight: 800; color: var(--text); }
.profile-meta .bio .bio-headline { display: block; font-weight: 900; color: var(--text); letter-spacing: -0.015em; margin-bottom: 4px; }
.profile-meta .bio .bio-accent-word { color: var(--text); font-style: italic; }
.profile-meta .bio .tag { color: var(--accent); font-weight: 700; }
.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 0 4px;
}
.profile-actions .pa-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.profile-actions .pa-btn.secondary { background: var(--surface-2); color: var(--text); }
.profile-actions .pa-btn:hover { filter: brightness(1.1); }

/* ======== Tabs ======== */
.tabs {
  display: flex;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tabs .tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-top: 1px solid transparent;
  margin-top: -1px;
  font-family: inherit;
}
.tabs .tab.active { color: var(--text); border-top-color: var(--text); }

/* ======== IG-style feed: stack of project cards ======== */
.feed {
  padding: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* One project = one IG-style "post" */
.project-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-radius: 0;
  padding-bottom: 8px;
}
.project-card:last-of-type {
  border-bottom: none;
}
.project-card.draft-card {
  background: linear-gradient(180deg, rgba(245,158,11,.08), rgba(0,0,0,0) 180px), transparent;
  border-bottom-color: rgba(245,158,11,.26);
}
.project-card .card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}
.project-card .card-head .pico {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  clip-path: circle(50% at 50% 50%);
}
.project-card .card-head .pico-inner,
.project-card .card-head .poster-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface);
}
.project-card .card-head .pico-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
}
.pico-photo[style*="/logos/"],
.icon-logo[style*="/logos/"],
.avatar[style*="/logos/"] {
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: #f4f4f4 !important;
}
.project-card .card-head .pico-inner.pico-photo {
  background-size: cover;
  background-position: center top;
}
.project-card .card-head .meta { flex: 1; min-width: 0; }
.project-card .card-head .title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-card .card-head .sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.project-card .card-head .meta-line {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Carousel — horizontal scroll-snap, full-width slides */
.carousel-wrap { position: relative; background: #000; }
.carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel-prev, .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-wrap:hover .carousel-prev,
.carousel-wrap:hover .carousel-next { opacity: 1; }
@media (hover: none) {
  .carousel-prev, .carousel-next { display: none; }
}
.slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: 1 / 1;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.slide video,
.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.slide .video-thumb {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: #000;
  position: relative;
  cursor: pointer;
  display: block;
}
.slide .video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.slide .play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.62);
  color: #fff;
  border: 1px solid rgba(255,255,255,.26);
  font-size: 24px;
  line-height: 1;
  padding-left: 3px;
  backdrop-filter: blur(8px);
}
.slide .icon-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}
.slide .icon-wrap .icon-logo {
  max-width: 58%;
  max-height: 28%;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.45));
}
.slide .icon-wrap.audio {
  background: radial-gradient(circle at center, rgba(245,158,11,.16), rgba(0,0,0,0) 58%), #050505;
}
.slide .icon-wrap .glyph { font-size: 56px; }
.slide .icon-wrap.audio .glyph { color: var(--accent); }
.slide .icon-wrap .ext {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}
.slide .badge-new,
.slide .badge-draft {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 2;
}
.slide .badge-new { background: var(--ig-red); }
.slide .badge-draft { background: rgba(245,158,11,.94); color: #111; }
.slide .slide-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 2;
}
.slide .download-pill {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255,255,255,0.95);
  color: #000;
  font-weight: 800;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.slide .download-pill:hover { background: #fff; }
.slide .draft-approval {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
  max-width: calc(100% - 110px);
  flex-wrap: wrap;
}
.slide .draft-choice {
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(0,0,0,.62);
  color: #fff;
  border-radius: 999px;
  padding: 6px 9px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.slide .draft-choice.selected.approved { background: #16a34a; }
.slide .draft-choice.selected.denied { background: #dc2626; }
.slide .draft-status {
  color: #fff;
  background: rgba(0,0,0,.58);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.slide .draft-status.approved { color: #86efac; }
.slide .draft-status.denied { color: #fca5a5; }
.slide .open-modal-pill {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  z-index: 2;
  font-family: inherit;
  font-weight: 700;
}

/* Dot indicator below carousel */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 6px;
}
.carousel-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: background 200ms;
}
.carousel-dots .dot.active { background: var(--accent); }

/* Card actions row (matches IG's heart/comment/share row) */
.card-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 16px 8px;
}
.card-actions .icon-btn {
  background: none;
  border: 0;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  font-family: inherit;
}
.card-actions .icon-btn:hover { color: var(--accent); }
.card-actions .spacer { flex: 1; }

/* Instagram-post-style footer on each day-post card */
.ig-foot {
  padding: 8px 14px 14px;
}
.ig-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 2px 0 8px;
}
.ig-icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ig-icon-right {
  margin-left: auto;
}
.ig-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.ig-caption {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  word-break: break-word;
}
.ig-caption strong {
  font-weight: 700;
  margin-right: 5px;
}
.ig-time {
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ======== Feed pagination ======== */
.load-more-wrap {
  padding: 8px 16px 20px;
  display: grid;
  gap: 8px;
  text-align: center;
}
.load-more {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.load-more:hover { border-color: var(--accent); filter: brightness(1.08); }
.load-more-note,
.caught-up {
  color: var(--muted);
  font-size: 12px;
}
.caught-up {
  padding: 10px 16px 24px;
  text-align: center;
}

/* ======== Empty state ======== */
.empty {
  padding: 80px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.empty .big { font-size: 56px; margin-bottom: 4px; }

/* ======== Modal ======== */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.96);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-bg.open { display: flex; }
.modal {
  width: 100%;
  max-width: 540px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.modal header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  padding-right: 12px;
}
.modal-close {
  background: none;
  border: 0;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.modal-body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 200px;
  max-height: 70vh;
  position: relative;
}

/* in-modal prev/next overlay arrows */
.clip-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s, opacity 0.15s;
}
.clip-nav:hover:not(:disabled) { background: var(--accent); }
.clip-nav:disabled { opacity: 0.25; cursor: default; }
.clip-nav.prev { left: 10px; }
.clip-nav.next { right: 10px; }

/* prev / counter / autoplay / next bar under the video */
.clip-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.clip-step {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.clip-step:hover:not(:disabled) { filter: brightness(1.15); }
.clip-step:disabled { opacity: 0.35; cursor: default; }
.clip-counter {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.autoplay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.autoplay-toggle input { accent-color: var(--accent); cursor: pointer; }
.modal-body video,
.modal-body img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
}
.ios-save-help {
  margin: 0;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.ios-save-help strong { color: var(--text); }
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--border);
}
.modal-actions.has-open { grid-template-columns: 1fr 1fr 1fr; }
.modal-actions .btn {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.modal-actions .btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.modal-actions .btn:hover { filter: brightness(1.1); }

/* ======== Footer ======== */
.footer {
  padding: 24px 16px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}
.footer .brand-mini { font-weight: 700; color: var(--text); letter-spacing: -0.01em; }

/* ======== Loading spinner ======== */
.feed-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 64px 0;
}
.feed-spinner::after {
  content: '';
  width: 36px;
  height: 36px;
  border: 3px solid var(--surface);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: feed-spin 0.7s linear infinite;
}
@keyframes feed-spin { to { transform: rotate(360deg); } }

/* ======== Client badge pill ======== */
.client-badge-pill {
  background: #1a1a2e;
  border: 1px solid #2d2d4e;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #818cf8;
  margin-left: 6px;
}

/* ======== View status ======== */
.view-seen  { color: #22c55e; font-size: 11px; }
.view-unseen { color: #4b5563; font-size: 11px; }

@media (min-width: 900px) {
  :root { --col-w: 540px; }
  .avatar { width: 110px; height: 110px; font-size: 44px; }
  .profile-top { gap: 32px; }
}

@media (max-width: 420px) {
  .modal-actions.has-open { grid-template-columns: 1fr; }
}

/* ======== Nav search ======== */
.nav-search {
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #fafafa;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: -0.02em;
  text-align: center;
  width: 200px;
  outline: none;
  padding: 4px 8px;
  transition: background 0.15s;
  cursor: text;
  -webkit-appearance: none;
  justify-self: center;
}
.nav-search::placeholder {
  color: #fafafa;
  opacity: 1;
}
.nav-search:focus {
  background: rgba(255,255,255,0.09);
  cursor: text;
}
.nav-search::-webkit-search-cancel-button { -webkit-appearance: none; }
@media (max-width: 380px) { .nav-search { width: 130px; font-size: 13px; } }

/* ======== Owner feed approval + draft indicators ======== */
.badge-approval { position:absolute; bottom:10px; left:10px; font-size:10px; font-weight:800; border-radius:999px; padding:2px 7px; pointer-events:none; z-index:5; }
.badge-approval.approved { background:rgba(34,197,94,0.2); color:#22c55e; border:1px solid rgba(34,197,94,0.3); }
.badge-approval.denied { background:rgba(239,68,68,0.2); color:#ef4444; border:1px solid rgba(239,68,68,0.3); }
.card-draft-indicator { display:inline-block; font-size:10px; font-weight:700; color:#f59e0b; background:rgba(245,158,11,0.12); border:1px solid rgba(245,158,11,0.25); border-radius:999px; padding:2px 8px; margin-top:3px; }

/* Owner-only overlays */
.client-badge-pill { display:inline-block; font-size:10px; font-weight:800; padding:2px 8px; border-radius:999px; background:rgba(245,158,11,0.18); color:#f59e0b; text-decoration:none; margin-left:6px; vertical-align:middle; }
.client-badge-pill:hover { background:rgba(245,158,11,0.28); }
.view-indicator { font-size:11px; font-weight:600; margin-top:4px; }
.view-seen { color:#22c55e; }
.view-unseen { color:#a8a8a8; }
.card-draft-indicator { font-size:11px; font-weight:700; color:#f59e0b; margin-top:4px; letter-spacing:0.04em; }
.owner-approval-status { position:absolute; top:10px; left:10px; font-size:10px; font-weight:800; padding:3px 8px; border-radius:999px; z-index:5; }
.owner-approval-status.approved { background:rgba(34,197,94,0.18); color:#22c55e; }
.owner-approval-status.denied { background:rgba(237,73,86,0.18); color:#ed4956; }

/* ======== MakeBoringIllegal — anchored speech-bubble popover ======== */
.tag.mbi-trigger { cursor: pointer; text-decoration: none; }
.tag.mbi-trigger:hover { filter: brightness(1.2); text-decoration: underline; }
.mbi-popover {
  position: absolute;
  z-index: 9999;
  max-width: 220px;
  pointer-events: none;
  animation: mbi-pop-in .26s cubic-bezier(.34,1.56,.64,1);
  transform-origin: top left;
}
.mbi-popover-inner {
  position: relative;
  background: var(--surface-2, #1a1a1a);
  color: #fff;
  border: 1px solid var(--border, #262626);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  pointer-events: auto;
}
.mbi-popover-inner p { margin: 0; }
.mbi-popover-tail {
  position: absolute;
  top: -7px;
  left: 18px;
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid var(--surface-2, #1a1a1a);
}
.mbi-popover.exit { animation: mbi-pop-out .14s ease-out forwards; }
@keyframes mbi-pop-in {
  0% { opacity: 0; transform: translateY(-4px) scale(.6); }
  70% { opacity: 1; transform: translateY(2px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes mbi-pop-out {
  to { opacity: 0; transform: scale(.85); }
}

/* ======== Level 1: shoot-day selector cards ======== */
.day-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.day-card:last-of-type { border-bottom: none; }
.day-card:hover,
.day-card:focus-visible { background: var(--surface); outline: none; }
.day-card:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.day-cover {
  position: relative;
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.day-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.day-cover-count {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}
.day-badge-new {
  position: absolute;
  top: 5px;
  left: 5px;
}
.day-info { flex: 1; min-width: 0; }
.day-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.day-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.day-chevron {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
}

/* ======== Level 2: mini gallery grid ======== */
.gallery-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  /* stick just below the 48px sticky nav so the "‹ Days" back control
     stays visible the whole time the grid is scrolled */
  position: sticky;
  top: 48px;
  z-index: 40;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.gallery-back {
  flex-shrink: 0;
  background: var(--accent);
  color: #05202e;
  border-radius: 999px;
  padding: 9px 18px;
  font-family: inherit;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid #fff;
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.45);
}
.gallery-back:hover { filter: brightness(1.08); }
.gallery-head-meta { flex: 1; min-width: 0; }
.gallery-title {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.grid-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px 0 24px;
}
.grid-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #000;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  overflow: hidden;
}
.grid-tile img,
.grid-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* poster jpg and preview video stack in the same cell; video fades in over the
   poster once it actually plays, so a failed/loading preview never shows black */
.grid-tile .tile-poster,
.grid-tile .tile-video {
  position: absolute;
  inset: 0;
}
.grid-tile .tile-video {
  opacity: 0;
  transition: opacity .25s ease;
  background: transparent;
}
.grid-tile .tile-video.is-playing { opacity: 1; }
.grid-tile:hover img,
.grid-tile:hover video { filter: brightness(1.12); }
.grid-play {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  padding-left: 2px;
  border: 1px solid rgba(255,255,255,0.22);
}
.grid-badge-new {
  position: absolute;
  top: 6px;
  left: 6px;
}
@media (min-width: 640px) {
  .grid-gallery { gap: 4px; }
}

/* ======== Clips gallery additions (live NAS scan UI) ======== */
.nav-utility.refresh {
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.nav-utility.refresh.spinning { opacity: 0.5; }
.profile-stats .num.live { color: #22c55e; }
.profile-stats .num.off  { color: var(--ig-red); }

/* ── Level-1 day posts: large IG-style cover thumbnail ───────────────── */
.day-post { cursor: pointer; }
.day-post:hover { background: var(--surface-2, #1a1a1a); }
.day-cover-lg {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  overflow: hidden;
}
.day-cover-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.day-cover-lg .play-badge {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.day-cover-lg .badge-new {
  position: absolute;
  top: 10px; left: 10px;
}

/* ===== paywall ===== */
.paywall-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 12px 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1c1c22, #111114);
  border: 1px solid #2c2c34;
}
.paywall-bar-text { font-size: 13px; line-height: 1.45; color: #d8d8de; }
.paywall-bar-text strong { display: block; color: #fff; margin-bottom: 2px; }
.paywall-bar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.unlock-btn {
  background: #00c853;
  color: #062b13;
  font-weight: 800;
  border: none;
  white-space: nowrap;
}
.unlock-btn:hover { background: #1de070; }
.paywall-code-link {
  font-size: 12px;
  color: var(--muted, #9a9aa2);
  text-decoration: underline;
  cursor: pointer;
}
.grid-lock {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 26px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.6));
}
.grid-tile:has(.grid-lock) img,
.grid-tile:has(.grid-lock) video { filter: brightness(.62); }

.pay-modal .modal-body, .code-modal .modal-body {
  display: block;            /* override flex-row so blurb + form stack, not side-by-side */
  padding: 16px;
  background: var(--bg);     /* not pure black behind Stripe's light form */
  max-height: 82vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.pay-blurb { font-size: 13px; line-height: 1.5; color: #c8c8ce; margin: 0 0 12px; }
.pay-error {
  background: #3a1216;
  border: 1px solid #6a2128;
  color: #ffb4b4;
  font-size: 12.5px;
  padding: 9px 12px;
  border-radius: 9px;
  margin: 8px 0;
}
#stripe-checkout { min-height: 220px; width: 100%; max-width: 100%; overflow: hidden; }
/* inline access-code entry inside the pay modal — always visible */
.pay-code { margin-top: 14px; }
.pay-code-or {
  display: flex;
  align-items: center;
  text-align: center;
  color: #8a8a92;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 4px 0 8px;
}
.pay-code-or::before,
.pay-code-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #2a2a30;
}
.pay-code-or span { padding: 0 10px; }
.pay-code-row { display: flex; gap: 8px; align-items: center; }
.pay-code-row .code-input { flex: 1; margin: 0; }
.pay-code-row .btn { white-space: nowrap; flex: 0 0 auto; }
.code-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 10px;
  border: 1px solid #34343c;
  background: #16161a;
  color: #fff;
  margin: 6px 0;
}
