/* The document is RTL; keep the homepage's visual order in that direction too. */
.home-sections .activity-panel,
.home-sections .people-panel,
.home-sections .safety-pair,
.home-sections .trust-panel,
.home-sections .category-grid,
.home-sections .profile-grid,
.home-sections .trust-items,
.home-sections .app-strip,
.home-sections .stat-cards,
.home-sections .panel-heading {
  direction: rtl;
}
.home-sections .section-caption,
.home-sections .app-copy { text-align: right; }
.explore-page .explore-results { direction: rtl; }
.home-sections .all-activities { right: auto; left: 18px; }
.home-sections .step:not(:last-child)::after { content: '‹'; direction: ltr; unicode-bidi: isolate; }
.home-sections .app-strip { grid-template-columns: 280px 245px minmax(0, 1fr); }
.home-sections .app-copy { order: -1; }
.home-sections .stat-cards { border-left: 0; border-right: 1px solid #d9d6d1; padding-left: 0; padding-right: 20px; }
.home-sections .security-banner::after { background: linear-gradient(to left, #302b60ef, #302b6090 55%, transparent); }
.home-sections .security-banner > div:last-child { margin-right: 0; margin-left: auto; text-align: right; }
.home-sections .security-banner > div > svg { float: right; margin-right: 0; margin-left: 14px; }
.footer-grid { direction: rtl; text-align: right; }
.footer-brand { order: -1; direction: rtl; }
@media (max-width: 1200px) {
  .home-sections .app-strip { grid-template-columns: 255px 230px minmax(0, 1fr); }
}
@media (max-width: 950px) {
  .home-sections .app-strip { grid-template-columns: 230px 180px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .home-sections .all-activities { left: 13px; }
  .home-sections .app-strip { grid-template-columns: minmax(0, 1fr) 95px; }
  .home-sections .stat-cards { border-right: 0; padding-right: 0; }
  .footer-brand { justify-content: flex-start; }
}

/* Landing-page text and controls must stay readable at every breakpoint. */
.home-sections .activity-panel {
  grid-template-areas: 'caption cards' 'more cards';
  grid-template-rows: auto 1fr;
  align-items: start;
}
.home-sections .activity-panel .section-caption { grid-area: caption; }
.home-sections .activity-panel .category-grid { grid-area: cards; }
.home-sections .all-activities {
  grid-area: more;
  position: static;
  align-self: start;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.7;
}
.home-sections .panel-heading .text-link {
  min-height: 44px;
  align-items: center;
  padding-top: 0;
  font-size: 14px;
  white-space: normal;
}
.home-sections .section-caption p,
.home-sections .panel-heading p,
.home-sections .step p,
.home-sections .trust-items p,
.home-sections .app-copy p { font-size: 13px; line-height: 1.9; }
.home-sections .activity-tile { min-height: 128px; }
.home-sections .activity-tile b { font-size: 14px; }
.home-sections .activity-tile small { font-size: 11px; line-height: 1.6; }
.home-sections .people-panel .section-caption .btn,
.home-sections .security-banner span { font-size: 13px; min-height: 44px; }
.home-sections .security-banner span { display: inline-flex; align-items: center; }
.home-sections .person-info h3 { font-size: 14px !important; }
.home-sections .person-info p { font-size: 12px; line-height: 1.9; }
.home-sections .person-info small,
.home-sections .person-info .chip { font-size: 11px; }
.home-sections .trust-items h3 { font-size: 14px; }
.home-sections .stats-note,
.home-sections .sample-caption { font-size: 11px; }
.footer h3 { font-size: 14px; }
.footer a:not(.footer-brand) { font-size: 13px; min-height: 40px; display: flex; align-items: center; }
.footer-brand > span, .footer-contact small { font-size: 12px; white-space: normal; }
.footer-activities { gap: 2px 16px; }
.real-companion-image { display: grid; place-items: center; min-height: 140px; background: linear-gradient(135deg,#e7e9fa,#d6ebdf); color: #514bc5; font-size: 48px; font-weight: 700; border-radius: 14px 14px 0 0; }
.real-profile { max-width: 720px; margin: auto; }
.real-profile-header { display: flex; align-items: center; gap: 18px; margin-bottom: 25px; }
.real-profile-avatar { display: grid; place-items: center; width: 84px; height: 84px; flex: none; border-radius: 50%; background: #e7e9fa; color: #514bc5; font-size: 34px; font-weight: 700; }
.real-companion-image.has-photo { aspect-ratio:1/1; overflow:hidden; }
.real-profile-avatar { overflow:hidden; }
.profile-photo-img { width:100%; height:100%; object-fit:cover; }
.real-profile h3 { margin-top: 24px; }
.real-profile > .btn { margin-top: 20px; }
.social-profile-actions,.social-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
#companion-social-action { display:flex; flex-wrap:wrap; gap:10px; }
.social-row { display:flex; justify-content:space-between; align-items:center; gap:16px; border-bottom:1px solid #e8e9f0; padding:16px 0; }
.social-row p { margin:4px 0; color:#687286; }
.social-row small,.social-chat-link small { color:#687286; }
.social-ticket { border:1px solid #e8e9f0; border-radius:14px; padding:16px; margin:12px 0; }
.social-ticket > p { margin:8px 0; }
.social-ticket form { margin-top:12px; }
.social-follow-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin-top:25px; }
.social-person,.social-chat-link { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px; border:1px solid #e8e9f0; border-radius:12px; margin-top:8px; }
.social-chat-link.active { background:#eeedff; border-color:#b6b1ef; }
.social-chat-layout { display:grid; grid-template-columns:minmax(150px,220px) minmax(0,1fr); gap:20px; }
.social-message-history { height:300px; overflow:auto; background:#f7f7fc; border-radius:14px; padding:14px; margin:10px 0; }
.social-older { display:block; margin:0 auto 12px; }
.social-message { width:fit-content; max-width:85%; padding:8px 12px; border-radius:12px; background:#fff; margin-bottom:8px; overflow-wrap:anywhere; }
.social-message.mine { background:#e7e5ff; margin-right:auto; }
.social-message small { color:#687286; font-size:10px; }
.social-message-form { display:flex; gap:8px; }
.social-message-form input { min-width:0; flex:1; border:1px solid #d8dbe4; padding:10px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(max-width:600px){.social-chat-layout,.social-follow-grid{grid-template-columns:1fr}.social-row{align-items:stretch;flex-direction:column}}
.companion-event { display:flex; justify-content:space-between; align-items:center; gap:15px; border:1px solid #e7e9ee; border-radius:14px; padding:14px 16px; margin-top:10px; }
.companion-event p { margin:4px 0; }
.companion-event small { color:#687286; }
@media(max-width:480px){.companion-event{align-items:stretch;flex-direction:column}.companion-event .btn{width:100%}}
.seed-portrait { background-image: url('/assets/local-seed-portraits.png'); background-size: 200% 200%; background-repeat: no-repeat; }
.real-companion-image.seed-portrait { aspect-ratio: 1 / 1; }
.real-companion-image { position: relative; }
.real-companion-image .seed-label { position:absolute; inset-block-start:10px; inset-inline-start:10px; padding:3px 9px; border-radius:20px; background:#fff; color:#3d3565; font-size:11px; font-weight:700; }
.seed-portrait-0 { background-position: 0 0; }
.seed-portrait-1 { background-position: 100% 0; }
.seed-portrait-2 { background-position: 0 100%; }
.seed-portrait-3 { background-position: 100% 100%; }
@media (max-width: 950px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .home-sections .activity-panel { display: flex; flex-direction: column; align-items: stretch; }
  .home-sections .activity-panel .category-grid { order: 1; margin-top: 14px; }
  .home-sections .all-activities { order: 2; margin-top: 8px; }
  .home-sections .panel-heading { flex-wrap: wrap; }
  .home-sections .panel-heading .text-link { font-size: 13px; }
  .home-sections .people-panel .section-caption .btn { font-size: 13px; min-height: 44px; }
  .home-sections .activity-tile small { font-size: 11px; }
  .home-sections .person-info { padding: 10px; }
  .home-sections .person-info h3 { font-size: 13px !important; }
  .home-sections .person-info p { font-size: 12px; }
  .home-sections .person-info small, .home-sections .person-info .chip { font-size: 10px; }
  .footer a:not(.footer-brand) { font-size: 13px; }
}

/* Public profiles: keep identity, real activity, and actions together in RTL. */
.profile-page { max-width: 1050px; padding-block: 34px 72px; text-align: right; }
.profile-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; color: #4d48b8; font-weight: 700; font-size: 14px; }
.profile-back svg { width: 18px; height: 18px; transform: rotate(180deg); }
.profile-shell { overflow: hidden; background: #fff; border: 1px solid #e5e6ef; border-radius: 24px; box-shadow: 0 16px 45px #35355d0d; }
.profile-identity { display: flex; direction: rtl; align-items: flex-start; gap: 38px; padding: 42px 46px; background: linear-gradient(125deg,#fff 40%,#f6f5ff); }
.profile-avatar-ring { flex: none; padding: 5px; border-radius: 50%; background: linear-gradient(135deg,#655ae4,#b4d894); }
.profile-avatar-ring .real-profile-avatar { width: 148px; height: 148px; border: 5px solid #fff; font-size: 50px; }
.profile-identity-content { flex: 1; min-width: 0; }
.profile-name-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.profile-name-row h1 { margin: 3px 0 6px; font-size: clamp(25px,3vw,34px); line-height: 1.4; }
.profile-eyebrow { color: #655cce; font-size: 12px; font-weight: 700; }
.profile-location { display: flex; align-items: center; gap: 5px; margin: 0; color: #68708b; font-size: 14px; }
.profile-username { color: #655cce; font-size: 14px; text-align: right; margin: 0 0 6px; }
.profile-location svg { width: 17px; height: 17px; }
.profile-fictional { flex: none; border-radius: 20px; padding: 5px 11px; background: #eeeafa; color: #514985; font-size: 12px; font-weight: 700; }
.profile-fictional-note { margin: 12px 0 0; color: #69708a; font-size: 12px; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 30px; margin: 21px 0; }
.profile-stats > div { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: #68708b; }
.profile-stats b { color: #24244f; font-size: 19px; }
.profile-stat-button { display:flex; align-items:baseline; gap:6px; padding:0; background:transparent; color:inherit; text-align:inherit; }
.profile-stat-button:hover span { color:#514bc5; text-decoration:underline; }
#profile-connections .social-row small { display:block; color:#687286; }
.profile-identity .social-profile-actions, .profile-identity #companion-social-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.profile-identity .social-profile-actions .btn { min-height: 44px; }
.profile-content { display: grid; direction: rtl; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.4fr); gap: 38px; padding: 38px 46px 48px; border-top: 1px solid #eeedf4; }
.profile-about section + section { margin-top: 30px; }
.profile-content h2 { margin: 0 0 11px; font-size: 16px; }
.profile-about p { margin: 0; color: #606981; font-size: 14px; line-height: 2; }
.profile-interests { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-interests span { padding: 7px 13px; border-radius: 20px; background: #f0effc; color: #5149b7; font-size: 13px; font-weight: 700; }
.profile-section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.profile-section-heading h2 { margin: 4px 0 0; font-size: 19px; }
.profile-section-heading > svg { width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: #eeeefd; color: #5751da; }
.profile-activity .companion-event { background: #fafaff; border-color: #ececf5; }
.profile-activity .companion-event p { font-size: 13px; }
.profile-reviews { margin-top: 32px; padding-top: 24px; border-top: 1px solid #eeedf4; }
.profile-activity > div > .muted,.profile-reviews > .muted { padding: 22px; border: 1px dashed #dadbeb; border-radius: 14px; color: #69708a; font-size: 14px; }
@media(max-width:700px){
  .profile-page { padding-block: 20px 50px; }
  .profile-identity { gap: 18px; padding: 26px 22px; }
  .profile-avatar-ring .real-profile-avatar { width: 86px; height: 86px; border-width: 3px; font-size: 32px; }
  .profile-name-row h1 { font-size: 23px; }
  .profile-stats { gap: 13px; margin: 16px 0; }
  .profile-stats > div { flex-direction: column; align-items: center; gap: 0; font-size: 11px; }
  .profile-stats b { font-size: 17px; }
  .profile-stat-button { flex-direction:column; align-items:center; gap:0; }
  .profile-content { grid-template-columns: 1fr; gap: 30px; padding: 28px 22px 36px; }
  .profile-about section + section { margin-top: 22px; }
}
@media(max-width:420px){
  .profile-identity { gap: 14px; }
  .profile-name-row { flex-wrap: wrap; }
  .profile-identity .social-profile-actions .btn { width: 100%; }
  .profile-identity #companion-follow-action,.profile-identity #companion-social-action { width: 100%; }
  .profile-identity #companion-social-action .btn { flex: 1 1 100%; }
}
jdp-container svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
input[data-jdp] { text-align: right; cursor: pointer; }
.jalali-done { display: block; width: calc(100% - 20px); min-height: 42px; margin: 8px 10px 10px; background: #5953dc; color: #fff; border-radius: 10px; font-weight: 700; }
.discovery-search { grid-template-columns: repeat(4,minmax(0,1fr)) auto; }
.discovery-name input { width:100%; min-width:0; border:0; background:transparent; color:inherit; outline-offset:2px; font-size:14px; }
.discovery-pagination { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:14px; margin:24px 0; }
@media(max-width:760px){.discovery-search { grid-template-columns:1fr 1fr; }.discovery-name input { font-size:13px; }.discovery-search>.btn { grid-column:1/-1; }}

/* Homepage accessibility and responsive polish. */
.home-sections .section-caption p,
.home-sections .panel-heading p,
.home-sections .step p,
.home-sections .trust-items p,
.home-sections .app-copy p { font-size: 15px; line-height: 1.85; }
.home-sections .activity-tile { gap: 6px; padding: 12px 8px; }
.home-sections .activity-tile b { font-size: 15px; }
.home-sections .activity-tile small { font-size: 12px; line-height: 1.6; }
.home-sections .person-info h3 { font-size: 15px !important; }
.home-sections .person-info p { font-size: 13px; line-height: 1.8; }
.home-sections .person-info small,
.home-sections .person-info .chip { font-size: 12px; }
.home-sections .all-activities,
.home-sections .panel-heading .text-link { font-size: 15px; }
.home-sections .security-banner { background: #514bc5; }
.home-sections .security-banner .security-image,
.home-sections .security-banner::after { display: none; }
.home-sections .security-banner > div:last-child { position: relative; z-index: 1; max-width: 360px; }
.home-sections .security-banner p { font-size: 14px; }
.home-sections .app-strip { grid-template-columns: minmax(0,1fr) minmax(180px,245px); align-items: center; gap: 24px; }
.home-sections .app-copy { order: 0; }
.home-sections .app-copy p { max-width: 48ch; margin-block: 8px 14px; }
.home-sections .app-copy .btn { min-height: 44px; }
.home-sections .app-phones { order: 1; }
.footer h3 { font-size: 15px; }
.footer a:not(.footer-brand) { font-size: 14px; min-height: 44px; }
.footer-brand > span, .footer-contact small { font-size: 13px; }
.header .signup-btn, .header .login-btn { min-height: 44px; }
.mobile-toggle { min-width: 44px; min-height: 44px; }
:where(a,button,input,select,textarea):focus-visible { outline: 3px solid #6557ec; outline-offset: 3px; }
@media (max-width: 760px) {
  .home-sections .activity-tile { min-height: 138px; }
  .home-sections .activity-tile small { font-size: 12px; }
  .home-sections .person-info h3 { font-size: 14px !important; }
  .home-sections .person-info p { font-size: 13px; }
  .home-sections .person-info small, .home-sections .person-info .chip { font-size: 12px; }
  .home-sections .panel-heading .text-link { font-size: 15px; }
  .home-sections .app-strip { grid-template-columns: minmax(0, 1fr) 110px; gap: 12px; }
  .home-sections .app-copy { grid-column: 1; }
  .home-sections .app-phones { grid-column: 2; grid-row: 1; }
}
@media (max-width: 360px) {
  .home-sections .category-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-sections .app-strip { grid-template-columns: 1fr; }
  .home-sections .app-phones { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .home-sections *, .header * { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media (max-width: 760px) {
  .home-sections .security-banner > div:last-child { width: 100%; max-width: none; }
  .home-sections .app-strip { grid-template-columns: 1fr; }
  .home-sections .app-phones { display: none; }
}

/* Keep the hero image full-bleed and size its crop to the hero height. */
@media (min-width: 761px) {
  .home-hero.reference-hero { max-width: none; }
  .home-hero .hero-reference { position: absolute; right: 0; top: 0; height: 100%; width: auto; min-width: 100%; aspect-ratio: 691 / 374; }
}
@media (min-width: 761px) and (max-width: 1050px) {
  .home-hero.reference-hero { height: auto; min-height: 400px; }
  .home-hero .hero-inner { min-height: 400px; }
  .home-hero .hero-copy { width: 41%; margin-left: 0; padding: 28px 0; }
  .home-hero h1 { font-size: clamp(30px, 4vw, 40px); letter-spacing: 0; }
  .home-hero .hero-actions { direction: rtl; justify-content: flex-start; flex-wrap: wrap; }
  .home-hero .hero-actions .btn { padding: 8px 15px; min-width: 0; }
  .home-sections .activity-panel { display: flex; flex-direction: column; align-items: stretch; }
  .home-sections .activity-panel .category-grid { order: 1; grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 14px; }
  .home-sections .all-activities { order: 2; margin-top: 8px; }
}
@media (min-width: 761px) and (max-width: 1050px) {
  .home-hero .hero-art { mask-image: linear-gradient(to right, transparent 0%, transparent 12%, #000 42%); }
}

/* The hero uses a dedicated photograph instead of a crop from the reference screenshot. */
.home-hero .hero-art .home-hero-photo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 64% center;
}
@media (max-width: 760px) {
  .home-hero .hero-art { aspect-ratio: 16 / 9; max-height: none; }
  .home-hero .hero-art .home-hero-photo { position: absolute; inset: 0; }
}

/* Align both sides of the hero with the header and the sections below it. */
@media (min-width: 761px) {
  .home-hero.reference-hero {
    width: calc(100% - 110px);
    max-width: 1290px;
    border-radius: 0 0 20px 20px;
  }
  .home-hero .hero-inner { width: 100%; }
}
@media (min-width: 761px) {
  .home-hero.reference-hero { margin-inline: auto; }
}

/* Profile identity, actions, and content stay visually grouped. */
.profile-identity { gap: 30px; padding: 36px 42px; }
.profile-name-row { justify-content: flex-start; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-name-row h1 { margin: 0 0 3px; }
.profile-fictional { align-self: center; padding: 4px 10px; font-size: 11px; }
.profile-stats { gap: 12px 28px; margin: 20px 0 22px; }
.profile-stats > div { min-height: 32px; }
.profile-identity .social-profile-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.profile-identity #companion-follow-action,
.profile-identity #companion-social-action { display: contents; }
.profile-identity .social-profile-actions .btn { min-height: 46px; padding-inline: 20px; }
.profile-content { gap: 34px; }
.profile-about p { line-height: 2; }
@media (max-width: 700px) {
  .profile-identity { gap: 16px; padding: 24px 20px; }
  .profile-name-row { gap: 8px; }
  .profile-stats { margin: 16px 0; gap: 12px 18px; }
  .profile-identity .social-profile-actions .btn { flex: 1 1 auto; padding-inline: 14px; }
}
@media (max-width: 420px) {
  .profile-identity .social-profile-actions .btn { flex: 1 1 calc(50% - 9px); width: auto; }
}
@media (max-width: 700px) {
  .profile-identity { display: block; position: relative; }
  .profile-avatar-ring { position: absolute; inset-block-start: 24px; inset-inline-start: 20px; }
  .profile-name-row { min-height: 100px; padding-inline-start: 110px; }
  .profile-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .profile-stats > div { text-align: center; }
  .profile-identity .social-profile-actions .btn { flex: 1 1 calc(50% - 9px); width: auto; }
}
@media (max-width: 700px) {
  .profile-identity #companion-social-action .btn,
  .profile-identity #companion-follow-action .btn { flex: 1 1 calc(50% - 9px); width: auto; }
}
