/* AIAI_GLOBAL_MOBILE_SHELL_V1
   Scope: mobile public header/footer + homepage V10 only.
   Internal page content is intentionally untouched.
*/
.aiai-global-mobile-head-v1,
.aiai-global-mobile-footer-v1,
.aiai-mhome-v10{display:none}

@media (max-width:767px){
  :root{
    --aiai-v10-bg:#FAF8F3;
    --aiai-v10-paper:#FFFFFF;
    --aiai-v10-paper-soft:#FCFAF6;
    --aiai-v10-ink:#1B1915;
    --aiai-v10-text:#5E584F;
    --aiai-v10-muted:#948D82;
    --aiai-v10-line:#E9E3D9;
    --aiai-v10-line-2:#EFEAE2;
    --aiai-v10-accent:#9A753A;
  }

  /* One mobile header replaces page-specific shells visually; their markup stays for desktop. */
  body:not(.page-admin):not(.admin-page) > .dmd-header,
  body:not(.page-admin):not(.admin-page) > .erx-site-header,
  body:not(.page-admin):not(.admin-page) > .lum-header,
  body:not(.page-admin):not(.admin-page) > .site-header,
  body:not(.page-admin):not(.admin-page) > .mobile-nav-backdrop{
    display:none!important;
  }

  .aiai-global-mobile-head-v1{
    display:block;
    position:sticky;
    top:0;
    z-index:500;
    width:100%;
    background:rgba(250,248,243,.965);
    -webkit-backdrop-filter:blur(16px);
    backdrop-filter:blur(16px);
    border-bottom:1px solid rgba(142,116,73,.10);
  }
  .aiai-global-mobile-head__inner{
    min-height:76px;
    padding:calc(8px + env(safe-area-inset-top)) 18px 8px;
    display:grid;
    grid-template-columns:46px minmax(0,1fr) 46px;
    align-items:center;
    direction:ltr;
  }
  .aiai-global-mobile-head__account,
  .aiai-global-mobile-head__menu{
    width:44px;
    height:44px;
    border-radius:50%;
    border:1px solid #E7E0D6;
    background:#fff;
    color:#6E5A38;
    display:grid;
    place-items:center;
    box-shadow:0 4px 14px rgba(44,35,20,.03);
  }
  .aiai-global-mobile-head__account{pointer-events:none}
  .aiai-global-mobile-head__menu{padding:0;cursor:pointer}
  .aiai-global-mobile-head__account svg,
  .aiai-global-mobile-head__menu svg{width:19px;height:19px}
  .aiai-global-mobile-head__brand{
    justify-self:center;
    width:92px;
    height:54px;
    display:grid;
    place-items:center;
    line-height:0;
  }
  .aiai-global-mobile-head__brand img{
    display:block;
    width:92px;
    height:auto;
    max-height:54px;
    object-fit:contain;
  }

  .aiai-global-mobile-sheet{
    position:fixed;
    inset:0;
    z-index:510;
    background:rgba(40,34,25,.18);
    -webkit-backdrop-filter:blur(8px);
    backdrop-filter:blur(8px);
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:opacity .2s ease,visibility .2s ease;
  }
  .aiai-global-mobile-sheet.is-open{opacity:1;visibility:visible;pointer-events:auto}
  .aiai-global-mobile-sheet__panel{
    position:absolute;
    left:50%;
    bottom:0;
    transform:translate(-50%,105%);
    width:min(100%,430px);
    background:#fff;
    border-radius:28px 28px 0 0;
    padding:12px 20px calc(22px + env(safe-area-inset-bottom));
    box-shadow:0 -24px 60px rgba(54,42,23,.13);
    transition:transform .32s cubic-bezier(.2,.8,.2,1);
  }
  .aiai-global-mobile-sheet.is-open .aiai-global-mobile-sheet__panel{transform:translate(-50%,0)}
  .aiai-global-mobile-sheet__handle{width:42px;height:4px;border-radius:999px;background:#DDD5CA;margin:0 auto 15px}
  .aiai-global-mobile-sheet__title{margin:0 0 7px;color:var(--aiai-v10-accent);font-size:11px;font-weight:800}
  .aiai-global-mobile-sheet nav{display:grid}
  .aiai-global-mobile-sheet nav a{
    color:var(--aiai-v10-ink);
    text-decoration:none;
    padding:15px 2px;
    border-bottom:1px solid var(--aiai-v10-line-2);
    font:800 15px/1.5 "IBM Plex Sans Arabic","Tajawal",sans-serif;
  }
  .aiai-global-mobile-sheet nav a:last-child{border-bottom:0}
  .aiai-global-mobile-sheet__close{
    width:100%;height:46px;margin-top:10px;border-radius:14px;
    border:1px solid var(--aiai-v10-line);background:#F9F6F0;
    color:#5D554B;font:800 14px "IBM Plex Sans Arabic","Tajawal",sans-serif;
  }
  body.aiai-mobile-menu-open{overflow:hidden}

  /* One mobile footer; existing page footers remain intact for desktop and scripts. */
  body:not(.page-admin):not(.admin-page) > .dmd-footer,
  body:not(.page-admin):not(.admin-page) > .erx-site-footer,
  body:not(.page-admin):not(.admin-page) > .lum-footer,
  body:not(.page-admin):not(.admin-page) > .site-footer{
    display:none!important;
  }
  .aiai-global-mobile-footer-v1{
    display:block;
    margin-top:30px;
    padding:24px 18px calc(28px + env(safe-area-inset-bottom));
    border-top:1px solid rgba(151,117,58,.10);
    background:#FDFBF7;
    color:var(--aiai-v10-ink);
    text-align:center;
  }
  .aiai-global-mobile-footer-v1__brand{
    width:98px;height:66px;margin:0 auto;display:grid;place-items:center;line-height:0;
  }
  .aiai-global-mobile-footer-v1__brand img{display:block;width:98px;height:auto;max-height:66px;object-fit:contain}
  .aiai-global-mobile-footer-v1 p{margin:4px 0 0;color:#8D857A;font-size:11px;line-height:1.7}
  .aiai-global-mobile-footer-v1 nav{
    margin-top:16px;padding-top:14px;border-top:1px solid var(--aiai-v10-line);
    display:flex;justify-content:center;flex-wrap:wrap;gap:10px 15px;
    font-size:10px;color:#625A50;
  }
  .aiai-global-mobile-footer-v1 nav a,
  .aiai-global-mobile-footer-v1 nav button{
    border:0;background:none;padding:0;color:inherit;text-decoration:none;font:inherit;cursor:pointer;
  }
  .aiai-global-mobile-footer-v1 small{display:block;margin-top:13px;font-size:9px;color:#ACA499}

  /* Home V10 — mobile only. Existing Diamond home remains the desktop experience. */
  body.page-home.aiai-diamond-home-v1{
    background:var(--aiai-v10-bg)!important;
    color:var(--aiai-v10-ink);
  }
  body.page-home.aiai-diamond-home-v1 > main{
    background:var(--aiai-v10-bg)!important;
    overflow:hidden;
  }
  body.page-home.aiai-diamond-home-v1 .dmd-hero,
  body.page-home.aiai-diamond-home-v1 .dmd-system-section,
  body.page-home.aiai-diamond-home-v1 .dmd-value-section,
  body.page-home.aiai-diamond-home-v1 .dmd-stats-section{
    display:none!important;
  }
  body.page-home.aiai-diamond-home-v1 .beta-feedback-fab{display:none!important}

  .aiai-mhome-v10{
    display:block;
    width:100%;
    max-width:430px;
    margin:0 auto;
    background:var(--aiai-v10-bg);
    color:var(--aiai-v10-ink);
    font-family:"IBM Plex Sans Arabic","Tajawal",sans-serif;
  }
  .aiai-mhome-hero{
    padding:58px 18px 18px;
    text-align:center;
    animation:aiaiV10Rise .55s cubic-bezier(.2,.7,.2,1) both;
  }
  .aiai-mhome-eyebrow{
    display:inline-flex;align-items:center;gap:8px;
    color:#86662F;font-size:11px;font-weight:800;margin-bottom:14px;
  }
  .aiai-mhome-eyebrow::before{
    content:"";width:6px;height:6px;border-radius:50%;background:var(--aiai-v10-accent);
    box-shadow:0 0 0 4px rgba(154,117,58,.08);
  }
  .aiai-mhome-hero h1{
    margin:0 auto;max-width:390px;
    font-family:"Noto Naskh Arabic","Amiri",serif;
    font-size:40px;line-height:1.25;letter-spacing:-.8px;font-weight:700;
  }
  .aiai-mhome-hero h1 span{display:block;color:var(--aiai-v10-accent)}
  .aiai-mhome-hero p{
    margin:10px auto 0;max-width:350px;color:var(--aiai-v10-text);
    font-size:12px;line-height:1.9;
  }

  .aiai-mhome-instrument-wrap{padding:0 18px;animation:aiaiV10Rise .6s .05s cubic-bezier(.2,.7,.2,1) both}
  .aiai-mhome-instrument{
    margin:0;background:var(--aiai-v10-paper);border:1px solid var(--aiai-v10-line);
    border-radius:27px;padding:13px;box-shadow:0 16px 40px rgba(49,39,23,.06);
  }
  .aiai-mhome-task-box{
    min-height:194px;border:1px solid #E7E0D6;border-radius:21px;background:var(--aiai-v10-paper-soft);
    padding:17px 16px 13px;text-align:right;transition:border-color .18s ease,box-shadow .18s ease;
  }
  .aiai-mhome-task-box:focus-within{border-color:#C8AA77;box-shadow:0 0 0 3px rgba(178,141,77,.06)}
  .aiai-mhome-task-label{display:block;color:var(--aiai-v10-muted);font-size:10px;margin-bottom:12px}
  .aiai-mhome-task-box textarea{
    display:block;width:100%;min-height:92px;resize:none;border:0!important;outline:0!important;
    background:transparent!important;box-shadow:none!important;color:var(--aiai-v10-ink)!important;
    padding:0!important;margin:0;font:500 18px/1.75 "Noto Naskh Arabic","Amiri",serif!important;
  }
  .aiai-mhome-task-box textarea::placeholder{color:#ACA59B;opacity:1}
  .aiai-mhome-task-foot{display:flex;direction:ltr;align-items:center;justify-content:space-between;gap:8px;margin-top:7px}
  .aiai-mhome-clear{
    width:30px;height:30px;border-radius:50%;border:1px solid var(--aiai-v10-line);background:#fff;
    color:#948A7E;opacity:0;pointer-events:none;transition:.18s ease;
  }
  .aiai-mhome-clear.is-on{opacity:1;pointer-events:auto}
  .aiai-mhome-hint{direction:rtl;color:#A39A8F;font-size:9px}

  .aiai-mhome-steps{position:relative;display:grid;grid-template-columns:repeat(4,1fr);margin:17px 5px 14px;padding-top:3px}
  .aiai-mhome-steps::before{content:"";position:absolute;right:12%;left:12%;top:15px;height:1px;background:#E0D8CD}
  .aiai-mhome-progress{position:absolute;right:12%;top:15px;height:1px;width:0;background:var(--aiai-v10-accent);transition:width .35s ease}
  .aiai-mhome-step{position:relative;z-index:2;text-align:center;color:#A0988D;font-size:9px;line-height:1.45}
  .aiai-mhome-step-dot{
    width:27px;height:27px;border-radius:50%;margin:0 auto 7px;display:grid;place-items:center;
    background:#FBF8F2;border:1px solid #DED6CA;color:inherit;transition:.25s ease;
  }
  .aiai-mhome-step-dot::after{content:"";width:4px;height:4px;border-radius:50%;background:currentColor}
  .aiai-mhome-step.is-active{color:#765728;font-weight:800}
  .aiai-mhome-step.is-active .aiai-mhome-step-dot{background:#FFF8EC;border-color:#B58B48;box-shadow:0 0 0 4px rgba(181,139,72,.07)}
  .aiai-mhome-step.is-done{color:#62594C}
  .aiai-mhome-step.is-done .aiai-mhome-step-dot{background:#1C1A16;border-color:#1C1A16;color:#fff}

  .aiai-mhome-cta{
    width:100%;height:58px;border:0;border-radius:18px;background:#1C1A16;color:#fff;
    display:flex;align-items:center;justify-content:center;gap:10px;
    font:800 16px "IBM Plex Sans Arabic","Tajawal",sans-serif;
    box-shadow:0 9px 20px rgba(28,26,22,.10);transition:transform .15s ease,opacity .15s ease;
  }
  .aiai-mhome-cta:active{transform:scale(.99)}
  .aiai-mhome-cta[disabled]{opacity:.76}
  .aiai-mhome-cta-star{color:#C3A067;font-size:18px}

  .aiai-mhome-switch{
    margin:34px 18px 0;padding:24px 2px 25px;border-top:1px solid var(--aiai-v10-line);border-bottom:1px solid var(--aiai-v10-line);
  }
  .aiai-mhome-switch-kicker{color:var(--aiai-v10-accent);font-size:11px;font-weight:800;margin-bottom:7px}
  .aiai-mhome-switch h2{
    margin:0;font-family:"Noto Naskh Arabic","Amiri",serif;font-size:32px;line-height:1.36;font-weight:700;letter-spacing:-.35px;
  }
  .aiai-mhome-switch p{margin:7px 0 15px;color:var(--aiai-v10-text);font-size:11px;line-height:1.9}
  .aiai-mhome-switch a{
    display:inline-flex;align-items:center;gap:7px;color:#55462E;text-decoration:none;
    border-bottom:1px solid #BDA77F;padding-bottom:5px;font-size:12px;font-weight:800;
  }

  .aiai-mhome-proof{padding:24px 18px 0}
  .aiai-mhome-proof-label{color:var(--aiai-v10-muted);font-size:9px;margin-bottom:11px}
  .aiai-mhome-stats{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--aiai-v10-line);border-bottom:1px solid var(--aiai-v10-line)}
  .aiai-mhome-stat{text-align:center;padding:15px 4px 14px;position:relative}
  .aiai-mhome-stat+.aiai-mhome-stat::before{content:"";position:absolute;right:0;top:22%;bottom:22%;width:1px;background:var(--aiai-v10-line-2)}
  .aiai-mhome-stat b{display:block;font:500 24px/1.2 Georgia,"Times New Roman",serif;direction:ltr}
  .aiai-mhome-stat small{font-size:9px;color:#8D857A}

  @keyframes aiaiV10Rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
}

@media (max-width:370px){
  .aiai-mhome-hero{padding-inline:15px}
  .aiai-mhome-hero h1{font-size:36px}
  .aiai-mhome-instrument-wrap,.aiai-mhome-proof{padding-inline:15px}
  .aiai-mhome-switch{margin-inline:15px}
  .aiai-mhome-step{font-size:8px}
}

@media (prefers-reduced-motion:reduce){
  .aiai-global-mobile-sheet,.aiai-global-mobile-sheet__panel,.aiai-mhome-v10 *{animation:none!important;transition:none!important}
}

/* AIAI_HOME_V10_FINAL_POLISH_01
   Approved mobile-only last-mile polish:
   1) clean ivory background (remove inherited linen/diagonal texture)
   2) reduce footer wordmark ~10%
   3) tighten hero top air by 10px
*/
@media (max-width:767px){
  body.page-home.aiai-diamond-home-v1::before{
    content:none!important;
    display:none!important;
    background:none!important;
    background-image:none!important;
    opacity:0!important;
  }
  body.page-home.aiai-diamond-home-v1,
  body.page-home.aiai-diamond-home-v1 > main,
  body.page-home.aiai-diamond-home-v1 .aiai-mhome-v10{
    background-color:var(--aiai-v10-bg)!important;
    background-image:none!important;
  }

  body.page-home.aiai-diamond-home-v1 .aiai-mhome-hero{
    padding-top:48px;
  }

  .aiai-global-mobile-footer-v1__brand{
    width:88px;
    height:60px;
  }
  .aiai-global-mobile-footer-v1__brand img{
    width:88px;
    max-height:60px;
  }
}

/* AIAI_GLOBAL_MOBILE_FOOTER_DEDUP_HOTFIX_01
   Mobile integration only:
   hide all legacy public footer blocks when the unified global mobile footer is active.
   Desktop and page content remain untouched.
*/
@media (max-width:767px){
  body:not(.page-admin):not(.admin-page) .site-footer,
  body:not(.page-admin):not(.admin-page) .dmd-footer,
  body:not(.page-admin):not(.admin-page) .erx-site-footer,
  body:not(.page-admin):not(.admin-page) .lum-footer,
  body:not(.page-admin):not(.admin-page) .aiai-switch-mobile-footer{
    display:none!important;
  }

  body:not(.page-admin):not(.admin-page) .aiai-global-mobile-footer-v1{
    display:block!important;
  }
}

/* AIAI_GLOBAL_MOBILE_FOOTER_DEDUP_HOTFIX_02
   Audit-complete mobile closure.
   The read-only views audit found three additional page-owned <footer> blocks
   outside the shared footer partial:
     - tool.ejs    -> .atv17-local-footer
     - verdict.ejs -> .aiai-v15-footer
     - compare.ejs -> .aiai-cmp-footer
   These are hidden on public mobile pages so the unified global footer is the
   only site footer. Component "footer" classes and content cards are NOT touched.
   Desktop is unchanged.
*/
@media (max-width:767px){
  body:not(.page-admin):not(.admin-page) .atv17-local-footer,
  body:not(.page-admin):not(.admin-page) .aiai-v15-footer,
  body:not(.page-admin):not(.admin-page) .aiai-cmp-footer{
    display:none!important;
  }

  body:not(.page-admin):not(.admin-page) .aiai-global-mobile-footer-v1{
    display:block!important;
  }
}

/* AIAI_MOBILE_MENU_VISIBILITY_FIX_V1
   Narrow repair only:
   The sheet's navigation no longer uses the generic <nav> element, preventing
   page-level nav rules from hiding or restyling the global mobile menu.
   Header geometry, wordmark, footer, page content and JS remain unchanged.
*/
@media (max-width:767px){
  .aiai-global-mobile-sheet .aiai-global-mobile-sheet__links{
    display:grid!important;
    visibility:visible!important;
    opacity:1!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
    grid-template-columns:1fr!important;
  }

  .aiai-global-mobile-sheet .aiai-global-mobile-sheet__links > a{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    width:100%!important;
    min-height:52px!important;
    margin:0!important;
    padding:15px 2px!important;
    border:0!important;
    border-bottom:1px solid var(--aiai-v10-line-2)!important;
    border-radius:0!important;
    background:transparent!important;
    color:var(--aiai-v10-ink)!important;
    text-align:right!important;
    text-decoration:none!important;
    font:800 15px/1.5 "IBM Plex Sans Arabic","Tajawal",sans-serif!important;
    box-shadow:none!important;
  }

  .aiai-global-mobile-sheet .aiai-global-mobile-sheet__links > a:last-child{
    border-bottom:0!important;
  }
}


/* AIAI_MOBILE_MENU_VIEWPORT_FIX_V2
   Root repair:
   The mobile sheet now lives as a direct body-level sibling of the sticky
   header. This prevents the header's backdrop-filter from becoming the fixed
   positioning containing block for the sheet.
*/
@media (max-width:767px){
  body:not(.page-admin):not(.admin-page) > .aiai-global-mobile-sheet{
    position:fixed!important;
    inset:0!important;
    z-index:510!important;
  }
}

/* AIAI_MOBILE_HEADER_TOOL_SHORTCUT_V1
   Replace the inert account affordance with a functional /tools shortcut.
   The approved 44x44 header geometry is unchanged.
*/
@media (max-width:767px){
  .aiai-global-mobile-head__tool-shortcut{
    pointer-events:auto!important;
    cursor:pointer!important;
    text-decoration:none!important;
    -webkit-tap-highlight-color:transparent;
  }

  .aiai-global-mobile-head__tool-shortcut:focus-visible{
    outline:2px solid rgba(154,117,58,.42)!important;
    outline-offset:3px!important;
  }

  .aiai-global-mobile-head__tool-shortcut:active{
    transform:scale(.96);
  }
}

/* AIAI_MOBILE_HOME_CLEAR_CONTROL_POLISH_V1 */
@media (max-width:767px){
  body.aiai-mobile-home-v10 .aiai-mhome-clear{
    width:30px!important;
    height:30px!important;
    min-width:30px!important;
    min-height:30px!important;
    padding:0!important;
    margin:0!important;
    display:grid!important;
    place-items:center!important;
    border:1px solid var(--aiai-v10-line)!important;
    border-radius:50%!important;
    background:rgba(255,255,255,.92)!important;
    color:#8F867B!important;
    line-height:1!important;
    box-shadow:0 1px 2px rgba(33,29,23,.035)!important;
    appearance:none!important;
    -webkit-appearance:none!important;
  }

  body.aiai-mobile-home-v10 .aiai-mhome-clear svg{
    display:block!important;
    width:14px!important;
    height:14px!important;
    overflow:visible!important;
    pointer-events:none!important;
  }

  body.aiai-mobile-home-v10 .aiai-mhome-clear:focus-visible{
    outline:2px solid rgba(166,128,67,.36)!important;
    outline-offset:3px!important;
  }

  body.aiai-mobile-home-v10 .aiai-mhome-clear:active{
    transform:scale(.94)!important;
    background:#FBF7F0!important;
  }
}
