/* ============================================
   ACTGRAM — Mobile Responsive (Instagram-style)
   Layout-only fixes — no feature changes
   Breakpoint: max-width 767px (mobile)
   ============================================ */

/* Home feed app bar — desktop default */
.ag-feed-app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ag-feed-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ag-feed-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ag-mobile-create-btn,
.ag-feed-title-center {
  display: none;
}

@media (max-width: 767px) {
  :root {
    --tab-bar-height: calc(56px + env(safe-area-inset-bottom, 0px));
    --mobile-shell-pad: 16px;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
    overscroll-behavior-y: none;
  }

  /* App shell — full width, allow scroll inside screens */
  #app {
    max-width: 100% !important;
    width: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    overflow: visible !important;
    box-shadow: none !important;
  }

  .screen {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Tab bar — Instagram-style bottom nav with safe area */
  #tab-bar {
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: var(--tab-bar-height) !important;
    min-height: 56px;
    z-index: 500 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    padding-left: max(4px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(4px, env(safe-area-inset-right, 0px)) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
  }

  body.ag-tab-visible #tab-bar {
    display: flex !important;
  }

  /* Main tab screens must not cover the bottom nav */
  body.ag-tab-visible .screen.active-screen:not(#reels-feed):not(#story-viewer):not(#story-upload):not(#go-live):not(#live-viewer) {
    bottom: var(--tab-bar-height) !important;
    max-height: calc(100dvh - var(--tab-bar-height)) !important;
  }

  .tab-item {
    min-width: 0;
    padding: 6px 2px !important;
    gap: 2px !important;
  }

  .tab-item i {
    font-size: 24px !important;
  }

  .tab-nav-icon {
    width: 26px !important;
    height: 26px !important;
  }

  .tab-nav-icon svg {
    width: 24px !important;
    height: 24px !important;
  }

  /* Discover + Reels — slightly larger, IG-style optical weight */
  .tab-item[data-tab="discover"] .tab-nav-icon svg,
  .tab-item[data-tab="reels"] .tab-nav-icon svg {
    width: 27px !important;
    height: 27px !important;
  }

  /* Reels — center tab (3 of 5) */
  .tab-item-reels-center .tab-nav-icon svg {
    width: 28px !important;
    height: 28px !important;
  }

  .tab-item.active .tab-nav-icon svg {
    transform: scale(1.08);
    filter: drop-shadow(0 2px 8px rgba(0, 174, 239, 0.4));
  }

  .tab-label {
    font-size: 10px !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tab-fab {
    width: 44px !important;
    height: 44px !important;
    margin-bottom: 2px !important;
  }

  /* Home feed header — Instagram-style: + left, ActGram center, actions right */
  .ag-feed-app-bar {
    display: grid !important;
    grid-template-columns: 44px 1fr 88px;
    align-items: center;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .ag-mobile-create-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    color: #0F172A;
    padding: 0;
    border-radius: 8px;
    grid-column: 1;
    grid-row: 1;
  }

  .ag-mobile-create-btn i,
  .ag-mobile-create-btn svg {
    font-size: 28px;
    width: 28px;
    height: 28px;
    line-height: 1;
    display: block;
  }

  .ag-mobile-create-btn:active {
    transform: scale(0.92);
    opacity: 0.75;
  }

  .ag-feed-brand {
    display: none !important;
  }

  .ag-feed-title-center {
    display: flex !important;
    justify-content: center;
    align-items: center;
    grid-column: 2;
    grid-row: 1;
  }

  .ag-feed-actions {
    justify-content: flex-end;
    grid-column: 3;
    grid-row: 1;
  }

  .notif-badge {
    right: 8px !important;
    top: 2px !important;
  }

  /* Search screen — mobile layout */
  #search.active-screen,
  #search-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  #search-header {
    padding-top: max(8px, env(safe-area-inset-top, 0px)) !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  #search-default-container,
  #search-results-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
  }

  .srch-bar-wrap {
    gap: 6px !important;
    width: 100% !important;
  }

  .srch-back-btn {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0 !important;
  }

  .srch-input-wrap {
    height: 44px !important;
    min-width: 0 !important;
  }

  .srch-input-field-wrap {
    min-width: 0 !important;
  }

  #search-input {
    font-size: 16px !important;
    min-width: 0 !important;
  }

  /* Hide voice on narrow screens — keeps filter + text readable */
  .srch-voice-btn {
    display: none !important;
  }

  .srch-input-actions {
    flex-shrink: 0 !important;
  }

  .srch-trending-list {
    width: 100% !important;
  }

  .srch-trending-chip {
    width: 116px !important;
    max-width: 116px !important;
  }

  .srch-talent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .srch-talent-cover {
    height: 150px !important;
  }

  .srch-cats {
    margin-left: -2px !important;
    margin-right: -2px !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
  }

  /* Screens with bottom tab bar — content clearance */
  body.ag-tab-visible #home-feed.active-screen > div,
  body.ag-tab-visible #search.active-screen > div,
  body.ag-tab-visible #discover-roles.active-screen > div,
  body.ag-tab-visible #discover-talent.active-screen > div,
  body.ag-tab-visible #work-spotlight.active-screen > div,
  body.ag-tab-visible #casting-board.active-screen > .cb-page,
  body.ag-tab-visible #chat-list.active-screen > div,
  body.ag-tab-visible #notification-center.active-screen > div,
  body.ag-tab-visible #saved-posts.active-screen > div,
  body.ag-tab-visible #notifications.active-screen > div,
  body.ag-tab-visible #actor-profile.active-screen > div,
  body.ag-tab-visible #director-profile.active-screen > div,
  body.ag-tab-visible #talent-reel-detail.active-screen > div,
  body.ag-tab-visible #comments.active-screen > div {
    padding-bottom: calc(var(--tab-bar-height) + 8px) !important;
  }

  /* Reels tab — full viewport scroll inside container, not on .screen */
  #reels-feed.active-screen {
    overflow: hidden !important;
    overflow-y: hidden !important;
    min-height: 0 !important;
    height: calc(100svh - var(--tab-bar-height, 72px)) !important;
    max-height: calc(100svh - var(--tab-bar-height, 72px)) !important;
    background: #000 !important;
  }

  #reels-feed.active-screen > .reels-feed-container {
    height: 100% !important;
    max-height: 100% !important;
    padding-bottom: 0 !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: y mandatory;
    overscroll-behavior-y: contain;
  }

  body.ag-tab-visible #reels-feed .reel-stage {
    padding-bottom: 0 !important;
  }

  /* Discover swipe (Roles / Talent) */
  .discover-swipe-appbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid #E2E8F0;
    position: relative;
    z-index: 30;
    flex-shrink: 0;
  }

  .discover-swipe-appbar__left,
  .discover-swipe-appbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .discover-swipe-back {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: #F1F5F9;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
  }

  .discover-swipe-title {
    font-size: 18px;
    font-weight: 800;
    color: #0F172A;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.3px;
  }

  .discover-swipe-chip {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    font-family: inherit;
  }

  .discover-swipe-icon-btn {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #475569;
  }

  .discover-swipe-page {
    min-height: 100% !important;
    box-sizing: border-box;
  }

  .discover-swipe-footer-hint {
    text-align: center;
    padding: 0 16px 8px;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
  }

  .discover-swipe-footer-hint span {
    font-size: 11px;
    color: #64748B;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
  }

  #discover-roles.active-screen .discover-swipe-page,
  #discover-talent.active-screen .discover-swipe-page {
    min-height: 100% !important;
    max-height: 100%;
    overflow-y: auto;
  }

  /* Reels — Instagram bottom layout: meta full width, icons in right strip */
  #reels-feed .reel-stage-inner .reel-sidebar {
    top: auto !important;
    bottom: 10px !important;
    transform: none !important;
    width: 52px !important;
    right: 4px !important;
    justify-content: flex-end !important;
  }

  #reels-feed .reel-stage-inner .reel-meta {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(40vh, 300px) !important;
    padding-right: 60px !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  #reels-feed .reel-meta-name-wrap {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 96px) !important;
  }

  #reels-feed .reel-meta-name {
    max-width: none !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
  }

  #reels-feed .reel-meta-verified {
    flex-shrink: 0 !important;
    font-size: 14px !important;
    color: #0095F6 !important;
  }

  #reels-feed .reel-meta-follow {
    padding: 7px 16px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    min-height: 34px !important;
    margin-left: auto !important;
    border: 1px solid rgba(255,255,255,0.35) !important;
  }

  #reels-feed .reel-caption {
    width: 100% !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    -webkit-line-clamp: 3 !important;
  }

  #reels-feed .reel-cta-pill {
    width: 100% !important;
    max-width: 100% !important;
  }

  #reels-feed .reel-phone .reel-phone-mute {
    top: max(10px, env(safe-area-inset-top, 10px)) !important;
    right: 10px !important;
    bottom: auto !important;
    left: auto !important;
  }

  #reels-feed .reel-sidebar-actions {
    gap: 8px !important;
  }

  #reels-feed .reel-action-item {
    min-height: auto !important;
  }

  #reels-feed .reel-icon-btn {
    width: 40px !important;
    height: 40px !important;
  }

  #reels-feed .reel-icon-btn .reel-svg-icon {
    width: 24px !important;
    height: 24px !important;
  }

  /* Home feed — full-bleed posts like Instagram */
  .feed-layout-container {
    padding: 0 !important;
    gap: 0 !important;
  }

  .feed-main-col {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Widget placement + card styling handled in feed-mobile.css */

  /* Home feed header — edge to edge (legacy inline sticky bars) */
  #home-feed .ag-feed-app-bar {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  #home-feed [style*="position:sticky"][style*="top:0"]:not(.ag-feed-app-bar) {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Home feed reel cards — full-bleed mobile layout */
  .feed-post-card-reel {
    background: #fff !important;
    border-radius: 0 !important;
    margin-bottom: 6px !important;
    border: none !important;
    border-bottom: 1px solid #EFEFEF !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  /* Home feed image/ad posts — remove side white space to match reel full-bleed width */
  .feed-post-card:not(.feed-post-card-reel) {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .feed-post-card:not(.feed-post-card-reel) .feed-post-media-container {
    width: 100% !important;
    border-radius: 0 !important;
  }

  .feed-post-card-reel .feed-reel-post-header-desktop {
    display: none !important;
  }

  .feed-post-card-reel .feed-reel-post-actions {
    padding: 0 12px 12px !important;
  }

  /* Instagram-style: icons below video, then caption */
  .feed-post-card-reel .feed-reel-mobile-actions {
    display: grid !important;
    grid-template-columns: 44px 44px 44px 1fr 44px;
    align-items: center;
    gap: 0;
    margin-bottom: 0;
    padding: 8px 10px 4px !important;
    width: 100%;
    box-sizing: border-box;
  }

  .feed-reel-action-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: #262626;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
  }

  .feed-reel-action-btn .reel-svg-icon,
  .feed-reel-action-btn i {
    width: 26px;
    height: 26px;
    font-size: 26px;
    line-height: 1;
    display: block;
  }

  .feed-reel-action-btn.liked {
    color: #ff3040;
  }

  .feed-reel-action-spacer {
    display: block;
    min-width: 0;
  }

  .feed-reel-stats-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 4px 14px 6px;
    font-size: 13px;
    font-weight: 700;
    color: #262626;
    font-family: 'DM Sans', sans-serif;
  }

  .feed-post-card-reel .feed-post-caption {
    font-size: 13.5px;
    line-height: 1.45;
    padding: 4px 14px 0;
    color: #262626;
  }

  .feed-post-caption,
  .feed-caption-text,
  .caption-short,
  .caption-full {
    color: #262626 !important;
  }

  .caption-more-btn {
    color: #737373 !important;
  }

  /* Profile strip overlaid on bottom of reel video */
  .feed-reel-profile-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    padding: 32px 12px 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    pointer-events: auto;
  }

  /* Music disc sits bottom-right — leave a clear lane so Follow/Following
     never overlaps it on narrow screens. */
  .feed-post-card-reel .feed-reel-media:has(.feed-reel-music-disc) .feed-reel-profile-overlay {
    padding-right: 56px;
  }

  .feed-post-card-reel .feed-reel-music-disc {
    z-index: 10;
    right: 12px;
    bottom: 16px;
    width: 36px;
    height: 36px;
  }

  .feed-reel-profile-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 3px;
    align-items: center;
    width: 100%;
    min-width: 0;
  }

  .feed-reel-overlay-avatar {
    grid-row: 1 / span 2;
    grid-column: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  }

  .feed-reel-overlay-meta {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    text-align: left;
  }

  .feed-reel-overlay-follow {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    padding: 5px 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Extra-narrow phones: keep Follow compact next to the disc lane */
  @media (max-width: 360px) {
    .feed-post-card-reel .feed-reel-media:has(.feed-reel-music-disc) .feed-reel-profile-overlay {
      padding-right: 50px;
    }

    .feed-reel-overlay-follow {
      padding: 4px 8px;
      font-size: 11px;
    }
  }

  .feed-reel-overlay-follow.following {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
  }

  .feed-reel-overlay-location {
    grid-column: 2;
    grid-row: 2;
  }

  .feed-reel-overlay-name-line {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
  }

  .feed-reel-overlay-username {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  }

  .feed-reel-overlay-verified {
    font-size: 14px;
    color: #38bdf8;
    flex-shrink: 0;
  }

  .feed-reel-overlay-location {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .feed-reel-overlay-location i {
    font-size: 11px;
    flex-shrink: 0;
  }

  /* No sidebar icons on mobile — actions live below video */
  .feed-post-card-reel .feed-reel-sidebar {
    display: none !important;
  }

  .feed-post-card-reel .feed-reel-media {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    aspect-ratio: 9 / 16 !important;
    max-height: min(72vh, 680px) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .feed-post-card-reel .feed-reel-video {
    object-fit: cover !important;
  }

  .feed-post-card-reel .feed-reel-bg-video {
    object-fit: cover !important;
    opacity: 0.45;
  }

  .feed-post-card-reel .feed-reel-overlay-bottom,
  .feed-post-card-reel .feed-reel-overlay-bottom-legacy {
    display: none !important;
  }

  .feed-post-card-reel .feed-reel-overlay-top {
    top: 10px;
    left: 10px;
    right: 10px;
    pointer-events: none;
  }

  .feed-post-card-reel .feed-reel-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    flex-shrink: 0;
  }

  .feed-post-card-reel .feed-reel-mute-btn {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
  }

  .feed-post-card-reel .feed-reel-expand-btn {
    position: static !important;
    top: auto !important;
    right: auto !important;
    width: 32px !important;
    height: 32px !important;
  }

  .feed-post-card-reel .feed-reel-badge {
    max-width: calc(100% - 88px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: auto;
  }

  .feed-post-card-reel .feed-reel-player {
    padding-right: 0;
  }
  .feed-main-col > [style*="Feed Tab Selector"],
  .feed-main-col > div[style*="border-radius:14px"][style*="Work Feed"] {
    margin-left: 12px !important;
    margin-right: 12px !important;
    border-radius: 14px !important;
  }

  /* Discover swipe stacks — fit viewport */
  #dr-stack,
  #dt-stack {
    max-width: 100% !important;
    width: 100% !important;
    height: min(520px, calc(100svh - 200px)) !important;
  }

  .swipe-card-stack {
    height: min(480px, calc(100svh - 220px)) !important;
  }

  /* Casting Board — mobile layout */
  #casting-board.active-screen {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #casting-board.active-screen > .cb-page {
    min-height: 100% !important;
    padding-bottom: calc(var(--tab-bar-height) + 12px) !important;
    box-sizing: border-box;
  }

  .cb-header {
    padding: 12px 14px !important;
    gap: 10px !important;
  }

  .cb-header-left {
    gap: 10px !important;
    min-width: 0;
  }

  .cb-title {
    font-size: 17px !important;
    line-height: 1.2;
  }

  .cb-subtitle {
    font-size: 11px !important;
  }

  .cb-icon-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 11px !important;
    flex-shrink: 0;
  }

  /* Keep the labeled Brand/Smart/Filters pills readable on phones: tighten
     padding and let the group scroll sideways if space is very tight. */
  .cb-header-actions {
    flex-shrink: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .cb-header-actions::-webkit-scrollbar { display: none; }
  .cb-action-btn {
    height: 38px !important;
    padding: 0 11px !important;
    font-size: 12.5px !important;
    flex-shrink: 0;
  }

  .cb-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 12px 14px 0 !important;
  }

  .cb-stat {
    padding: 12px 8px !important;
    border-radius: 14px !important;
  }

  .cb-stat-link {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .cb-stat-link:active {
    transform: scale(0.98);
  }

  .cb-stat-num {
    font-size: 20px !important;
  }

  .cb-stat-label {
    font-size: 10px !important;
    letter-spacing: 0.02em;
  }

  .cb-tabs {
    padding: 12px 14px 0 !important;
    gap: 8px !important;
    scroll-padding-inline: 14px;
  }

  .cb-tab {
    padding: 9px 14px !important;
    font-size: 12px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .cb-grid {
    padding: 12px 14px 0 !important;
    gap: 12px !important;
  }

  .cb-card {
    grid-template-columns: 88px 1fr !important;
    min-height: 0 !important;
    border-radius: 16px !important;
  }

  .cb-card-poster {
    width: 76px !important;
    height: 112px !important;
    margin: 10px 0 10px 10px !important;
    border-radius: 12px !important;
  }

  .cb-card-body {
    padding: 10px 12px 12px 8px !important;
    gap: 5px !important;
  }

  .cb-card-title {
    font-size: 13px !important;
    padding-right: 68px !important;
    -webkit-line-clamp: 3;
  }

  .cb-match-pill {
    top: 10px !important;
    right: 10px !important;
    font-size: 9px !important;
    padding: 3px 7px !important;
  }

  .cb-card-meta {
    font-size: 11px !important;
  }

  .cb-card-meta span {
    gap: 4px !important;
  }

  .cb-skill {
    font-size: 10px !important;
    padding: 3px 8px !important;
  }

  .cb-card-foot {
    margin-top: 2px !important;
  }

  .cb-apply-btn {
    padding: 7px 14px !important;
    font-size: 11px !important;
  }

  .cb-status {
    font-size: 11px !important;
  }

  /* Fixed bottom bars — sit above tab bar */
  #comments [style*="position:fixed"][style*="bottom:0"],
  #comments [style*="position: fixed"][style*="bottom: 0"] {
    bottom: var(--tab-bar-height) !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
  }

  /* Talent reel detail / casting apply bars */
  [style*="bottom:72px"],
  [style*="bottom: 72px"] {
    bottom: var(--tab-bar-height) !important;
  }

  /* Casting detail — dock Apply bar under a scroll pane so it never covers
     Role Details / budget / location on short phones. Same button look. */
  #casting-call-detail.active-screen {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    overflow-y: hidden !important;
    bottom: var(--tab-bar-height) !important;
    max-height: calc(100dvh - var(--tab-bar-height)) !important;
    min-height: 0 !important;
  }

  #casting-call-detail.active-screen > .ccd-page {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box;
  }

  #casting-call-detail .ccd-scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #casting-call-detail .ccd-apply-bar {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 0 !important;
    z-index: 5 !important;
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.06);
  }

  /* Reels comments panel — mobile bottom sheet (already in JS; reinforce) */
  .reels-comments-panel {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 16px 16px 0 0 !important;
    top: auto !important;
    bottom: 0 !important;
    height: min(78vh, calc(100dvh - 48px)) !important;
  }

  .reels-share-panel {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Profile grids — Instagram full-bleed 3-col (escape body + tab padding) */
  #actor-profile .ag-profile-tab-content:has(.ag-profile-posts-grid),
  #actor-profile .ag-profile-tab-content:has(.ag-profile-reels-grid),
  #actor-profile .ag-profile-tab-content:has(.ag-profile-thoughts-tab),
  #director-profile .ag-profile-tab-content:has(.ag-profile-posts-grid),
  #director-profile .ag-profile-tab-content:has(.ag-profile-reels-grid),
  #director-profile .ag-profile-tab-content:has(.ag-profile-thoughts-tab),
  #modeling-agency-profile .ag-profile-tab-content:has(.ag-profile-posts-grid),
  #modeling-agency-profile .ag-profile-tab-content:has(.ag-profile-reels-grid),
  #modeling-agency-profile .ag-profile-tab-content:has(.ag-profile-thoughts-tab) {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #actor-profile .ag-profile-body .ag-profile-posts-grid,
  #actor-profile .ag-profile-body .ag-profile-reels-grid,
  #actor-profile .ag-profile-body .ag-thought-grid,
  #director-profile .ag-profile-body .ag-profile-posts-grid,
  #director-profile .ag-profile-body .ag-profile-reels-grid,
  #director-profile .ag-profile-body .ag-thought-grid,
  #modeling-agency-profile .ag-profile-body .ag-profile-posts-grid,
  #modeling-agency-profile .ag-profile-body .ag-profile-reels-grid,
  #modeling-agency-profile .ag-profile-body .ag-thought-grid {
    margin-left: calc(-1 * var(--ag-profile-pad-x, 16px));
    margin-right: calc(-1 * var(--ag-profile-pad-x, 16px));
    width: calc(100% + 2 * var(--ag-profile-pad-x, 16px)) !important;
    max-width: none !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1px !important;
  }

  #actor-profile .ag-profile-grid-item,
  #director-profile .ag-profile-grid-item,
  #modeling-agency-profile .ag-profile-grid-item {
    border-radius: 0 !important;
  }

  #actor-profile .ag-thought-grid-tile,
  #director-profile .ag-thought-grid-tile,
  #modeling-agency-profile .ag-thought-grid-tile {
    border-radius: 0 !important;
  }

  #actor-profile .ag-thought-grid-tile-text,
  #director-profile .ag-thought-grid-tile-text,
  #modeling-agency-profile .ag-thought-grid-tile-text {
    font-size: 13px !important;
  }

  /* Legacy inline grids (saved / misc) — slightly larger 2-col for clarity */
  #saved-posts [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Search / forms — prevent iOS zoom on focus */
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px !important;
  }

  /* Modals & bottom sheets — full width */
  .bottom-sheet,
  .modal {
    max-width: 100% !important;
    border-radius: 16px 16px 0 0 !important;
  }

  .bottom-sheet-overlay,
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  /* Toast — clear the top-left back-nav button (auth/login screens) and respect notch */
  #toast-container {
    top: calc(max(12px, env(safe-area-inset-top, 12px)) + 60px) !important;
    width: calc(100% - 24px) !important;
  }

  /* Settings hub — single column on mobile */
  .set-hub {
    flex-direction: column !important;
  }

  .set-sidebar {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #EFEFEF !important;
    overflow-x: auto !important;
    flex-direction: row !important;
    display: flex !important;
  }

  /* Chat — full viewport.
     The screen-container ships with inline `min-height:100vh`. On mobile 100vh
     is TALLER than the real visible viewport (it counts the URL-bar strip that
     100dvh excludes), so that min-height overrode our `height:100dvh` and forced
     the flex column taller than the screen — pushing the message-input row below
     the fold (the empty-space / floating-input bug) and letting the whole .screen
     scroll instead of just the messages. Pin the container to the dynamic
     viewport height and neutralize the inline min-height so `flex:1` on the
     messages area absorbs the space and the input stays anchored at the bottom. */
  #individual-chat.active-screen > div {
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  /* Only the message list scrolls; the app bar, warning bar and input row stay
     fixed. min-height:0 lets this flex child actually shrink so overflow works
     (a flex item defaults to min-height:auto and would otherwise refuse to
     shrink below its content, breaking the internal scroll). */
  #individual-chat.active-screen #chat-messages-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  /* Keep the .screen wrapper itself from scrolling on the chat screen so the
     input row can't be pushed out of view. */
  #individual-chat.active-screen {
    overflow: hidden !important;
  }

  /* Prevent horizontal overflow from wide inline grids */
  [style*="min-width:600px"],
  [style*="min-width: 600px"] {
    min-width: 0 !important;
  }

  /* Welcome / auth — comfortable mobile padding */
  .wc-page,
  .ln-page,
  .auth-page,
  .un-page,
  .rs-page,
  .ob-page {
    padding-left: max(16px, env(safe-area-inset-left)) !important;
    padding-right: max(16px, env(safe-area-inset-right)) !important;
  }

  /* Login page: the inline login-bg.png the screen ships with is actually a
     screenshot of the home feed, not a decorative photo — on desktop
     #login .ln-page gets `background: white !important` (design-system.css)
     which overrides it, but that rule is scoped to the desktop media query.
     Mirror it here so mobile doesn't paint the feed screenshot behind the form. */
  #login .ln-page,
  #forgot-password .ln-page {
    background: linear-gradient(135deg, #E8F7FD 0%, #F0FAFF 50%, #F8FCFF 100%) !important;
  }

  /* Auth screens: opaque fallback background so the screen is NEVER transparent.
     On mobile these screens paint their look from a purgeable inline <style>
     background image (login-bg.png / signup-bg.png). Until that image downloads
     and paints — or during the screen transition — the container was see-through,
     letting the previous screen (e.g. the home feed) bleed through behind the
     form. This gives #login/#signup/#otp-verify a solid base matching the design's
     own light auth gradient; the inline background image still layers on top once
     loaded, so the final look is unchanged. Persistent (not purged) + mobile-only. */
  #login,
  #forgot-password,
  #signup,
  #otp-verify {
    background: linear-gradient(135deg, #E8F7FD 0%, #F0FAFF 50%, #F8FCFF 100%) !important;
  }

  /* Hide desktop-only duplicate when sidebar hidden */
  #desktop-header {
    display: none !important;
  }

  /* Touch targets — minimum 44px for icon buttons in sticky headers */
  [style*="position:sticky"] button,
  [style*="position: sticky"] button,
  .app-bar button {
    min-width: 40px;
    min-height: 40px;
  }

  /* Horizontal scroll rows — snap like Instagram stories */
  [style*="overflow-x:auto"],
  [style*="overflow-x: auto"] {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .tab-label {
    font-size: 9px !important;
  }

  .tab-item i {
    font-size: 22px !important;
  }

  .cb-stats {
    gap: 8px !important;
  }
}

/* Landscape phone — reduce vertical waste */
@media (max-width: 767px) and (orientation: landscape) {
  #dr-stack,
  #dt-stack {
    height: min(400px, calc(100svh - 120px)) !important;
  }

  .reels-comments-panel {
    height: min(85vh, calc(100dvh - 24px)) !important;
  }
}

/* ============================================
   NOTIFICATION CENTER — mobile-first layout
   ============================================ */
.notif-center-page {
  min-height: 100%;
  background: #F8FAFC;
  font-family: 'DM Sans', sans-serif;
}

.notif-center-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid #E2E8F0;
  padding: max(12px, env(safe-area-inset-top, 0px)) 16px 12px;
}

.notif-center-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notif-center-header__start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

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

.notif-back-btn:active {
  background: #E2E8F0;
}

.notif-center-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.02em;
}

.notif-center-header__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.notif-icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: #F1F5F9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.notif-icon-btn:active {
  background: #E2E8F0;
}

.notif-center-header__sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.notif-center-unread {
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
}

.notif-center-unread--active {
  color: #1E40AF;
}

.notif-mark-all {
  border: none;
  background: none;
  padding: 4px 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #00AEEF;
  cursor: pointer;
  white-space: nowrap;
}

.notif-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  position: sticky;
  top: calc(72px + env(safe-area-inset-top, 0px));
  z-index: 40;
}

.notif-tabs::-webkit-scrollbar {
  display: none;
}

.notif-tab-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #E2E8F0;
  border-radius: 99px;
  background: #fff;
  color: #64748B;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.notif-tab-btn span {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.75;
}

.notif-tab-btn.active {
  background: #0F172A;
  border-color: #0F172A;
  color: #fff;
}

.notif-tab-btn.active span {
  opacity: 0.85;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px calc(var(--tab-bar-height, 72px) + 16px);
}

.notif-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 12px 14px 14px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s;
}

.notif-card:active {
  transform: scale(0.985);
}

.notif-card--unread {
  border-color: #BFDBFE;
  background: #FAFCFF;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.06);
}

.notif-card--urgent {
  border-color: #FECACA;
  background: #FFFBFB;
}

.notif-card--dismiss {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.notif-card__unread-dot {
  position: absolute;
  top: 14px;
  left: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00AEEF;
}

.notif-card__avatar-wrap {
  grid-row: 1 / span 2;
  padding-left: 4px;
}

.notif-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.notif-card__avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-card__body {
  min-width: 0;
}

.notif-card__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.notif-card__type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notif-card__urgent-pill {
  font-size: 10px;
  font-weight: 800;
  color: #DC2626;
  background: #FEE2E2;
  padding: 2px 7px;
  border-radius: 99px;
}

.notif-card__time {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: #64748B;
  white-space: nowrap;
}

.notif-card__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.35;
}

.notif-card__message {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-card__dismiss {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.notif-card__dismiss:active {
  background: #F1F5F9;
  color: #64748B;
}

.notif-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.notif-card__btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.notif-card__btn--accept {
  background: #059669;
  color: #fff;
}

.notif-card__btn--decline {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

.notif-empty {
  text-align: center;
  padding: 56px 24px;
  color: #94A3B8;
}

.notif-empty p {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 500;
}

@media (max-width: 767px) {
  .notif-center-header {
    padding-top: max(14px, env(safe-area-inset-top, 0px));
  }

  .notif-tabs {
    top: calc(78px + env(safe-area-inset-top, 0px));
  }

  body.ag-tab-visible #notification-center.active-screen > .notif-center-page {
    padding-bottom: 0 !important;
  }

  #career-dashboard > .career-dashboard-page {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #F8FAFC !important;
  }

  body.ag-tab-visible #career-dashboard.active-screen > .career-dashboard-page {
    padding-bottom: 0 !important;
  }
}

/* ============================================
   CAREER DASHBOARD — mobile-first layout
   ============================================ */
.career-dashboard-page {
  min-height: 100%;
  background: #F8FAFC;
  font-family: 'DM Sans', sans-serif;
}

.career-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top, 0px)) 20px 16px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid #E2E8F0;
}

.career-header--flat {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.career-header__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.career-back-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: #F1F5F9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.career-header__text {
  min-width: 0;
}

.career-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.career-greeting {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #64748B;
}

.career-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #BFDBFE;
  flex-shrink: 0;
}

.career-avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E40AF, #3B82F6);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.career-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 18px;
  padding-bottom: calc(var(--tab-bar-height, 72px) + 24px);
}

.career-heat-card {
  position: relative;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 20px;
  padding: 20px;
  cursor: pointer;
  background: linear-gradient(135deg, #312E81 0%, #4F46E5 45%, #7C3AED 100%);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.28);
}

.career-heat-card__glow {
  position: absolute;
  top: -50px;
  right: -20px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.career-heat-card__glow::before,
.career-heat-card__glow::after {
  content: '';
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.career-heat-card__glow::after {
  inset: 36px;
  border-color: rgba(255, 255, 255, 0.05);
}

.career-heat-card__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.career-heat-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 6px;
}

.career-heat-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.career-heat-value {
  font-size: clamp(44px, 12vw, 56px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.career-heat-trend {
  margin-bottom: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
}

.career-heat-trend.is-up { color: #86EFAC; }
.career-heat-trend.is-down { color: #FCA5A5; }

.career-heat-compare {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.career-rank-box {
  flex-shrink: 0;
  min-width: 80px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  text-align: center;
  backdrop-filter: blur(4px);
}

.career-rank-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.career-rank-value {
  display: block;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
  margin-top: 2px;
}

.career-rank-city {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

.career-heat-cta {
  display: block;
  margin-top: 16px;
  padding-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-align: right;
}

.career-section--stats {
  margin-top: -2px;
}

.career-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.career-stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid #E8EDF3;
  border-radius: 18px;
  padding: 16px 16px 18px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family: 'DM Sans', sans-serif;
}

.career-stat-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.career-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.career-stat-card--blue .career-stat-icon { background: #1E40AF; color: #fff; }
.career-stat-card--green .career-stat-icon { background: #1E3A8A; color: #86EFAC; }
.career-stat-card--purple .career-stat-icon { background: #1E3A8A; color: #C4B5FD; }
.career-stat-card--amber .career-stat-icon { background: #1E3A8A; color: #FCD34D; }

.career-stat-card--blue,
.career-stat-card--green,
.career-stat-card--purple,
.career-stat-card--amber {
  border-top: none;
}

.career-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748B;
}

.career-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.career-section-head .career-section-title {
  margin: 0;
}

.career-link-btn {
  border: none;
  background: none;
  padding: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #00AEEF;
  cursor: pointer;
}

.career-stat-value {
  display: block;
  font-size: 28px;
  font-weight: 900;
  color: #0F172A;
  line-height: 1.1;
}

.career-stat-label {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
}

.career-stat-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #64748B;
}

.career-panel {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.career-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.career-quick-btn {
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 14px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  cursor: pointer;
  text-align: center;
  background: #F8FAFC;
}

.career-quick-btn--blue { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.career-quick-btn--green { background: #ECFDF5; border-color: #A7F3D0; color: #059669; }
.career-quick-btn--purple { background: #F5F3FF; border-color: #DDD6FE; color: #7C3AED; }
.career-quick-btn--amber { background: #FFFBEB; border-color: #FDE68A; color: #B45309; }

.career-activity-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #F1F5F9;
}

.career-activity-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.career-activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.career-activity-text {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #0F172A;
  line-height: 1.35;
}

.career-activity-time {
  font-size: 12px;
  font-weight: 500;
  color: #64748B;
  white-space: nowrap;
}

.career-event-row {
  display: grid;
  grid-template-columns: 4px 1fr 16px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  background: #F8FAFC;
  cursor: pointer;
  text-align: left;
}

.career-event-row:last-child {
  margin-bottom: 0;
}

.career-event-bar {
  align-self: stretch;
  border-radius: 99px;
  min-height: 36px;
}

.career-event-info {
  min-width: 0;
}

.career-event-info strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 2px;
}

.career-event-info small {
  font-size: 12px;
  color: #64748B;
}

.career-empty {
  margin: 0;
  padding: 12px 0;
  text-align: center;
  font-size: 13px;
  color: #94A3B8;
}

.career-leaderboard-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  background: linear-gradient(135deg, #5B21B6, #7C3AED 55%, #A855F7);
  color: #fff;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.25);
}

.career-leaderboard-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.career-leaderboard-text {
  flex: 1;
  min-width: 0;
}

.career-leaderboard-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.career-leaderboard-text strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  margin-top: 2px;
}

.career-leaderboard-text small {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

/* ============================================
   MOBILE POLISH — layout-only, additive
   Closes remaining ≤767px overflow + tap-target
   gaps found by the live 390/360px audit.
   No design/behavior change; nothing here runs ≥768px.
   ============================================ */
@media (max-width: 767px) {
  /* --- create-collaboration: date/number/tag inputs resisted shrinking
         below their grid track and pushed the screen a few px wide --- */
  #create-collaboration [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  }
  #create-collaboration input[type="date"],
  #create-collaboration input[type="number"] {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #create-collaboration #roles-container { max-width: 100% !important; }
  #create-collaboration #roles-container input[type="text"] { min-width: 60px !important; }

  /* --- challenge-submission: tag input (min-width:80px) in a flex-wrap row
         overflowed its 16px-margin column with pre-filled chips --- */
  #challenge-submission #tags-container { max-width: 100% !important; }
  #challenge-submission #tags-container input[type="text"] { min-width: 60px !important; }

  /* Belt-and-braces for these two fully inline-styled forms: native date/number/
     select controls keep a few px of intrinsic min-width even after the above.
     overflow-x:hidden prevents the phantom horizontal scroll; vertical scroll
     lives on the .screen wrapper (a different element), so this is safe and has
     universal mobile support. No layout or visual change — nothing is cut. */
  #create-collaboration,
  #challenge-submission { overflow-x: hidden !important; }

  /* --- tap targets: only genuinely-small STANDALONE controls are inflated.
         Native checkboxes/radios wrapped in padded <label>s are already
         comfortable targets and are intentionally left untouched. --- */

  /* search: clear (22px) + recent-row remove (28px) → 32px hit area.
     Glyphs stay flex-centered; the visible circle only grows a few px. */
  .srch-clear-btn { min-width: 32px !important; min-height: 32px !important; }
  .srch-recent-row-x { min-width: 32px !important; min-height: 32px !important; }

  /* add-tags: skill/genre pill chips (~28px). border-radius:99px uniquely
     matches the pills — Done (14px) and back (50%) buttons are untouched. */
  #add-tags button[style*="border-radius:99px"] { min-height: 32px !important; }

  /* filters: only the range sliders are a defensible bump; the checkbox/radio
     rows are label-backed (already tappable). */
  #filters input[type="range"] { min-height: 32px !important; }

  /* chip-close (×) buttons on the tag/role pills: 24px keeps the pill height
     intact (32px would visibly enlarge the pill = design change). */
  #challenge-submission #tags-container span > button,
  #create-collaboration #roles-container span > button {
    min-width: 24px !important;
    min-height: 24px !important;
  }
}
