/* ============================================
   ACTGRAM — Create / Upload Module (Mobile)
   Unified layout for all create & upload flows
   ============================================ */

/* Base shell — applies at ALL viewport widths (desktop included).
   The @media (max-width: 767px) block below still applies mobile-only
   layout refinements (single-column grids, sticky footer tweaks, etc.)
   on top of this. Without this base layer, the .ag-create-* screens
   (Upload Portfolio, Create Casting Call, Create Talent Reel, etc.)
   render completely unstyled on desktop. */
:root {
  --ag-create-safe-top: calc(12px + env(safe-area-inset-top, 0px));
  --ag-create-pad-x: 16px;
  --ag-create-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.ag-create-page {
  background: #F8FAFC;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'DM Sans', sans-serif;
  padding-bottom: var(--ag-create-bottom);
  box-sizing: border-box;
}

.ag-create-appbar {
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  padding: var(--ag-create-safe-top) var(--ag-create-pad-x) 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #F1F5F9;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 50;
}

.ag-create-appbar-start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.ag-create-back-btn {
  background: #F1F5F9;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  flex-shrink: 0;
}

.ag-create-title {
  font-size: 17px;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ag-create-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.ag-create-body {
  padding: 16px var(--ag-create-pad-x);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.ag-create-card {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #F1F5F9;
  box-sizing: border-box;
}

.ag-create-card-label {
  font-size: 11px;
  font-weight: 800;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0 0 12px;
}

.ag-create-field {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  background: #fff;
}

.ag-create-field:focus {
  border-color: var(--brand-cyan, #00AEEF);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.1);
}

.ag-thought-textarea {
  min-height: 160px;
  resize: none;
  line-height: 1.6;
}
.ag-thought-textarea:focus {
  border-color: var(--brand-cyan, #00AEEF);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.1);
}
.ag-thought-counter-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.ag-thought-counter {
  font-size: 12px;
  font-weight: 700;
  color: #94A3B8;
}
.ag-thought-counter--warn {
  color: #D97706;
}
.ag-thought-counter--limit {
  color: #DC2626;
}

.ag-create-submit {
  width: 100%;
  padding: 15px 16px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  min-height: 48px;
  box-sizing: border-box;
}

.ag-create-submit-primary {
  background: var(--gradient-premium, #00AEEF);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 35, 71, 0.28);
}

.ag-create-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ag-create-sticky-footer {
  position: sticky;
  bottom: 0;
  z-index: 40;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, #F8FAFC 70%, rgba(248, 250, 252, 0));
}

#portfolio-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 767px) {
  :root {
    --ag-create-safe-top: calc(12px + env(safe-area-inset-top, 0px));
    --ag-create-pad-x: 16px;
    --ag-create-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* ---- Shared create screen shell ---- */
  .ag-create-page {
    background: #F8FAFC !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    font-family: 'DM Sans', sans-serif;
    padding-bottom: var(--ag-create-bottom) !important;
    box-sizing: border-box;
  }

  .ag-create-appbar {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: var(--ag-create-safe-top) var(--ag-create-pad-x) 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px;
    border-bottom: 1px solid #F1F5F9 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
  }

  .ag-create-appbar-start {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  .ag-create-back-btn {
    background: #F1F5F9 !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    color: #475569;
    flex-shrink: 0;
  }

  .ag-create-title {
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    margin: 0 !important;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ag-create-badge {
    font-size: 9px !important;
    font-weight: 800 !important;
    padding: 5px 10px !important;
    border-radius: 99px !important;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.4px;
    text-transform: uppercase;
  }

  .ag-create-body {
    padding: 16px var(--ag-create-pad-x) !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .ag-create-card {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #F1F5F9;
    box-sizing: border-box;
  }

  .ag-create-card-label {
    font-size: 11px;
    font-weight: 800;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 12px;
  }

  .ag-create-field {
    width: 100% !important;
    padding: 12px 14px !important;
    border: 1.5px solid #E2E8F0 !important;
    border-radius: 12px !important;
    font-size: 16px !important; /* prevents iOS zoom */
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    background: #fff;
  }

  .ag-create-field:focus {
    border-color: var(--brand-cyan, #00AEEF) !important;
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.1);
  }

  .ag-create-submit {
    width: 100%;
    padding: 15px 16px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    min-height: 48px;
    box-sizing: border-box;
  }

  .ag-create-submit-primary {
    background: var(--gradient-premium, #00AEEF);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 35, 71, 0.28);
  }

  .ag-create-grid-2 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Sticky bottom CTA bar (optional wrapper) */
  .ag-create-sticky-footer {
    position: sticky;
    bottom: 0;
    z-index: 40;
    padding: 12px var(--ag-create-pad-x) calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, #F8FAFC 70%, rgba(248, 250, 252, 0));
    margin: 0 calc(var(--ag-create-pad-x) * -1);
  }

  /* ---- Create Talent Reel ---- */
  #create-talent-reel.active-screen {
    background: #F8FAFC !important;
  }

  #create-talent-reel .ctr-page {
    /* Extra space so sticky Publish does not cover the last category rows */
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #create-talent-reel .ctr-appbar {
    padding: var(--ag-create-safe-top) var(--ag-create-pad-x) 12px !important;
    flex-wrap: nowrap;
    gap: 8px;
  }

  #create-talent-reel .ctr-progress-dots {
    display: flex !important;
    max-width: 120px !important;
  }

  #create-talent-reel .ctr-step-counter {
    display: none !important;
  }

  #create-talent-reel .ctr-mode-pill span {
    display: none;
  }

  #create-talent-reel .ctr-mode-pill {
    padding: 7px !important;
  }

  #create-talent-reel .ctr-appbar-title {
    font-size: 16px !important;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #create-talent-reel .ctr-appbar-sub {
    display: none;
  }

  #create-talent-reel .ctr-body {
    padding: 16px var(--ag-create-pad-x) !important;
    gap: 18px !important;
  }

  #create-talent-reel .ctr-right {
    width: 100% !important;
    padding-bottom: 12px !important;
  }

  /* Wizard panes already keep preview + form on separate steps, so do NOT
     dissolve .ctr-left with display:contents — that broke the step layout. */
  #create-talent-reel .ctr-left {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
  }

  /* ── Sticky compact preview (Instagram/TikTok-style) ──────────────────────
     On mobile the columns stack, so the preview was scrolled off-screen the
     moment the user reached the filter chips / form below it. Pinning the
     preview keeps it visible while editing, so tapping a Visual Filter chip
     shows the effect in place — no scroll-back-to-top. Desktop already pins
     the whole .ctr-left (see the min-width:1024px rule); this brings the same
     behaviour to mobile, scoped to the reel screen only.

     Kept intentionally simple to avoid disturbing the card's internal
     absolutely-positioned overlays (upload prompt, bottom controls, aspect
     tag): we only change the CARD box — a compact, centered, height-capped
     9:16 card that is OPAQUE (solid background) so the form scrolls cleanly
     under it instead of showing through. The card sits inside a full-width
     opaque "rail" (::before) so nothing peeks past its sides. */
  #create-talent-reel .ctr-preview-card {
    /* Scroll with the page — sticky preview was floating over filters/category. */
    position: relative !important;
    top: auto !important;
    z-index: 1 !important;

    /* True 9:16 phone card — fill the frame (no black letterbox bars). */
    width: min(72vw, 280px) !important;
    max-width: 280px !important;
    margin: 0 auto 12px !important;
    box-sizing: border-box !important;

    aspect-ratio: 9 / 16 !important;
    height: auto !important;
    max-height: min(52vh, 440px) !important;
    overflow: hidden !important;

    background: #E8F7FD !important;
    border: 1px solid rgba(0, 174, 239, 0.2) !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 22px rgba(0, 174, 239, 0.14) !important;
  }

  /* Cover-fill so the reel uses the whole card (Instagram-style). */
  #create-talent-reel .ctr-preview-card video {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
  }
  /* The upload prompt overlay keeps filling the band (inset:0 already); just
     ensure it stays opaque enough over the dark backdrop for legibility. */
  #create-talent-reel .ctr-preview-card .ctr-upload-overlay {
    background: rgba(232, 247, 253, 0.96) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  /* Category picker — all roles (actor / production / makeup / photographer /
     celebrity). Same card chrome; compact 2-col + internal scroll so long
     category lists don't force huge page scrolling. */
  #create-talent-reel .ctr-cat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    max-height: min(38vh, 280px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 2px 2px 4px;
    margin: 0 -2px;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
  }

  #create-talent-reel .ctr-cat-grid::-webkit-scrollbar {
    width: 4px;
  }

  #create-talent-reel .ctr-cat-grid::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 99px;
  }

  #create-talent-reel .ctr-cat-tip {
    padding: 8px 10px !important;
    gap: 6px !important;
  }

  #create-talent-reel .ctr-cat-tip-text {
    font-size: 11px !important;
    line-height: 1.4 !important;
  }

  #create-talent-reel .ctr-cat-card {
    padding: 10px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: space-between !important;
    gap: 8px !important;
    min-height: 0 !important;
  }

  #create-talent-reel .ctr-cat-card:hover {
    transform: none !important;
  }

  #create-talent-reel .ctr-cat-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    width: 100% !important;
  }

  #create-talent-reel .ctr-cat-icon {
    width: 30px !important;
    height: 30px !important;
    border-radius: 9px !important;
  }

  #create-talent-reel .ctr-cat-icon i {
    font-size: 15px !important;
  }

  #create-talent-reel .ctr-cat-check {
    position: static !important;
    top: auto !important;
    right: auto !important;
    flex-shrink: 0;
  }

  #create-talent-reel .ctr-cat-check > div {
    width: 18px !important;
    height: 18px !important;
  }

  #create-talent-reel .ctr-cat-check i {
    font-size: 10px !important;
  }

  #create-talent-reel .ctr-cat-body {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding-right: 0 !important;
    text-align: left !important;
  }

  #create-talent-reel .ctr-cat-title {
    font-size: 12.5px !important;
    line-height: 1.2 !important;
    margin-bottom: 2px !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #create-talent-reel .ctr-cat-desc {
    font-size: 10.5px !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #create-talent-reel .ctr-cat-meta {
    font-size: 9px !important;
    letter-spacing: 0.3px !important;
  }

  #create-talent-reel .ctr-form-card {
    padding: 16px !important;
    border-radius: 18px !important;
  }

  #create-talent-reel .ctr-setting-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  #create-talent-reel .ctr-textarea,
  #create-talent-reel .ctr-input,
  #create-talent-reel .ctr-select {
    font-size: 16px !important;
  }

  #create-talent-reel .ctr-publish-btn {
    position: sticky;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    margin-top: 4px;
    min-height: 50px;
  }

  #create-talent-reel .no-scrollbar {
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  /* ---- Spotlight / Director add-media ---- */
  #add-media.active-screen {
    background: #F8FAFC !important;
  }

  #add-media .actor-media-grid,
  #add-media .director-media-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding: 16px var(--ag-create-pad-x) !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  #add-media .photo-edit-preview-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 18px !important;
  }

  #add-media .dir-upload-area {
    aspect-ratio: 4 / 5 !important;
    border-radius: 18px !important;
  }

  #add-media [style*="padding:54px"] {
    padding-top: var(--ag-create-safe-top) !important;
    padding-left: var(--ag-create-pad-x) !important;
    padding-right: var(--ag-create-pad-x) !important;
    padding-bottom: 12px !important;
  }

  #add-media [style*="font-size:10px;font-weight:800"][style*="text-transform:uppercase"] {
    font-size: 9px !important;
    padding: 5px 8px !important;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #add-media .ratio-btn {
    padding: 10px 6px !important;
    font-size: 11px !important;
  }

  #add-media button[onclick*="publishActorSpotlight"],
  #add-media button[onclick*="publishDirectorMedia"] {
    position: sticky;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    min-height: 50px;
    margin-top: 8px;
  }

  /* ---- Upload Portfolio ---- */
  #upload-portfolio.active-screen {
    background: #F8FAFC !important;
  }

  #upload-portfolio .ag-create-page,
  #upload-portfolio > div {
    padding-bottom: var(--ag-create-bottom) !important;
  }

  #portfolio-photo-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* ---- Create Casting Call ---- */
  #create-casting-call.active-screen {
    background: #F8FAFC !important;
  }

  #create-casting-call [style*="padding:54px"] {
    padding-top: var(--ag-create-safe-top) !important;
    padding-left: var(--ag-create-pad-x) !important;
    padding-right: var(--ag-create-pad-x) !important;
    padding-bottom: 12px !important;
  }

  #create-casting-call [style*="padding:16px;display:flex"] {
    padding: 16px var(--ag-create-pad-x) var(--ag-create-bottom) !important;
  }

  #create-casting-call [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  #create-casting-call button[onclick*="publishCastingCallDraft"],
  #create-casting-call button[onclick*="Router.go('publish-success')"] {
    min-height: 50px;
  }

  #create-casting-call .ag-casting-poster-row {
    flex-wrap: wrap;
  }

  #create-casting-call .ag-casting-poster-upload-btn {
    min-height: 40px;
    width: 100%;
    margin-top: 4px;
  }

  #create-casting-call .ag-create-sticky-footer .ag-create-submit {
    min-height: 50px;
  }

  /* ---- Preview Casting Call ---- */
  #preview-post.active-screen {
    background: #F8FAFC !important;
  }

  #preview-post .ag-create-page {
    padding-bottom: var(--ag-create-bottom) !important;
  }

  #preview-post .ag-casting-verified-badge {
    font-size: 9px !important;
    padding: 4px 6px !important;
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #preview-post [style*="height:240px"] {
    height: min(52vw, 240px) !important;
  }

  #preview-post .ag-create-sticky-footer {
    flex-direction: column;
  }

  @media (min-width: 400px) {
    #preview-post .ag-create-sticky-footer {
      flex-direction: row;
    }
  }

  #preview-post .ag-create-sticky-footer .ag-create-submit {
    min-height: 50px;
  }

  /* ---- Add Media form fields (director + actor) ---- */
  #add-media input,
  #add-media textarea,
  #add-media select {
    font-size: 16px !important;
  }

  #add-media .ag-create-page {
    padding-bottom: var(--ag-create-bottom) !important;
  }

  #add-media .option-row-dark {
    padding: 14px !important;
  }

  /* ---- Publish Success ---- */
  /* Light frosted-blue brand background (matches the rest of the site). Was
     previously near-black (#090D16); redesigned to the brand light theme. */
  #publish-success.active-screen {
    background: linear-gradient(165deg, #F0FAFF 0%, #E8F7FD 45%, #F8FCFF 100%) !important;
    overflow-y: auto !important;
  }

  #publish-success .success-bg {
    min-height: 100dvh !important;
    padding: calc(var(--ag-create-safe-top) + 8px) var(--ag-create-pad-x) var(--ag-create-bottom) !important;
    justify-content: flex-start !important;
    padding-top: calc(var(--ag-create-safe-top) + 24px) !important;
  }

  #publish-success .success-card {
    max-width: 100% !important;
    border-radius: 24px !important;
    padding: 24px 18px !important;
  }

  #publish-success .share-circle-btn {
    width: 48px !important;
    height: 48px !important;
  }

  #publish-success .preview-box {
    flex-direction: row;
    align-items: center;
  }

  /* ---- Industry News Publish ---- */
  #publish-industry-news.active-screen {
    background: #F8FAFC !important;
  }

  #publish-industry-news > div > div:first-child {
    padding-top: var(--ag-create-safe-top) !important;
  }

  #publish-industry-news [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  #publish-industry-news #news-publish-btn {
    min-height: 50px;
    position: sticky;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
  }

  /* ---- Story Upload (creator) ---- */
  #story-upload.active-screen {
    z-index: 3000 !important;
  }

  #story-upload .ig-story-creator-toolbar,
  #story-upload .ig-story-top-bar {
    padding-top: env(safe-area-inset-top, 0px);
  }

  #story-upload .ig-story-bottom-bar {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ---- Create bottom sheets ---- */
  .bottom-sheet .premium-sheet-wrapper,
  .bottom-sheet .director-sheet-wrapper {
    margin: 0 !important;
    padding: 8px 12px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 24px 24px 0 0 !important;
    max-height: min(88dvh, 720px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bottom-sheet .director-sheet-wrapper {
    padding-top: 12px !important;
  }

  .bottom-sheet .premium-grid,
  .bottom-sheet .director-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .bottom-sheet .premium-card[style*="grid-column:1/-1"] {
    grid-column: 1 / -1 !important;
  }

  .bottom-sheet .premium-card,
  .bottom-sheet .director-card {
    padding: 16px 10px !important;
    border-radius: 16px !important;
    min-height: 118px;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-sheet .premium-card:active,
  .bottom-sheet .director-card:active {
    transform: scale(0.98);
  }

  .bottom-sheet .premium-icon-box,
  .bottom-sheet .director-icon-box {
    width: 44px !important;
    height: 44px !important;
    margin-bottom: 10px !important;
  }

  .bottom-sheet .premium-card-title,
  .bottom-sheet .director-card-title {
    font-size: 12.5px !important;
    line-height: 1.25;
  }

  .bottom-sheet .premium-card-desc,
  .bottom-sheet .director-card-desc {
    font-size: 10px !important;
    line-height: 1.35;
  }

  .bottom-sheet .premium-sheet-title,
  .bottom-sheet .director-sheet-title {
    font-size: 17px !important;
  }

  .bottom-sheet .director-sheet-close,
  .bottom-sheet .premium-sheet-close {
    width: 36px !important;
    height: 36px !important;
  }
}

@media (max-width: 380px) {
  #create-talent-reel .ctr-cat-grid {
    gap: 6px !important;
    max-height: min(36vh, 250px);
  }

  #create-talent-reel .ctr-cat-card {
    padding: 8px !important;
    gap: 6px !important;
  }

  #create-talent-reel .ctr-cat-icon {
    width: 28px !important;
    height: 28px !important;
  }

  #create-talent-reel .ctr-cat-title {
    font-size: 12px !important;
  }

  /* Extra-narrow phones: hide desc to keep tiles short */
  #create-talent-reel .ctr-cat-desc {
    display: none !important;
  }

  #create-talent-reel .ctr-cat-meta {
    font-size: 8.5px !important;
  }

  #portfolio-photo-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .bottom-sheet .premium-card-title,
  .bottom-sheet .director-card-title {
    font-size: 11.5px !important;
  }
}

/* ============================================================================
   DESKTOP LAYOUT for the shared create screens (director/recruiter + talent).
   On mobile these are a single narrow column; on desktop they were still only
   560px wide, floating off-centre in the wide content area. This widens the
   body and lays the form out to actually use desktop width.
   Covers: create-casting-post, create-casting-call, add-media,
   upload-portfolio, preview-post — all use the .ag-create-* shell.
   ============================================================================ */
@media (min-width: 768px) {
  /* App bar content lines up with the wider body. */
  .ag-create-appbar {
    padding-left: max(24px, calc((100% - 1000px) / 2)) !important;
    padding-right: max(24px, calc((100% - 1000px) / 2)) !important;
  }

  /* Wider, centered body. */
  .ag-create-body {
    max-width: 1000px;
    padding: 24px;
    gap: 20px;
  }

  /* ---- Casting Post & Casting Call: two-column form on desktop ---- */
  /* The intro banner and the primary CTA span the full width; the field
     cards and the editor sit side by side so nothing is cramped. */
  #create-casting-post .ag-create-body,
  #create-casting-call .ag-create-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    column-gap: 24px;
    row-gap: 20px;
  }
  /* Full-width rows: intro banner (the gradient div), validation, publish btn. */
  #create-casting-post .ag-create-body > div[style*="linear-gradient"],
  #create-casting-post .ag-create-body > #cpost-validation,
  #create-casting-post .ag-create-body > .cpost-publish,
  #create-casting-call .ag-create-body > div[style*="linear-gradient"],
  #create-casting-call .ag-create-body > button {
    grid-column: 1 / -1;
  }
  /* The tall editor card in the casting-post sits in the right column and
     stays visible while scrolling the fields. Ensure the card + textarea use
     the available height so the editor doesn't collapse. */
  #create-casting-post .ag-create-body > .ag-create-card:last-of-type {
    position: sticky;
    top: 90px;
    align-self: stretch;
  }
  #create-casting-post .cpost-textarea,
  #create-casting-post .cpost-preview {
    min-height: 440px;
  }

  /* Comfortable field sizing on desktop (16px prevents iOS zoom on mobile;
     desktop can be a touch smaller & tighter). */
  .ag-create-field { font-size: 15px; }
  .ag-create-card { padding: 22px; }

  /* ---- Post Casting Call: two-column field grid inside the single form card ----
     The whole form lives in ONE .ag-create-card, so we grid its direct field
     children into two columns on desktop (instead of a tall narrow scroll).
     The banner + sticky footer already span the body; inside the card, wide
     fields (description, poster, safe-policy toggles) span both columns. */
  #create-casting-call .ag-create-body {
    grid-template-columns: 1fr;
    max-width: 940px;
    margin: 0 auto;
  }
  #create-casting-call .ag-create-appbar {
    padding-left: max(24px, calc((100% - 940px) / 2)) !important;
    padding-right: max(24px, calc((100% - 940px) / 2)) !important;
  }
  /* The form card: lay its direct children out as a 2-column grid. */
  #create-casting-call .ag-create-body > .ag-create-card {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    column-gap: 20px;
    row-gap: 16px;
  }
  /* Rows that should span the full width of the card:
     Role Description, the paired Gender/Age block (already 2-up itself),
     Skills chips, Hashtags, poster upload, and the policy toggle rows. */
  #create-casting-call .ag-create-body > .ag-create-card > .ag-create-grid-2,
  #create-casting-call .ag-create-body > .ag-create-card > div:has(> textarea),
  #create-casting-call .ag-create-body > .ag-create-card > div:has(#skills-chip-container),
  #create-casting-call .ag-create-body > .ag-create-card > div:has(#setup-hashtags),
  #create-casting-call .ag-create-body > .ag-create-card > div:has(.ag-casting-poster-row),
  #create-casting-call .ag-create-body > .ag-create-card > div:has(> .switch) {
    grid-column: 1 / -1;
  }
}

/* Large desktop: let the casting-post breathe a little more. */
@media (min-width: 1200px) {
  #create-casting-post .ag-create-body { max-width: 1120px; }
  .ag-create-appbar {
    padding-left: max(24px, calc((100% - 1120px) / 2)) !important;
    padding-right: max(24px, calc((100% - 1120px) / 2)) !important;
  }
}
