/* NearNow Web v189 — MOBILE_ONBOARDING_VISUAL_MATCH.
   Mobile-only visual layer for first Connect/Sensual profile setup, Sensual intro,
   profile-completion/location choice and setup CTA hierarchy.
   Profile contracts, validation, lifecycle, location privacy and desktop >=861 px stay unchanged. */
@media (max-width: 860px) {
  #screen-profile:not(.viewing-other-profile){
    --onboard-accent:#3d8cff;
    --onboard-accent-rgb:61,140,255;
    --onboard-panel:#081322;
    --onboard-line:rgba(90,143,226,.27);
  }
  .sensual-mode #screen-profile:not(.viewing-other-profile){
    --onboard-accent:#db3f7c;
    --onboard-accent-rgb:219,63,124;
    --onboard-panel:#1a0b16;
    --onboard-line:rgba(202,72,124,.29);
  }

  /* Only first setup gets the onboarding treatment; later editing keeps v180 styling. */
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding{
    position:relative!important;
    overflow:visible!important;
    padding:12px!important;
    border-color:var(--onboard-line)!important;
    background:
      radial-gradient(circle at 96% 1%,rgba(var(--onboard-accent-rgb),.15),transparent 27%),
      linear-gradient(180deg,rgba(8,19,34,.985),rgba(5,12,23,.998))!important;
    box-shadow:0 18px 44px rgba(0,0,0,.28),0 0 28px rgba(var(--onboard-accent-rgb),.055),inset 0 1px 0 rgba(255,255,255,.025)!important;
  }
  .sensual-mode #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding{
    background:
      radial-gradient(circle at 96% 1%,rgba(var(--onboard-accent-rgb),.16),transparent 27%),
      linear-gradient(180deg,rgba(30,10,23,.985),rgba(13,7,14,.998))!important;
  }

  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-onboarding-banner{
    display:grid!important;
    gap:5px!important;
    margin:0 0 10px!important;
    padding:16px 15px!important;
    border:1px solid rgba(var(--onboard-accent-rgb),.34)!important;
    border-radius:18px!important;
    background:
      radial-gradient(circle at 100% 0%,rgba(var(--onboard-accent-rgb),.18),transparent 40%),
      linear-gradient(145deg,rgba(18,38,68,.92),rgba(8,19,35,.97))!important;
    box-shadow:0 12px 28px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.035)!important;
  }
  .sensual-mode #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-onboarding-banner{
    background:
      radial-gradient(circle at 100% 0%,rgba(var(--onboard-accent-rgb),.19),transparent 40%),
      linear-gradient(145deg,rgba(57,16,36,.92),rgba(25,9,20,.97))!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-onboarding-banner span{
    color:var(--onboard-accent)!important;
    font-size:9px!important;
    line-height:1!important;
    font-weight:950!important;
    letter-spacing:.12em!important;
    text-transform:uppercase!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-onboarding-banner b{
    color:#f7faff!important;
    font-size:clamp(21px,6.2vw,27px)!important;
    line-height:1.06!important;
    font-weight:950!important;
    letter-spacing:-.035em!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-onboarding-banner small{
    max-width:50ch!important;
    color:#9baabd!important;
    font-size:10.5px!important;
    line-height:1.48!important;
  }

  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-editor-identity{
    grid-template-columns:76px minmax(0,1fr)!important;
    margin-bottom:10px!important;
    padding:12px!important;
    border-color:rgba(var(--onboard-accent-rgb),.24)!important;
    background:linear-gradient(180deg,rgba(8,19,34,.88),rgba(6,14,26,.95))!important;
  }
  .sensual-mode #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-editor-identity{
    background:linear-gradient(180deg,rgba(35,12,27,.88),rgba(19,8,17,.95))!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .editor-avatar{
    width:76px!important;
    height:76px!important;
    flex-basis:76px!important;
    border-width:1px!important;
    box-shadow:0 11px 25px rgba(0,0,0,.28),0 0 22px rgba(var(--onboard-accent-rgb),.10)!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-photo-open{
    min-height:40px!important;
    border-color:rgba(var(--onboard-accent-rgb),.42)!important;
    background:rgba(var(--onboard-accent-rgb),.10)!important;
  }

  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-form{
    counter-reset:nn-onboard-step!important;
    gap:9px!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-form-section{
    counter-increment:nn-onboard-step!important;
    position:relative!important;
    padding:14px!important;
    border-color:rgba(var(--onboard-accent-rgb),.21)!important;
    background:
      linear-gradient(180deg,rgba(10,23,41,.93),rgba(6,15,28,.97))!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.018)!important;
  }
  .sensual-mode #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-form-section{
    background:linear-gradient(180deg,rgba(34,12,27,.93),rgba(18,8,17,.97))!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-form-section>h4{
    display:flex!important;
    align-items:center!important;
    gap:8px!important;
    min-height:26px!important;
    margin-bottom:5px!important;
    font-size:13.5px!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-form-section>h4::before{
    content:counter(nn-onboard-step)!important;
    display:grid!important;
    place-items:center!important;
    flex:0 0 24px!important;
    width:24px!important;
    height:24px!important;
    border:1px solid rgba(var(--onboard-accent-rgb),.38)!important;
    border-radius:8px!important;
    background:rgba(var(--onboard-accent-rgb),.11)!important;
    color:#dfeeff!important;
    font-size:10px!important;
    line-height:1!important;
    font-weight:950!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-required{color:#ff9ab8!important;}
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .choice-chip{
    min-height:39px!important;
    padding-inline:12px!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-field input,
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-field select{
    min-height:49px!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-field textarea{
    min-height:104px!important;
  }

  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-actions{
    position:sticky!important;
    z-index:18!important;
    bottom:max(8px,env(safe-area-inset-bottom))!important;
    margin:2px -2px 0!important;
    padding:9px!important;
    border:1px solid rgba(var(--onboard-accent-rgb),.28)!important;
    border-radius:16px!important;
    background:rgba(6,14,26,.94)!important;
    box-shadow:0 15px 34px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.025)!important;
    backdrop-filter:blur(16px)!important;
  }
  .sensual-mode #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-actions{
    background:rgba(20,8,17,.95)!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-actions .profile-save{
    min-height:52px!important;
    font-size:14px!important;
  }
  #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-message:empty{display:none!important;}

  /* Sensual explanation becomes a premium mobile story/sheet without changing activation behavior. */
  #sensualIntroDialog{
    align-items:flex-end!important;
    padding:0!important;
    background:rgba(4,4,7,.86)!important;
    backdrop-filter:blur(12px)!important;
  }
  #sensualIntroDialog .sensual-intro-card{
    width:100%!important;
    max-width:620px!important;
    max-height:96dvh!important;
    margin:0 auto!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    border:1px solid rgba(200,66,119,.32)!important;
    border-bottom:0!important;
    border-radius:26px 26px 0 0!important;
    background:linear-gradient(180deg,#1d0b17,#0b080d 54%)!important;
    box-shadow:0 -24px 70px rgba(0,0,0,.52)!important;
  }
  #sensualIntroDialog .sensual-intro-card::before{
    content:"";
    display:block;
    position:sticky;
    z-index:6;
    top:7px;
    width:46px;
    height:4px;
    margin:7px auto -11px;
    border-radius:999px;
    background:rgba(255,255,255,.22);
  }
  #sensualIntroDialog .sensual-intro-hero{
    min-height:300px!important;
    border-bottom:1px solid rgba(196,70,117,.18)!important;
  }
  #sensualIntroDialog .sensual-intro-hero img{
    object-position:center 18%!important;
    filter:saturate(.92) contrast(1.02)!important;
  }
  #sensualIntroDialog .sensual-intro-hero::after{
    background:
      linear-gradient(180deg,rgba(10,5,8,.06),rgba(10,5,8,.20) 44%,#1d0b17 96%),
      linear-gradient(90deg,rgba(10,5,8,.62),transparent 72%)!important;
  }
  #sensualIntroDialog .sensual-intro-copy{
    width:min(88%,520px)!important;
    padding:32px 20px 22px!important;
  }
  #sensualIntroDialog .sensual-intro-copy h2{
    margin:17px 0 9px!important;
    color:#fff6fa!important;
    font-size:clamp(31px,9vw,40px)!important;
    line-height:.98!important;
    letter-spacing:-.045em!important;
  }
  #sensualIntroDialog .sensual-intro-copy p{color:#d9c3cc!important;font-size:12px!important;line-height:1.55!important;}
  #sensualIntroDialog .sensual-intro-close{
    top:18px!important;
    right:14px!important;
    width:42px!important;
    height:42px!important;
    border-radius:14px!important;
    background:rgba(11,6,9,.72)!important;
    backdrop-filter:blur(12px)!important;
  }
  #sensualIntroDialog .sensual-intro-body{padding:14px 14px max(14px,env(safe-area-inset-bottom))!important;}
  #sensualIntroDialog .sensual-intro-points{gap:8px!important;}
  #sensualIntroDialog .sensual-intro-point{
    display:grid!important;
    gap:3px!important;
    padding:13px 14px!important;
    border-color:rgba(169,62,105,.25)!important;
    border-radius:15px!important;
    background:linear-gradient(180deg,rgba(34,13,26,.84),rgba(19,9,17,.94))!important;
  }
  #sensualIntroDialog .sensual-intro-point b{margin:0!important;color:#f8eef2!important;font-size:12px!important;}
  #sensualIntroDialog .sensual-intro-point span{color:#a9959e!important;font-size:10.5px!important;}
  #sensualIntroDialog .sensual-adult-confirm{
    min-height:56px!important;
    margin-top:10px!important;
    padding:11px 12px!important;
    border-color:rgba(219,63,124,.34)!important;
    border-radius:15px!important;
    background:rgba(219,63,124,.075)!important;
    font-size:11px!important;
  }
  #sensualIntroDialog .dialog-actions{
    position:sticky!important;
    z-index:7!important;
    bottom:0!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
    margin:10px -2px -2px!important;
    padding:10px 2px max(4px,env(safe-area-inset-bottom))!important;
    background:linear-gradient(180deg,rgba(11,8,13,0),rgba(11,8,13,.94) 24%,#0b080d 48%)!important;
  }
  #sensualIntroDialog .dialog-actions button{width:100%!important;min-height:48px!important;border-radius:13px!important;font-weight:900!important;}
  #sensualIntroDialog #sensualIntroCreate{
    order:-1!important;
    border-color:rgba(239,95,153,.44)!important;
    background:linear-gradient(180deg,#d94380,#ad2c62)!important;
    box-shadow:0 10px 24px rgba(171,39,91,.24),inset 0 1px 0 rgba(255,255,255,.13)!important;
  }

  /* First-setup completion: immersive mobile card, still the same buttons/handlers. */
  #profileCompletionDialog{
    align-items:flex-end!important;
    padding:0!important;
    background:rgba(3,6,11,.90)!important;
    backdrop-filter:blur(13px)!important;
  }
  #profileCompletionDialog .profile-completion-shell{
    width:100%!important;
    max-width:620px!important;
    max-height:96dvh!important;
    margin:0 auto!important;
    border:1px solid rgba(72,133,224,.31)!important;
    border-bottom:0!important;
    border-radius:26px 26px 0 0!important;
    background:linear-gradient(180deg,#0d1b2e,#060c16)!important;
    box-shadow:0 -24px 70px rgba(0,0,0,.54)!important;
  }
  #profileCompletionDialog.sensual .profile-completion-shell{
    border-color:rgba(207,64,121,.34)!important;
    background:linear-gradient(180deg,#220d1a,#0b070d)!important;
  }
  #profileCompletionDialog .profile-completion-shell::before{
    content:"";
    display:block;
    position:sticky;
    z-index:7;
    top:7px;
    width:46px;
    height:4px;
    margin:7px auto -11px;
    border-radius:999px;
    background:rgba(255,255,255,.22);
  }
  #profileCompletionDialog .profile-completion-hero{
    display:block!important;
    position:relative!important;
    min-height:260px!important;
    border-bottom:1px solid rgba(91,137,208,.18)!important;
  }
  #profileCompletionDialog .profile-completion-copy{
    position:relative!important;
    z-index:3!important;
    padding:30px 19px 22px!important;
  }
  #profileCompletionDialog .profile-completion-kicker{font-size:9px!important;letter-spacing:.12em!important;}
  #profileCompletionDialog .profile-completion-copy h2{
    max-width:82%!important;
    margin:17px 0 9px!important;
    color:#f8fbff!important;
    font-size:clamp(36px,10.5vw,48px)!important;
    line-height:.96!important;
    letter-spacing:-.05em!important;
  }
  #profileCompletionDialog .profile-completion-copy>p{
    max-width:82%!important;
    margin:0!important;
    color:#b5c2d2!important;
    font-size:11px!important;
    line-height:1.5!important;
  }
  #profileCompletionDialog .profile-completion-visual{
    position:absolute!important;
    inset:0!important;
    min-height:0!important;
  }
  #profileCompletionDialog .profile-completion-visual img{object-position:center 38%!important;filter:saturate(.90)!important;}
  #profileCompletionDialog.sensual .profile-completion-visual img{object-position:center 18%!important;}
  #profileCompletionDialog .profile-completion-visual::after{
    background:
      linear-gradient(180deg,rgba(6,12,22,.14),rgba(6,12,22,.24) 48%,#0d1b2e 98%),
      linear-gradient(90deg,rgba(6,12,22,.88) 0%,rgba(6,12,22,.62) 50%,rgba(6,12,22,.14) 100%)!important;
  }
  #profileCompletionDialog.sensual .profile-completion-visual::after{
    background:
      linear-gradient(180deg,rgba(16,7,12,.10),rgba(16,7,12,.22) 48%,#220d1a 98%),
      linear-gradient(90deg,rgba(22,7,15,.89) 0%,rgba(22,7,15,.63) 50%,rgba(22,7,15,.12) 100%)!important;
  }
  #profileCompletionDialog .profile-completion-body{padding:12px 13px max(15px,env(safe-area-inset-bottom))!important;}
  #profileCompletionDialog .profile-completion-cards{grid-template-columns:1fr!important;gap:7px!important;}
  #profileCompletionDialog .profile-completion-card{
    align-items:center!important;
    min-height:68px!important;
    padding:11px 12px!important;
    border-color:rgba(83,132,207,.23)!important;
    border-radius:15px!important;
    background:linear-gradient(180deg,rgba(10,23,41,.88),rgba(7,16,29,.96))!important;
  }
  #profileCompletionDialog.sensual .profile-completion-card{
    border-color:rgba(180,60,108,.24)!important;
    background:linear-gradient(180deg,rgba(36,12,28,.88),rgba(20,8,18,.96))!important;
  }
  #profileCompletionDialog .profile-completion-icon{flex-basis:39px!important;width:39px!important;height:39px!important;border-radius:12px!important;}
  #profileCompletionDialog .profile-completion-icon svg{width:20px!important;height:20px!important;}
  #profileCompletionDialog .profile-completion-card b{font-size:12px!important;}
  #profileCompletionDialog .profile-completion-card p{margin-top:3px!important;font-size:10px!important;line-height:1.35!important;}

  #profileCompletionDialog .profile-completion-location{
    margin-top:8px!important;
    padding:13px!important;
    border-color:rgba(88,136,210,.25)!important;
    border-radius:16px!important;
    background:rgba(7,16,29,.78)!important;
  }
  #profileCompletionDialog.sensual .profile-completion-location{border-color:rgba(181,60,108,.26)!important;background:rgba(22,8,18,.80)!important;}
  #profileCompletionDialog .profile-completion-location-head b{font-size:12px!important;}
  #profileCompletionDialog .profile-completion-location-status{font-size:10px!important;line-height:1.4!important;}
  #profileCompletionDialog .profile-completion-location-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
    margin-top:10px!important;
  }
  #profileCompletionDialog .profile-completion-location-actions button,
  #profileCompletionDialog .profile-completion-postcode button{
    min-height:44px!important;
    border-radius:12px!important;
    font-size:10.5px!important;
    font-weight:850!important;
  }
  #profileCompletionDialog .profile-completion-postcode{
    grid-template-columns:1fr!important;
    gap:7px!important;
    margin-top:8px!important;
  }
  #profileCompletionDialog .profile-completion-postcode input,
  #profileCompletionDialog .profile-completion-postcode select{
    width:100%!important;
    min-height:45px!important;
    border-radius:12px!important;
    font-size:14px!important;
  }
  #profileCompletionDialog .profile-completion-footer{
    position:sticky!important;
    z-index:8!important;
    bottom:0!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
    margin:10px -2px 0!important;
    padding:9px 2px 2px!important;
    background:linear-gradient(180deg,rgba(6,12,22,0),rgba(6,12,22,.94) 28%,#060c16 55%)!important;
  }
  #profileCompletionDialog.sensual .profile-completion-footer{
    background:linear-gradient(180deg,rgba(11,7,13,0),rgba(11,7,13,.95) 28%,#0b070d 55%)!important;
  }
  #profileCompletionDialog .profile-completion-primary,
  #profileCompletionDialog .profile-completion-secondary{
    width:100%!important;
    min-height:49px!important;
    border-radius:13px!important;
    font-weight:950!important;
  }
  #profileCompletionDialog .profile-completion-skip{
    display:block!important;
    width:100%!important;
    min-height:40px!important;
    margin:5px 0 0!important;
    color:#8695aa!important;
    font-size:10px!important;
  }

  /* Shared area chooser: same privacy choices, mobile premium sheet. */
  #locationChoiceDialog{
    align-items:flex-end!important;
    padding:0!important;
    background:rgba(3,6,11,.86)!important;
    backdrop-filter:blur(12px)!important;
  }
  #locationChoiceDialog .location-choice-card{
    width:100%!important;
    max-width:560px!important;
    max-height:92dvh!important;
    margin:0 auto!important;
    overflow:auto!important;
    border:1px solid rgba(72,133,224,.30)!important;
    border-bottom:0!important;
    border-radius:25px 25px 0 0!important;
    background:linear-gradient(180deg,#0d1a2c,#060c16)!important;
    box-shadow:0 -22px 64px rgba(0,0,0,.52)!important;
  }
  #locationChoiceDialog .dialog-head{padding:19px 15px 13px!important;}
  #locationChoiceDialog .dialog-head h2{font-size:23px!important;line-height:1.05!important;letter-spacing:-.035em!important;}
  #locationChoiceDialog .dialog-body{padding:12px 13px max(15px,env(safe-area-inset-bottom))!important;}
  #locationChoiceDialog .location-choice-options{display:grid!important;gap:8px!important;}
  #locationChoiceDialog .location-choice-option{
    min-height:74px!important;
    padding:13px!important;
    border:1px solid rgba(82,131,207,.24)!important;
    border-radius:15px!important;
    background:linear-gradient(180deg,rgba(11,24,42,.91),rgba(7,16,29,.98))!important;
    text-align:left!important;
  }
  #locationChoiceDialog .location-choice-option b{font-size:12px!important;}
  #locationChoiceDialog .location-choice-option span{font-size:10px!important;line-height:1.4!important;color:#8f9db1!important;}
  #locationChoiceDialog .location-choice-postcode{grid-template-columns:1fr!important;gap:7px!important;}
  #locationChoiceDialog .location-choice-postcode input,
  #locationChoiceDialog .location-choice-postcode select,
  #locationChoiceDialog .location-choice-postcode button{min-height:45px!important;border-radius:12px!important;}
  #locationChoiceDialog .location-choice-status{margin-top:9px!important;padding:10px 11px!important;border-radius:12px!important;font-size:10px!important;}

  @media (max-width: 390px) {
    #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding{padding:10px!important;}
    #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-onboarding-banner{padding:14px 13px!important;}
    #screen-profile:not(.viewing-other-profile) .profile-onboarding-banner b{font-size:22px!important;}
    #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-editor-identity{grid-template-columns:66px minmax(0,1fr)!important;padding:10px!important;}
    #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .editor-avatar{width:66px!important;height:66px!important;flex-basis:66px!important;}
    #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .profile-form-section{padding:12px!important;}
    #screen-profile:not(.viewing-other-profile) .profile-editor.profile-onboarding .choice-chip{min-height:37px!important;padding-inline:9px!important;font-size:10px!important;}
    #sensualIntroDialog .sensual-intro-hero{min-height:270px!important;}
    #sensualIntroDialog .sensual-intro-copy{padding:29px 16px 19px!important;}
    #profileCompletionDialog .profile-completion-hero{min-height:240px!important;}
    #profileCompletionDialog .profile-completion-copy{padding:27px 16px 18px!important;}
    #profileCompletionDialog .profile-completion-copy h2{font-size:36px!important;max-width:88%!important;}
    #profileCompletionDialog .profile-completion-copy>p{max-width:88%!important;}
    #profileCompletionDialog .profile-completion-location-actions{grid-template-columns:1fr!important;}
    #locationChoiceDialog .dialog-head h2{font-size:21px!important;}
  }
}
