/* AIAI_MOBILE_PUBLIC_DESIGN_SYSTEM_CONVERGENCE_R1
   Purpose: converge mobile public typography, geometry and touch sizing
   without changing product semantics, routing, data, ranking or desktop.
   Scope: accepted mobile public surfaces only.
*/

@media (max-width:767px){
  :root{
    --aiai-ds-font-ui:"IBM Plex Sans Arabic","Tajawal","Segoe UI",Tahoma,Arial,sans-serif;
    --aiai-ds-font-display:"Readex Pro","IBM Plex Sans Arabic","Tajawal",sans-serif;
    --aiai-ds-font-editorial:"Amiri","Noto Naskh Arabic","Traditional Arabic",serif;
    --aiai-ds-header-h:68px;
    --aiai-ds-touch:44px;
    --aiai-ds-gutter-ui:17px;
    --aiai-ds-gutter-reading:20px;
    --aiai-ds-gutter-landing:20px;
    --aiai-ds-text:13px;
    --aiai-ds-text-small:11px;
    --aiai-ds-title-page:clamp(29px,7.6vw,32px);
    --aiai-ds-title-section:20px;
  }

  /* ---------- Common font rendering ---------- */
  body.aiai-mobile-home-product-r1,
  body.page-compare.compare-clean-r17,
  body.page-decision-wizard,
  body.aiai-decision-state-r1,
  body.page-explorer,
  body.page-changes,
  body.trust-integrity-page,
  body.page-tools-index,
  body.page-tool{
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
  }

  body.aiai-mobile-home-product-r1,
  body.page-compare.compare-clean-r17,
  body.page-explorer,
  body.page-changes,
  body.trust-integrity-page,
  body.page-tools-index,
  body.page-tool{
    font-family:var(--aiai-ds-font-ui)!important;
  }

  body.page-compare.compare-clean-r17 :where(button,a,input,select,textarea),
  body.page-explorer :where(button,a,input,select,textarea),
  body.page-changes :where(button,a,input,select,textarea),
  body.trust-integrity-page :where(button,a,input,select,textarea),
  body.page-tools-index :where(button,a,input,select,textarea),
  body.page-tool :where(button,a,input,select,textarea){
    font-family:inherit;
  }

  /* ---------- Shared mobile header geometry ---------- */
  body.aiai-mobile-home-product-r1 > .aiai-global-mobile-head-v1,
  body.page-compare.compare-clean-r17 > .aiai-global-mobile-head-v1,
  body.page-decision-wizard > .aiai-global-mobile-head-v1,
  body.page-explorer > .aiai-global-mobile-head-v1,
  body.page-changes > .aiai-global-mobile-head-v1,
  body.trust-integrity-page > .aiai-global-mobile-head-v1,
  body.page-tools-index > .aiai-global-mobile-head-v1,
  body.page-tool > .aiai-global-mobile-head-v1{
    min-height:var(--aiai-ds-header-h)!important;
  }

  body.aiai-mobile-home-product-r1 .aiai-global-mobile-head__inner,
  body.page-compare.compare-clean-r17 .aiai-global-mobile-head__inner,
  body.page-decision-wizard .aiai-global-mobile-head__inner,
  body.page-explorer .aiai-global-mobile-head__inner,
  body.page-changes .aiai-global-mobile-head__inner,
  body.trust-integrity-page .aiai-global-mobile-head__inner,
  body.page-tools-index .aiai-global-mobile-head__inner,
  body.page-tool .aiai-global-mobile-head__inner{
    width:min(100%,430px)!important;
    min-height:var(--aiai-ds-header-h)!important;
    margin-inline:auto!important;
    padding:calc(8px + env(safe-area-inset-top,0px)) var(--aiai-ds-gutter-ui) 8px!important;
    grid-template-columns:var(--aiai-ds-touch) minmax(0,1fr) var(--aiai-ds-touch)!important;
    gap:0!important;
    box-sizing:border-box!important;
  }

  body.aiai-mobile-home-product-r1 :where(.aiai-global-mobile-head__account,.aiai-global-mobile-head__menu,.aiai-global-mobile-head__spacer),
  body.page-compare.compare-clean-r17 :where(.aiai-global-mobile-head__account,.aiai-global-mobile-head__menu,.aiai-global-mobile-head__spacer),
  body.page-decision-wizard :where(.aiai-global-mobile-head__account,.aiai-global-mobile-head__menu,.aiai-global-mobile-head__spacer),
  body.page-explorer :where(.aiai-global-mobile-head__account,.aiai-global-mobile-head__menu,.aiai-global-mobile-head__spacer),
  body.page-changes :where(.aiai-global-mobile-head__account,.aiai-global-mobile-head__menu,.aiai-global-mobile-head__spacer),
  body.trust-integrity-page :where(.aiai-global-mobile-head__account,.aiai-global-mobile-head__menu,.aiai-global-mobile-head__spacer),
  body.page-tools-index :where(.aiai-global-mobile-head__account,.aiai-global-mobile-head__menu,.aiai-global-mobile-head__spacer),
  body.page-tool :where(.aiai-global-mobile-head__account,.aiai-global-mobile-head__menu,.aiai-global-mobile-head__spacer){
    width:var(--aiai-ds-touch)!important;
    height:var(--aiai-ds-touch)!important;
    min-width:var(--aiai-ds-touch)!important;
    min-height:var(--aiai-ds-touch)!important;
    max-width:var(--aiai-ds-touch)!important;
    max-height:var(--aiai-ds-touch)!important;
  }

  body.aiai-mobile-home-product-r1 .aiai-global-mobile-head__brand,
  body.page-compare.compare-clean-r17 .aiai-global-mobile-head__brand,
  body.page-decision-wizard .aiai-global-mobile-head__brand,
  body.page-explorer .aiai-global-mobile-head__brand,
  body.page-changes .aiai-global-mobile-head__brand,
  body.trust-integrity-page .aiai-global-mobile-head__brand,
  body.page-tools-index .aiai-global-mobile-head__brand,
  body.page-tool .aiai-global-mobile-head__brand{
    width:84px!important;
    height:42px!important;
    min-width:84px!important;
    min-height:42px!important;
    max-width:84px!important;
    max-height:42px!important;
  }

  body.aiai-mobile-home-product-r1 .aiai-global-mobile-head__brand img,
  body.page-compare.compare-clean-r17 .aiai-global-mobile-head__brand img,
  body.page-decision-wizard .aiai-global-mobile-head__brand img,
  body.page-explorer .aiai-global-mobile-head__brand img,
  body.page-changes .aiai-global-mobile-head__brand img,
  body.trust-integrity-page .aiai-global-mobile-head__brand img,
  body.page-tools-index .aiai-global-mobile-head__brand img,
  body.page-tool .aiai-global-mobile-head__brand img{
    width:84px!important;
    max-width:84px!important;
    max-height:42px!important;
    object-fit:contain!important;
  }

  /* ---------- Home ---------- */
  body.aiai-mobile-home-product-r1 .aiai-home-r1{
    padding-inline:var(--aiai-ds-gutter-landing)!important;
  }
  body.aiai-mobile-home-product-r1 .aiai-home-r1__hero h1{
    font-family:var(--aiai-ds-font-display)!important;
  }
  body.aiai-mobile-home-product-r1 .aiai-home-r1__hero>p{
    font-family:var(--aiai-ds-font-ui)!important;
    font-size:12px!important;
    line-height:1.7!important;
  }
  body.aiai-mobile-home-product-r1 .aiai-home-r1__examples-head,
  body.aiai-mobile-home-product-r1 .aiai-home-r1__example,
  body.aiai-mobile-home-product-r1 .aiai-home-r1__example--summary,
  body.aiai-mobile-home-product-r1 .aiai-home-r1__footer{
    font-size:var(--aiai-ds-text-small)!important;
  }

  /* ---------- Compare ---------- */
  body.page-compare.compare-clean-r17{
    font-family:var(--aiai-ds-font-ui)!important;
  }
  body.page-compare.compare-clean-r17 .cmpv4-mobile{
    font-family:var(--aiai-ds-font-ui)!important;
  }
  body.page-compare.compare-clean-r17 :where(.cmpv4-task,.cmpv4-priorities>header h2,.cmpv4-round>header h3,.cmpv4-quick h2){
    font-family:var(--aiai-ds-font-display)!important;
    letter-spacing:-.02em!important;
  }
  body.page-compare.compare-clean-r17 .cmpv4-task{
    font-size:24px!important;
    line-height:1.38!important;
    font-weight:600!important;
  }
  body.page-compare.compare-clean-r17 :where(
    .cmpv4-task-picker summary,
    .cmpv4-balance-top b,
    .cmpv4-pan small,
    .cmpv4-priorities>header div>small,
    .cmpv4-switcher>small,
    .cmpv4-tool-switch,
    .cmpv4-round-leader,
    .cmpv4-pay-path span,
    .cmpv4-pay-path b,
    .cmpv4-risk-card>small,
    .cmpv4-risk-legend,
    .cmpv4-quick-row span small
  ){
    font-size:var(--aiai-ds-text-small)!important;
  }
  body.page-compare.compare-clean-r17 .cmpv4-priority-dock button,
  body.page-compare.compare-clean-r17 .cmpv4-tool-switch{
    min-height:var(--aiai-ds-touch)!important;
  }

  /* ---------- Decision ---------- */
  body.page-decision-wizard .amd1,
  body.aiai-decision-state-r1 .amd1{
    font-family:var(--aiai-ds-font-ui)!important;
  }
  body.page-decision-wizard .amd1-wrap{
    padding-inline:var(--aiai-ds-gutter-reading)!important;
  }
  body.page-decision-wizard .amd1 :where(
    .amd1-entry>h1,
    .amd1-clarify>h1,
    .amd1-resolvehead h1,
    .amd1-resolvebody>h2,
    .amd1-gapbox h2,
    .amd1-clarifybox h2,
    .amd1-task h1
  ),
  body.aiai-decision-state-r1 :where(
    .amd1-task>h1,
    .amd1-resolvehead>h1,
    .amd1-clarify>h1
  ){
    font-family:var(--aiai-ds-font-display)!important;
    letter-spacing:-.02em!important;
  }
  body.page-decision-wizard .amd1 :where(.amd1-entry>h1,.amd1-clarify>h1,.amd1-resolvehead h1){
    font-size:30px!important;
    line-height:1.34!important;
  }
  body.aiai-decision-state-r1 :where(.amd1-task>h1,.amd1-resolvehead>h1,.amd1-clarify>h1){
    font-size:28px!important;
    line-height:1.4!important;
  }
  body.page-decision-wizard .amd1 :where(.amd1-entry>p,.amd1-clarify>p,.amd1-resolvehead p){
    font-family:var(--aiai-ds-font-ui)!important;
    font-size:13.5px!important;
    line-height:1.8!important;
  }
  body.page-decision-wizard .amd1-search input{
    font-family:var(--aiai-ds-font-ui)!important;
    font-size:15px!important;
  }
  body.aiai-decision-state-r1 :where(
    .amd1-eyebrow,
    .amd1-edit>summary,
    .amd1-edit label,
    .amd1-winnertext small,
    .amd1-rail dt,
    .amd1-micro,
    .amd1-secondary,
    .amd1-scope,
    .amd1-clarifycontext>span,
    .amd1-querycontext span,
    .amd1-querycontext>a,
    .amd1-status,
    .amd1-option small,
    .amd1-textlink,
    .amd1-retrybox label,
    .amd1-task-more>summary
  ){
    font-size:var(--aiai-ds-text-small)!important;
  }
  body.page-decision-wizard .amd1 :where(button,.amd1-search input),
  body.aiai-decision-state-r1 .amd1 :where(button,input[type="text"],input[type="search"]){
    min-height:var(--aiai-ds-touch)!important;
  }

  /* ---------- Explorer ---------- */
  body.page-explorer .aiai-mx{
    padding-inline:var(--aiai-ds-gutter-ui)!important;
    font-family:var(--aiai-ds-font-ui)!important;
  }
  body.page-explorer :where(.aiai-mx-intro h1,.aiai-mx-runway-head h2,.aiai-mx-tool-query h2){
    font-family:var(--aiai-ds-font-display)!important;
    letter-spacing:-.02em!important;
  }
  body.page-explorer .aiai-mx-intro h1{
    font-size:30px!important;
    line-height:1.38!important;
  }
  body.page-explorer :where(.aiai-mx-runway-head h2,.aiai-mx-tool-query h2){
    font-size:18px!important;
    line-height:1.5!important;
  }
  body.page-explorer :where(
    .aiai-mx-eyebrow,
    .aiai-mx-composer-label b,
    .aiai-mx-composer-label span,
    .aiai-mx-prompts b,
    .aiai-mx-prompts a,
    .aiai-mx-winner,
    .aiai-mx-pay small,
    .aiai-mx-actions>a,
    .aiai-mx-actions details,
    .aiai-mx-secondary-head span,
    .aiai-mx-pay-compact,
    .aiai-mx-stream-actions>a,
    .aiai-mx-more>summary span,
    .aiai-mx-more-list span
  ){
    font-size:var(--aiai-ds-text-small)!important;
  }
  body.page-explorer .aiai-mx-actions>a{
    min-height:var(--aiai-ds-touch)!important;
  }

  /* ---------- Changes / radar ---------- */
  body.page-changes{
    font-family:var(--aiai-ds-font-ui)!important;
  }
  body.page-changes :where(.changes-hub-copy h1,.changes-priority .changes-section-head h2::after,.changes-live-head h2){
    font-family:var(--aiai-ds-font-editorial)!important;
  }
  body.page-changes :where(.changes-hub-hero,.changes-control-shell,.changes-priority,.changes-live){
    padding-inline:var(--aiai-ds-gutter-ui)!important;
  }
  body.page-changes .changes-hub-copy>p:last-child{
    font-size:13px!important;
    line-height:1.75!important;
  }
  body.page-changes :where(
    .changes-feed-identity small,
    .changes-feed-title small,
    .changes-hub-copy .kicker,
    .changes-impact-switch button,
    .changes-priority-decision small,
    .changes-priority-foot a,
    .changes-feed-actions a
  ){
    font-size:var(--aiai-ds-text-small)!important;
  }
  body.page-changes .changes-impact-switch button,
  body.page-changes .changes-search-box{
    min-height:var(--aiai-ds-touch)!important;
  }

  /* ---------- Editorial trust pages ---------- */
  body.trust-integrity-page{
    font-family:var(--aiai-ds-font-ui)!important;
  }
  body.trust-integrity-page .trust-integrity-shell{
    width:calc(100% - (2 * var(--aiai-ds-gutter-reading)))!important;
  }
  body.trust-integrity-page :where(
    .trust-integrity-hero h1,
    .trust-section-head h2,
    .trust-integrity-promise h2,
    .trust-integrity-footer-card h2,
    .commercial-status-head h2
  ){
    font-family:var(--aiai-ds-font-editorial)!important;
  }
  body.trust-integrity-page .trust-integrity-hero-main h1{
    font-size:clamp(32px,8.5vw,38px)!important;
    line-height:1.22!important;
    letter-spacing:-.025em!important;
  }
  body.trust-integrity-page .trust-integrity-hero-main>p{
    font-family:var(--aiai-ds-font-ui)!important;
    font-size:13.5px!important;
    line-height:1.85!important;
  }
  body.trust-integrity-page .trust-section-head h2,
  body.trust-integrity-page .trust-section-head.compact h2{
    font-size:24px!important;
    line-height:1.38!important;
  }
  body.trust-integrity-page .trust-section-head p{
    font-size:13px!important;
    line-height:1.8!important;
  }
  body.trust-integrity-page :where(.trust-action-primary,.trust-action-secondary){
    min-height:var(--aiai-ds-touch)!important;
  }

  /* ---------- Tools directory ---------- */
  body.page-tools-index{
    font-family:var(--aiai-ds-font-ui)!important;
  }
  body.page-tools-index .aiai-tools-discovery-v1{
    padding-inline:var(--aiai-ds-gutter-ui)!important;
  }
  body.page-tools-index .aiai-tools-discovery-v1 h1{
    font-family:var(--aiai-ds-font-display)!important;
    font-size:31px!important;
    line-height:1.3!important;
    letter-spacing:-.02em!important;
  }
  body.page-tools-index .aiai-tools-discovery-v1__lead{
    font-family:var(--aiai-ds-font-ui)!important;
    font-size:12.5px!important;
    line-height:1.78!important;
  }
  body.page-tools-index .aiai-tools-discovery-v1__search input{
    font-family:var(--aiai-ds-font-ui)!important;
    font-size:14px!important;
  }

  /* ---------- Tool profile R20 ---------- */
  body.page-tool{
    font-family:var(--aiai-ds-font-ui)!important;
  }
  body.page-tool .r20-shell{
    padding-inline:var(--aiai-ds-gutter-ui)!important;
  }
  body.page-tool .r20-identity-copy h1,
  body.page-tool :where(.r20-signature-head h2,.r20-signature-final h2){
    font-family:var(--aiai-ds-font-display)!important;
  }
  body.page-tool .r20-identity-copy h1{
    font-size:30px!important;
    line-height:1.16!important;
  }
  body.page-tool :where(
    .r20-identity-kicker,
    .r20-registry small,
    .r20-secondary-link,
    .r20-muted-link,
    .r20-orientation-label,
    .r20-orientation-cell small,
    .r20-section-eyebrow,
    .r20-cap-name small,
    .r20-cap-note,
    .r20-signature-task small,
    .r20-signature-task a,
    .r20-plan-row small,
    .r20-pay-rule small,
    .r20-pay-rule a,
    .r20-signature-alt small,
    .r20-signature-alt a,
    .r20-signature-sources small,
    .r20-record small,
    .r20-change-link,
    .r20-signature-final small
  ){
    font-size:var(--aiai-ds-text-small)!important;
  }
  body.page-tool .r20-primary-action{
    min-height:var(--aiai-ds-touch)!important;
    font-size:12px!important;
  }
}

@media (max-width:390px){
  body.aiai-mobile-home-product-r1 .aiai-home-r1{
    padding-inline:var(--aiai-ds-gutter-landing)!important;
  }
  body.trust-integrity-page .trust-integrity-shell{
    width:calc(100% - 34px)!important;
  }
}
