/* Critical guard: every page loading the shared app shell must have a
   complete SVG and visibility baseline, even when style.css is not loaded.
   Prevents desktop-sized black icon silhouettes on standalone help pages. */
.app-icon,.mobile-app-sheet .app-icon,.mobile-menu-trigger .app-icon{
 display:block;width:22px;height:22px;max-width:22px;max-height:22px;
 flex:none;fill:none;stroke:currentColor;stroke-width:1.8;
 stroke-linecap:round;stroke-linejoin:round;
}
.app-dock{display:none}
.mobile-app-sheet[hidden]{display:none!important}
@media(min-width:901px){
 .app-dock,.mobile-menu-trigger{display:none!important}
 /* The 901–1100px tablet trigger opens this sheet; never hide the dialog here. */
 .mobile-app-sheet[hidden]{display:none!important}
}
@media(max-width:900px){
 .app-dock{display:grid;position:fixed;z-index:70;max-width:calc(100% - 12px)}
 .mobile-app-sheet{position:fixed;inset:0;z-index:90;background:rgba(0,0,0,.68)}
 .mobile-app-sheet[hidden]{display:none!important}
 .app-sheet-panel{position:absolute;max-width:calc(100% - 16px)}
}

/* v4.3.1 Mobile App Shell — public/mobile experience only.
   Preserves semantic HTML, URLs, crawlability and desktop layouts. */
:root{
  --v431-tab-bg:rgba(10,10,11,.92);
  --v431-tab-line:rgba(240,214,148,.20);
  --v431-tab-active:rgba(215,184,109,.10);
  --v431-tab-text:#aaa79f;
  --v431-tab-active-text:#f0d694;
  --v431-surface:#101012;
  --v431-radius:22px;
}
.app-card-icon{display:none}
@media(max-width:900px){
  html{
    scroll-padding-top:82px;
    scroll-padding-bottom:112px;
    -webkit-tap-highlight-color:transparent;
  }
  body{
    min-height:100dvh;
  }
  .public-home-page,
  .public-content-page,
  .public-gateway-page{
    padding-bottom:max(96px,calc(80px + env(safe-area-inset-bottom)));
  }
  .public-home-page .site-header,
  .public-content-page .site-header,
  .public-gateway-page .site-header{
    top:0;
    min-height:60px;
    padding:calc(7px + env(safe-area-inset-top)) 12px 7px;
    gap:10px;
    background:linear-gradient(180deg,rgba(7,7,8,.97),rgba(7,7,8,.88));
    -webkit-backdrop-filter:blur(24px) saturate(145%);
    backdrop-filter:blur(24px) saturate(145%);
    border-bottom:1px solid rgba(255,255,255,.045);
    box-shadow:0 10px 34px rgba(0,0,0,.20);
  }
  .public-home-page .site-header::after,
  .public-content-page .site-header::after,
  .public-gateway-page .site-header::after{
    opacity:.18;
  }
  .public-home-page .site-header .brand,
  .public-content-page .site-header .brand,
  .public-gateway-page .site-header .brand{
    min-width:0;
    max-width:calc(100% - 54px);
    line-height:1.12;
  }
  .public-home-page .site-header .brand span,
  .public-content-page .site-header .brand span,
  .public-gateway-page .site-header .brand span{
    font-size:clamp(14px,4vw,18px);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .public-home-page .site-header .brand small,
  .public-content-page .site-header .brand small,
  .public-gateway-page .site-header .brand small{
    margin-top:2px;
    font-size:8px;
    opacity:.72;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .app-dock{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    left:8px!important;
    right:8px!important;
    bottom:max(8px,env(safe-area-inset-bottom))!important;
    width:auto!important;
    min-height:70px;
    padding:6px!important;
    gap:2px;
    border:1px solid var(--v431-tab-line)!important;
    border-radius:24px!important;
    background:var(--v431-tab-bg)!important;
    -webkit-backdrop-filter:blur(28px) saturate(155%)!important;
    backdrop-filter:blur(28px) saturate(155%)!important;
    box-shadow:0 18px 54px rgba(0,0,0,.48),inset 0 1px 0 rgba(255,255,255,.035)!important;
  }
  .app-dock a,
  .app-dock button{
    min-width:0!important;
    min-height:56px!important;
    padding:6px 2px!important;
    display:flex!important;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px!important;
    border-radius:17px!important;
    color:var(--v431-tab-text)!important;
    background:transparent!important;
    font-size:9px!important;
    font-weight:650!important;
    line-height:1.12!important;
    letter-spacing:0!important;
    touch-action:manipulation;
    -webkit-user-select:none;
    user-select:none;
    transition:background .16s ease,color .16s ease,transform .12s ease!important;
  }
  .app-dock .app-icon{
    width:22px!important;
    height:22px!important;
    stroke-width:1.8!important;
  }
  .app-dock a.is-active,
  .app-dock a[aria-current="page"]{
    color:var(--v431-tab-active-text)!important;
    background:var(--v431-tab-active)!important;
    box-shadow:inset 0 0 0 1px rgba(240,214,148,.08)!important;
  }
  .app-dock .dock-action{
    color:#efe8d8!important;
    background:rgba(255,255,255,.035)!important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.035)!important;
  }
  .app-dock :where(a,button):active{
    transform:scale(.95);
  }

  .mobile-app-sheet{
    padding:12px 8px calc(12px + env(safe-area-inset-bottom))!important;
    background:rgba(0,0,0,.67)!important;
    -webkit-backdrop-filter:blur(18px)!important;
    backdrop-filter:blur(18px)!important;
    overscroll-behavior:contain;
  }
  .app-sheet-panel{
    left:8px!important;
    right:8px!important;
    bottom:max(8px,env(safe-area-inset-bottom))!important;
    max-height:min(78dvh,720px)!important;
    padding:22px 14px 16px!important;
    border-radius:30px!important;
    border:1px solid rgba(240,214,148,.20)!important;
    background:
      radial-gradient(440px 180px at 86% 0%,rgba(215,184,109,.055),transparent 72%),
      linear-gradient(180deg,rgba(22,21,20,.995),rgba(9,9,10,.995))!important;
    box-shadow:0 34px 110px rgba(0,0,0,.68)!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
  .app-sheet-panel::before{
    content:"";
    display:block;
    width:38px;
    height:4px;
    margin:0 auto 13px;
    border-radius:999px;
    background:#56544f;
  }
  .app-sheet-head{
    position:sticky;
    top:-22px;
    z-index:2;
    margin:-4px -2px 10px;
    padding:8px 2px 10px;
    background:linear-gradient(180deg,rgba(22,21,20,.995) 72%,transparent);
  }
  .app-sheet-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  .app-sheet-grid a{
    min-height:58px!important;
    display:flex;
    align-items:center;
    padding:12px 13px!important;
    border-radius:16px!important;
    background:rgba(255,255,255,.018)!important;
  }

  .pwa-install{
    left:8px!important;
    right:8px!important;
    bottom:calc(88px + env(safe-area-inset-bottom))!important;
    width:auto!important;
    max-width:none!important;
    transform:none!important;
    border-radius:18px!important;
  }
}
@media(max-width:390px){
  .app-dock{
    left:5px!important;
    right:5px!important;
    padding:5px!important;
    border-radius:21px!important;
  }
  .app-dock a,
  .app-dock button{
    min-height:54px!important;
    font-size:8.5px!important;
  }
  .app-dock .app-icon{
    width:21px!important;
    height:21px!important;
  }
  .app-sheet-grid{
    grid-template-columns:1fr!important;
  }
}
@media(display-mode:standalone) and (max-width:900px){
  body{
    overscroll-behavior-y:none;
  }
  .site-header{
    padding-top:calc(7px + env(safe-area-inset-top))!important;
  }
}
@media(prefers-reduced-motion:reduce){
  .app-dock a,
  .app-dock button,
  .mobile-app-sheet,
  .app-sheet-panel{
    transition:none!important;
  }
}


/* v4.3.1 phase 2 — native-feel interaction and iconography */
@media(max-width:900px){
  html.nav-open,
  html.nav-open body{overflow:hidden!important}

  body.foundation-page,
  body.auth-page,
  body.content-page{
    min-height:100dvh;
    overscroll-behavior-y:auto;
  }
  body.foundation-page,
  body.auth-page{
    padding-bottom:max(96px,calc(80px + env(safe-area-inset-bottom)));
  }

  .foundation-page .site-header,
  .auth-page .site-header,
  .content-page .site-header{
    top:0;
    min-height:60px;
    padding:calc(7px + env(safe-area-inset-top)) 12px 7px;
    gap:10px;
    border-bottom:1px solid rgba(255,255,255,.05);
    background:linear-gradient(180deg,rgba(7,7,8,.97),rgba(7,7,8,.89));
    -webkit-backdrop-filter:blur(24px) saturate(145%);
    backdrop-filter:blur(24px) saturate(145%);
    box-shadow:0 10px 34px rgba(0,0,0,.20);
  }
  .foundation-page .site-header .brand,
  .auth-page .site-header .brand,
  .content-page .site-header .brand{
    min-width:0!important;
    max-width:calc(100% - 54px)!important;
    line-height:1.12;
  }
  .foundation-page .site-header .brand span,
  .auth-page .site-header .brand span,
  .content-page .site-header .brand span{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .app-dock span{
    max-width:100%;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
  }
  .app-dock a.is-active::before,
  .app-dock a[aria-current="page"]::before{
    content:"";
    position:absolute;
    top:4px;
    width:20px;
    height:2px;
    border-radius:99px;
    background:var(--v431-tab-active-text);
    box-shadow:0 0 12px rgba(240,214,148,.32);
  }
  .app-dock a,
  .app-dock button{position:relative}

  .mobile-app-sheet{
    opacity:0;
    transition:opacity .18s ease;
  }
  .mobile-app-sheet.is-open{opacity:1}
  .app-sheet-panel{
    transform:translateY(20px) scale(.985);
    opacity:.98;
    transition:transform .22s cubic-bezier(.2,.8,.2,1),opacity .18s ease;
  }
  .mobile-app-sheet.is-open .app-sheet-panel{
    transform:translateY(0) scale(1);
    opacity:1;
  }
  .app-sheet-head{
    display:flex!important;
    align-items:center;
    justify-content:space-between;
    gap:14px;
  }
  .app-sheet-head>div{display:grid;gap:2px}
  .app-sheet-head small{
    color:#8e8b84;
    font-size:8px;
    font-weight:750;
    letter-spacing:.12em;
    text-transform:uppercase;
  }
  .rtl .app-sheet-head small{
    letter-spacing:0;
    text-transform:none;
  }
  .app-sheet-head strong{
    color:#f2ede4;
    font-size:18px;
    line-height:1.3;
  }
  .app-sheet-grid a{
    position:relative;
    display:grid!important;
    grid-template-columns:38px minmax(0,1fr) 14px;
    gap:10px;
    align-items:center!important;
    text-align:start;
  }
  .sheet-icon{
    width:38px;
    height:38px;
    display:grid;
    place-items:center;
    border:1px solid rgba(240,214,148,.13);
    border-radius:12px;
    color:#dfc47d;
    background:rgba(215,184,109,.045);
  }
  .sheet-icon .app-icon{
    width:19px!important;
    height:19px!important;
    stroke-width:1.75!important;
  }
  .app-sheet-grid a b{
    min-width:0;
    font-size:12px!important;
    line-height:1.45;
    color:#eeeae2;
  }
  .sheet-chevron{
    color:#676761;
    font-size:20px;
    line-height:1;
    transform:translateY(-1px);
  }
  .rtl .sheet-chevron{transform:rotate(180deg) translateY(1px)}

  :where(.public-home-page,.public-content-page,.foundation-page,.auth-page) .button{
    min-height:46px;
    touch-action:manipulation;
  }
  :where(.public-home-page,.public-content-page,.foundation-page,.auth-page) .button:active{
    transform:scale(.985)!important;
  }

  .public-home-page .home-account-strip{
    border-radius:20px!important;
    box-shadow:0 16px 50px rgba(0,0,0,.22)!important;
  }
}

@media(max-width:700px){
  /* App-style horizontal discovery rail instead of a long stack. */
  .public-home-page .home-focus-strip{
    display:flex!important;
    gap:10px!important;
    width:calc(100vw - 10px);
    margin-inline:calc((100vw - 100%)/-2);
    padding:2px 10px 20px!important;
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scroll-snap-type:x mandatory;
    scrollbar-width:none;
    border-bottom:0!important;
  }
  .public-home-page .home-focus-strip::-webkit-scrollbar{display:none}
  .public-home-page .home-focus-strip a{
    flex:0 0 min(82vw,310px);
    min-height:132px!important;
    scroll-snap-align:start;
    border-radius:22px!important;
    padding:20px!important;
  }
  .rtl.public-home-page .home-focus-strip{direction:rtl}

  .public-home-page .audience-gates{
    grid-template-columns:1fr!important;
    gap:10px!important;
  }
  .public-home-page .audience-gate{
    min-height:auto!important;
    padding:20px!important;
  }

  .public-content-page .service-shell,
  .public-content-page .article-shell,
  .auth-page .article-shell{
    width:calc(100% - 18px)!important;
    padding-top:14px!important;
    padding-bottom:calc(116px + env(safe-area-inset-bottom))!important;
  }
  .public-content-page .service-hero,
  .public-content-page .article-hero,
  .auth-page .article-hero{
    border-radius:24px!important;
    box-shadow:0 18px 58px rgba(0,0,0,.26)!important;
  }
  .public-content-page .service-section{
    padding:42px 0!important;
  }
  .public-content-page .service-grid{
    grid-template-columns:1fr!important;
    gap:10px!important;
  }
  .public-content-page .service-card{
    min-height:auto!important;
    padding:20px!important;
    border-radius:20px!important;
  }

  .book-store-shell{
    width:calc(100% - 16px)!important;
    padding-top:12px!important;
    padding-bottom:calc(116px + env(safe-area-inset-bottom))!important;
  }
  .book-store-hero{
    padding:24px 18px!important;
    margin-bottom:14px!important;
    border-radius:24px!important;
    box-shadow:0 18px 58px rgba(0,0,0,.28)!important;
  }
  .book-store-hero h1{
    font-size:clamp(34px,10vw,44px)!important;
  }
  .rtl .book-store-hero h1{line-height:1.5!important}
  .store-nav{
    display:grid!important;
    grid-template-columns:1fr 1fr;
    gap:8px!important;
  }
  .store-nav .button{
    width:100%;
    justify-content:center;
  }
  .store-principles{
    display:flex!important;
    gap:9px!important;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    scrollbar-width:none;
    padding-bottom:4px;
  }
  .store-principles::-webkit-scrollbar{display:none}
  .store-principles article{
    flex:0 0 min(78vw,290px);
    scroll-snap-align:start;
    border-radius:18px!important;
  }
  .book-product-card{
    border-radius:24px!important;
    box-shadow:0 18px 54px rgba(0,0,0,.28)!important;
  }
  .book-product-copy .actions{
    display:grid!important;
    grid-template-columns:1fr;
  }
  .book-product-copy .actions .button{
    width:100%;
    justify-content:center;
  }

  .auth-page .auth-shell{
    width:calc(100% - 18px)!important;
  }
  .auth-page .auth-form{
    padding:18px;
    gap:16px;
    border:1px solid rgba(240,214,148,.13);
    border-radius:22px;
    background:linear-gradient(155deg,#141416,#0f0f11);
    box-shadow:0 14px 44px rgba(0,0,0,.18);
  }
  .auth-page .auth-form input,
  .auth-page .auth-form select{
    min-height:50px;
    border-radius:14px;
  }
  .auth-page .role-status-grid{
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
  }
  .auth-page .role-status-card{
    min-height:108px!important;
    padding:14px!important;
    border-radius:18px!important;
  }
}

@media(max-width:390px){
  .store-nav{grid-template-columns:1fr}
  .auth-page .role-status-grid{grid-template-columns:1fr 1fr!important}
  .auth-page .role-status-card{min-height:100px!important;padding:12px!important}
  .public-home-page .home-focus-strip a{flex-basis:84vw}
}

@media(prefers-reduced-motion:reduce){
  .mobile-app-sheet,
  .app-sheet-panel{transition:none!important}
}

@media(max-width:900px){
  .app-sheet-grid a .sheet-icon{
    color:#dfc47d!important;
    font-size:0!important;
  }
  .app-sheet-grid a .sheet-chevron{
    color:#676761!important;
    font-size:20px!important;
  }
  .app-card-icon{
    display:grid;
    place-items:center;
    width:38px;
    height:38px;
    margin-bottom:12px;
    border:1px solid rgba(240,214,148,.14);
    border-radius:12px;
    color:#dec37b;
    background:rgba(215,184,109,.045);
  }
  .app-card-icon .app-icon{
    width:19px;
    height:19px;
    stroke-width:1.75;
  }
}

/* v4.4.1 app-like interaction hardening */
@media(max-width:900px){
  .mobile-menu-trigger,.app-sheet-close{
    min-width:48px!important;
    min-height:48px!important;
    touch-action:manipulation;
  }
  .app-sheet-close{
    display:grid!important;
    place-items:center;
    border:1px solid rgba(255,255,255,.08);
    border-radius:14px;
    color:#f2ede4;
    background:rgba(255,255,255,.035);
    font-size:28px;
    line-height:1;
  }
  :where(.app-dock,.mobile-app-sheet) :where(a,button):focus-visible{
    outline:2px solid var(--v431-tab-active-text)!important;
    outline-offset:2px!important;
  }
  .app-sheet-panel{
    padding-bottom:max(16px,calc(12px + env(safe-area-inset-bottom)))!important;
  }
  @supports(height:100svh){
    .app-sheet-panel{max-height:min(78svh,720px)!important}
  }
}
@media(display-mode:standalone) and (max-width:900px){
  .app-dock{bottom:max(6px,env(safe-area-inset-bottom))!important}
}

/* v4.4.1 persistent cart state in app dock */
@media(max-width:900px){
 .app-dock a[data-app-tab="bag"]{position:relative}
 .app-cart-badge{
  position:absolute;top:4px;inset-inline-end:calc(50% - 24px);
  min-width:18px;height:18px;padding:0 5px;border-radius:999px;
  display:grid;place-items:center;background:#f0d694;color:#16130d;
  border:2px solid rgba(10,10,11,.95);font-size:10px;font-weight:900;line-height:1;
  box-shadow:0 4px 12px rgba(0,0,0,.35)
 }
 .app-cart-badge[hidden]{display:none!important}
}

/* Accessible mobile native section search, visible before all links. */
@media(max-width:900px){
 .mobile-app-sheet .app-sheet-search{
  display:grid;gap:7px;margin:0 0 14px;
  padding:0 1px 10px;position:relative;z-index:1;
 }
 .mobile-app-sheet .app-sheet-search label{
  display:block;color:#f0d694;font-size:13px;line-height:1.45;
  font-weight:650;
 }
 .mobile-app-sheet .app-sheet-search input[type=search]{
  display:block!important;width:100%;box-sizing:border-box;
  min-height:48px;padding:10px 14px;border-radius:14px;
  color:#fff5e6;background:#22211f;border:1px solid #9c8051;
  font:inherit;font-size:16px;direction:inherit;
  -webkit-appearance:none;appearance:none;
 }
 .mobile-app-sheet .app-sheet-search input[type=search]:focus-visible{
  outline:3px solid #e7c788;outline-offset:2px;
 }
 .mobile-app-sheet .app-sheet-search [data-jr-mobile-search-count]{
  display:block;min-height:1.3em;color:#d6c1a0;
  font-size:12px;line-height:1.5;
 }
 .mobile-app-sheet .app-sheet-empty{
  padding:12px;color:#f3ddab;line-height:1.7;
 }
 .mobile-app-sheet .app-sheet-grid a[hidden]{display:none!important}
}
