/* HF28.98 - GLOBAL SUPER PREMIUM MOBILE DOCK + AI TOOLS RAIL */
:root{--smn-orange:#ff7d13;--smn-orange-2:#ff9c43;--smn-line:rgba(255,255,255,.11);--smn-glass:rgba(11,12,11,.78);--smn-text:#f7f3ed;--smn-muted:#9b978f}
.site-mobile-nav-enhanced{padding-bottom:max(96px,calc(82px + env(safe-area-inset-bottom)))!important}
.site-mobile-nav-enhanced .v28-bottom,.site-mobile-nav-enhanced .pbs-bottom-nav{display:none!important}
.site-mobile-dock-shell{position:fixed;z-index:240;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom));pointer-events:none}
.site-mobile-dock{position:relative;max-width:620px;margin:auto;padding:7px;border:1px solid rgba(255,255,255,.115);border-radius:24px;background:linear-gradient(145deg,rgba(27,28,26,.84),rgba(10,11,10,.78));backdrop-filter:blur(28px) saturate(150%);-webkit-backdrop-filter:blur(28px) saturate(150%);box-shadow:0 18px 55px rgba(0,0,0,.36),0 0 48px rgba(255,113,0,.055),inset 0 1px rgba(255,255,255,.075);overflow:hidden;pointer-events:auto}
.site-mobile-dock:before{content:"";position:absolute;inset:auto 13% -36px;height:62px;border-radius:50%;background:rgba(255,113,0,.13);filter:blur(28px);pointer-events:none}.site-mobile-dock:after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(105deg,transparent 0 30%,rgba(255,255,255,.026) 50%,transparent 70%)}
.site-mobile-dock-track{position:relative;z-index:2;display:flex;gap:6px;overflow-x:auto!important;overflow-y:hidden;padding:1px 2px 2px;scroll-snap-type:x proximity;scroll-padding-inline:8px;scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;touch-action:pan-x;overscroll-behavior-x:contain}.site-mobile-dock-track::-webkit-scrollbar{display:none}
.site-mobile-dock-item{position:relative;flex:0 0 auto;min-width:78px;height:58px;padding:5px 10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;scroll-snap-align:center;border:1px solid transparent;border-radius:17px;color:var(--smn-muted);text-decoration:none!important;font-family:Vazirmatn,Vazir,Tahoma,sans-serif;font-size:11.5px;font-weight:500;line-height:1.1;white-space:nowrap;transition:color .2s,border-color .2s,background .2s,box-shadow .2s,transform .2s;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.site-mobile-dock-item .site-mobile-icon{width:23px;height:23px;display:grid;place-items:center}.site-mobile-dock-item svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}.site-mobile-dock-item span:last-child{max-width:92px;overflow:hidden;text-overflow:ellipsis}
.site-mobile-dock-item:hover,.site-mobile-dock-item:focus-visible{color:#e9e4dc;background:rgba(255,255,255,.04);outline:none}.site-mobile-dock-item.is-accent:not(.active){color:#cba985}.site-mobile-dock-item.active{color:#fff3e7;border-color:rgba(255,145,48,.28);background:linear-gradient(145deg,rgba(255,132,24,.18),rgba(255,101,0,.07));box-shadow:0 8px 26px rgba(255,104,0,.12),inset 0 1px rgba(255,255,255,.08);transform:translateY(-1px)}.site-mobile-dock-item.active .site-mobile-icon{color:#ff9b42;filter:drop-shadow(0 0 8px rgba(255,121,20,.38))}.site-mobile-dock-item.active:after{content:"";position:absolute;left:24%;right:24%;bottom:2px;height:2px;border-radius:99px;background:linear-gradient(90deg,transparent,#ff8a24,transparent);box-shadow:0 0 10px rgba(255,119,12,.6)}
html[data-theme="light"]{--smn-line:rgba(36,43,55,.10);--smn-glass:rgba(255,255,255,.82);--smn-text:#222b38;--smn-muted:#707987}html[data-theme="light"] .site-mobile-dock{border-color:rgba(38,48,65,.11);background:linear-gradient(145deg,rgba(255,255,255,.92),rgba(247,249,252,.86));box-shadow:0 16px 45px rgba(39,48,64,.16),0 0 38px rgba(255,124,24,.06),inset 0 1px rgba(255,255,255,.9)}html[data-theme="light"] .site-mobile-dock:after{background:linear-gradient(105deg,transparent 0 30%,rgba(255,255,255,.35) 50%,transparent 70%)}html[data-theme="light"] .site-mobile-dock-item:hover,html[data-theme="light"] .site-mobile-dock-item:focus-visible{color:#303a49;background:rgba(31,43,60,.035)}html[data-theme="light"] .site-mobile-dock-item.active{color:#9b4a00;border-color:rgba(226,111,8,.20);background:linear-gradient(145deg,rgba(255,143,43,.15),rgba(255,119,10,.055));box-shadow:0 8px 24px rgba(255,115,8,.09),inset 0 1px rgba(255,255,255,.8)}
@media(min-width:761px){.site-mobile-dock-shell{display:none!important}.site-mobile-nav-enhanced{padding-bottom:0!important}.site-mobile-nav-enhanced .v28-bottom,.site-mobile-nav-enhanced .pbs-bottom-nav{display:none!important}}

/* AI Tools Rail */
.studio-tools-rail{position:sticky;top:76px;z-index:110;width:min(1180px,calc(100% - 24px));margin:10px auto 0;padding:6px;border:1px solid rgba(255,255,255,.10);border-radius:20px;background:linear-gradient(145deg,rgba(22,23,21,.80),rgba(10,11,10,.73));backdrop-filter:blur(24px) saturate(145%);-webkit-backdrop-filter:blur(24px) saturate(145%);box-shadow:0 14px 38px rgba(0,0,0,.18),0 0 34px rgba(255,113,0,.04)}
.studio-tools-rail-track{display:flex;align-items:center;justify-content:center;gap:6px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;scrollbar-width:none;-webkit-overflow-scrolling:touch;touch-action:pan-x;overscroll-behavior-x:contain}.studio-tools-rail-track::-webkit-scrollbar{display:none}
.studio-tools-rail-item{flex:0 0 auto;min-width:116px;height:44px;padding:0 12px;display:flex;align-items:center;justify-content:center;gap:7px;scroll-snap-align:center;border:1px solid transparent;border-radius:14px;background:transparent;color:#a7a29a;text-decoration:none!important;font:500 12px/1.2 Vazirmatn,Vazir,Tahoma,sans-serif;white-space:nowrap;transition:.2s;cursor:pointer}.studio-tools-rail-item i{width:18px;height:18px;display:grid;place-items:center;font-style:normal}.studio-tools-rail-item svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}.studio-tools-rail-item:hover,.studio-tools-rail-item:focus-visible{color:#f0ebe4;background:rgba(255,255,255,.035);outline:none}.studio-tools-rail-item.active{color:#fff4e9;border-color:rgba(255,144,45,.27);background:linear-gradient(145deg,rgba(255,129,19,.18),rgba(255,103,0,.065));box-shadow:0 8px 24px rgba(255,104,0,.10),inset 0 1px rgba(255,255,255,.07)}.studio-tools-rail-item.active i{color:#ff9a40;filter:drop-shadow(0 0 7px rgba(255,117,13,.35))}
.studio-page #studioWorkspace,.studio-page #imageEdit,.studio-page #studioVideo,.studio-page #history{scroll-margin-top:145px!important}
html[data-theme="light"] .studio-tools-rail{border-color:rgba(39,49,65,.10);background:linear-gradient(145deg,rgba(255,255,255,.90),rgba(248,250,252,.82));box-shadow:0 12px 34px rgba(40,50,66,.10),0 0 30px rgba(255,122,16,.035)}html[data-theme="light"] .studio-tools-rail-item{color:#727c89}html[data-theme="light"] .studio-tools-rail-item:hover,html[data-theme="light"] .studio-tools-rail-item:focus-visible{color:#303a48;background:rgba(31,43,60,.035)}html[data-theme="light"] .studio-tools-rail-item.active{color:#9d4c00;border-color:rgba(224,111,8,.19);background:linear-gradient(145deg,rgba(255,143,43,.15),rgba(255,119,10,.045));box-shadow:0 8px 22px rgba(255,115,8,.08),inset 0 1px rgba(255,255,255,.8)}
@media(max-width:760px){.studio-tools-rail{top:66px;width:calc(100% - 14px);margin-top:7px;padding:5px;border-radius:17px}.studio-tools-rail-track{justify-content:flex-start;gap:5px;padding:1px}.studio-tools-rail-item{min-width:104px;height:42px;padding:0 10px;border-radius:12px;font-size:11.5px}.studio-page #studioWorkspace,.studio-page #imageEdit,.studio-page #studioVideo,.studio-page #history{scroll-margin-top:128px!important}}
@media(max-width:420px){.site-mobile-dock-item{min-width:74px;padding-inline:8px}.studio-tools-rail-item{min-width:100px}}
@media(prefers-reduced-motion:reduce){.site-mobile-dock-item,.studio-tools-rail-item{transition:none!important;scroll-behavior:auto!important}}

/* HF28.100 - DESKTOP RESTORE + BUY-MATCH MOBILE HEADER + KEYBOARD SAFE CHAT */
:root{--studio-visual-height:100dvh;--studio-visual-top:0px}
/* Defensive: these injected mobile-only elements must never render on desktop. */
.studio-mobile-menu-btn,.studio-mobile-header-panel{display:none}

@media(max-width:760px){
  /* AI Studio header deliberately inherits the exact shared v28/buy header language. */
  .studio-global-header.studio-buy-header-mobile{
    min-height:72px!important;height:72px!important;padding:0 10px!important;gap:0!important;overflow:visible!important
  }
  .studio-global-header.studio-buy-header-mobile .studio-top-nav{display:none!important}
  .studio-global-header.studio-buy-header-mobile .v28-brand{
    min-width:0!important;max-width:none!important;flex:1 1 auto!important;gap:8px!important;margin:0!important
  }
  .studio-global-header.studio-buy-header-mobile .v28-brand-copy{min-width:0!important;max-width:none!important}
  .studio-global-header.studio-buy-header-mobile .v28-brand-name{font-size:16px!important;line-height:1.2!important}
  .studio-global-header.studio-buy-header-mobile .v28-brand-copy small{
    display:block!important;font-size:12px!important;line-height:1.35!important;max-width:none!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important
  }
  .studio-global-header.studio-buy-header-mobile .studio-brand-mark{
    width:42px!important;height:42px!important;flex:0 0 42px!important
  }
  .studio-global-header.studio-buy-header-mobile .v28-top-actions{
    position:relative!important;display:flex!important;align-items:center!important;gap:5px!important;margin-inline-start:0!important;min-width:0!important;flex:0 0 auto!important;overflow:visible!important
  }
  .studio-global-header.studio-buy-header-mobile .pbui-account{display:flex!important;align-items:center!important;gap:8px!important}
  .studio-global-header.studio-buy-header-mobile .pbui-token-pill{
    height:42px!important;min-height:42px!important;padding:0 11px 0 13px!important
  }
  .studio-global-header.studio-buy-header-mobile .pbui-token-pill small{display:block!important}
  .studio-global-header.studio-buy-header-mobile .pbui-theme-global,
  .studio-global-header.studio-buy-header-mobile .pbui-crown-btn,
  .studio-global-header.studio-buy-header-mobile .pbui-notify-btn{
    width:42px!important;height:42px!important;min-width:42px!important;flex:0 0 42px!important
  }
  .studio-mobile-menu-btn.pbui-theme-btn{
    display:grid!important;width:42px!important;height:42px!important;min-width:42px!important;flex:0 0 42px!important;padding:0!important;cursor:pointer!important;-webkit-tap-highlight-color:transparent!important
  }
  .studio-mobile-menu-btn>span{width:18px;height:14px;display:flex;flex-direction:column;justify-content:space-between}
  .studio-mobile-menu-btn i{display:block;width:18px;height:1.7px;border-radius:99px;background:currentColor;transition:transform .18s ease,opacity .18s ease}
  .studio-mobile-menu-btn[aria-expanded="true"] i:nth-child(1){transform:translateY(6.15px) rotate(45deg)}
  .studio-mobile-menu-btn[aria-expanded="true"] i:nth-child(2){opacity:0}
  .studio-mobile-menu-btn[aria-expanded="true"] i:nth-child(3){transform:translateY(-6.15px) rotate(-45deg)}

  .studio-mobile-header-panel{
    display:block;position:absolute;z-index:1250;top:calc(100% + 6px);left:8px;right:8px;padding:8px;border:1px solid rgba(255,142,42,.17);border-radius:18px;
    background:linear-gradient(145deg,rgba(24,25,23,.97),rgba(10,11,10,.96));backdrop-filter:blur(28px) saturate(150%);-webkit-backdrop-filter:blur(28px) saturate(150%);
    box-shadow:0 22px 58px rgba(0,0,0,.34),0 0 32px rgba(255,112,0,.05);opacity:0;visibility:hidden;transform:translateY(-5px) scale(.985);transform-origin:top left;transition:.18s ease;pointer-events:none
  }
  .studio-global-header.studio-mobile-menu-open .studio-mobile-header-panel{opacity:1;visibility:visible;transform:translateY(0) scale(1);pointer-events:auto}
  html[data-theme="light"] .studio-mobile-header-panel{background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(250,247,243,.97));border-color:rgba(219,112,19,.15);box-shadow:0 20px 48px rgba(48,45,41,.14)}
  .studio-mobile-header-panel-track{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .studio-mobile-header-link{min-height:58px;padding:7px 5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;border:1px solid transparent;border-radius:13px;color:#aba69e;text-decoration:none!important;font:600 10.5px/1.25 Vazirmatn,Vazir,Tahoma,sans-serif;text-align:center}
  .studio-mobile-header-link i{width:20px;height:20px;display:grid;place-items:center;color:#d39a65}.studio-mobile-header-link svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
  .studio-mobile-header-link:hover,.studio-mobile-header-link:focus-visible,.studio-mobile-header-link.active{outline:none;color:#fff1e4;border-color:rgba(255,140,38,.19);background:rgba(255,127,17,.08)}
  html[data-theme="light"] .studio-mobile-header-link{color:#68717e}html[data-theme="light"] .studio-mobile-header-link:hover,html[data-theme="light"] .studio-mobile-header-link:focus-visible,html[data-theme="light"] .studio-mobile-header-link.active{color:#9d4c00;background:rgba(255,130,22,.07)}

  /* Shared header is 72px on mobile, so the premium tools rail starts immediately below it. */
  .studio-tools-rail{top:72px!important}
  .studio-page #studioWorkspace,.studio-page #imageEdit,.studio-page #studioVideo,.studio-page #history{scroll-margin-top:138px!important}

  /* Chat modal follows the visible browser viewport instead of the layout viewport. */
  .studio-chat-modal-v2871.is-open{
    inset:var(--studio-visual-top,0px) 0 auto 0!important;width:100%!important;height:var(--studio-visual-height,100dvh)!important;min-height:0!important;
    align-items:flex-end!important;justify-content:center!important;padding:6px 8px max(6px,env(safe-area-inset-bottom))!important;overflow:hidden!important
  }
  .studio-chat-modal-v2871.is-open .studio-chat-dialog-v2871{
    width:100%!important;height:calc(var(--studio-visual-height,100dvh) - max(12px,env(safe-area-inset-bottom)))!important;min-height:0!important;
    max-height:calc(var(--studio-visual-height,100dvh) - max(12px,env(safe-area-inset-bottom)))!important;border-radius:20px!important;overflow:hidden!important
  }
  .studio-chat-modal-v2871.is-keyboard-open-hf28100{padding-bottom:5px!important}
  .studio-chat-modal-v2871.is-keyboard-open-hf28100 .studio-chat-dialog-v2871{height:calc(var(--studio-visual-height,100dvh) - 10px)!important;max-height:calc(var(--studio-visual-height,100dvh) - 10px)!important;border-radius:17px!important}
  .studio-chat-modal-v2871 .studio-chat-modal-body-v2871{min-height:0!important;overflow:hidden!important}
  .studio-chat-modal-v2871 .studio-chat-card{min-height:0!important;overflow:hidden!important}
  .studio-chat-modal-v2871 .studio-chat-thread{flex:1 1 0!important;min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain!important;scrollbar-width:thin}
  .studio-chat-modal-v2871 .studio-chat-form{position:relative!important;z-index:4!important;flex:0 0 auto!important;padding:4px 0 max(2px,env(safe-area-inset-bottom))!important;background:linear-gradient(180deg,transparent,rgba(12,13,12,.94) 28%)!important}
  html[data-theme="light"] .studio-chat-modal-v2871 .studio-chat-form{background:linear-gradient(180deg,transparent,rgba(255,252,249,.96) 28%)!important}
  .studio-chat-modal-v2871 textarea{font-size:16px!important;line-height:1.55!important;max-height:110px!important;scroll-margin-bottom:10px!important}
  .studio-chat-modal-v2871.is-keyboard-open-hf28100 .studio-chat-topbar-v2871{height:50px!important;flex-basis:50px!important}
  .studio-chat-modal-v2871.is-keyboard-open-hf28100 .studio-chat-head{display:none!important}
  .studio-chat-modal-v2871.is-keyboard-open-hf28100 .studio-chat-modal-body-v2871{padding:6px!important}
  body.studio-chat-modal-open-v2871 .site-mobile-dock-shell{opacity:0!important;pointer-events:none!important}
}

@media(max-width:420px){
  .studio-global-header.studio-buy-header-mobile .v28-brand{gap:6px!important}
  .studio-global-header.studio-buy-header-mobile .studio-brand-mark{width:39px!important;height:39px!important;flex-basis:39px!important}
  .studio-global-header.studio-buy-header-mobile .v28-brand-name{font-size:15px!important}
  .studio-global-header.studio-buy-header-mobile .v28-brand-copy small{display:none!important}
  .studio-global-header.studio-buy-header-mobile .v28-top-actions{gap:3px!important}
  .studio-global-header.studio-buy-header-mobile .pbui-account{gap:3px!important}
  .studio-global-header.studio-buy-header-mobile .pbui-theme-global,
  .studio-global-header.studio-buy-header-mobile .pbui-crown-btn,
  .studio-global-header.studio-buy-header-mobile .pbui-notify-btn,
  .studio-mobile-menu-btn.pbui-theme-btn{width:40px!important;height:40px!important;min-width:40px!important;flex-basis:40px!important}
  .studio-global-header.studio-buy-header-mobile .pbui-token-pill{height:40px!important;min-height:40px!important;padding-inline:8px!important}
}
