/* Mobile controls shared by the public site and the Telegram Mini App. */
@media (max-width: 760px) {
  :root {
    --dock-metal: linear-gradient(168deg, #38475b 0%, #2a3647 44%, #202b39 100%);
    --dock-surface: linear-gradient(to bottom, #222529, #151719 18px, #131517);
    --dock-face: #f1f2f3;
    --dock-edge: #536377;
    --dock-height: 72px;
    --dock-safe: max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
  }

  .mobile-dock, .shop-account .account-dock,
  .shop-entry .cta-bar, .shop-payment .payment-actions, .shop-checkout .payment-actions {
    background: var(--dock-surface);
    border-top: 1px solid #44484d;
    box-shadow: 0 -4px 12px rgb(0 0 0 / .14);
  }
  .mobile-dock {
    min-height: calc(var(--dock-height) + var(--dock-safe));
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(105px,1.23fr);
    align-items: center;
    gap: 4px;
    padding: 6px max(12px,env(safe-area-inset-right)) calc(6px + var(--dock-safe)) max(12px,env(safe-area-inset-left));
  }
  .mobile-dock a:not(.dock-primary),
  .shop-account .account-dock :is(a,button) {
    min-width: 0;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    padding: 2px;
    border: 0;
    border-radius: 5px;
    color: #c0c5cc;
    background: transparent;
    text-decoration: none;
    font: 550 15px/1.12 var(--bb-interface,system-ui);
    -webkit-tap-highlight-color: transparent;
  }
  .dock-icon { display:block; flex:none; width:21px; height:21px; color:#aab6c5; }
  .mobile-dock a[aria-current]:not(.dock-primary),
  .shop-account .account-dock [aria-current] { color:#fff; background:#272d34; }
  .mobile-dock [aria-current] .dock-icon, .account-dock [aria-current] .dock-icon { color:#a8ccff; }
  .mobile-dock a:not(.dock-primary):active,.shop-account .account-dock :is(a,button):active { background:#30363c; color:white; }

  .mobile-dock a.dock-primary,
  .app-page :is(#choose,#open-form,#directory-apply,#check-license,#partner-register,#partner-buy-link,#catalog-payment,#catalog-confirm),
  .shop-payment #submit,.shop-checkout .payment-actions #retry,.shop-checkout #retry[hidden]+#support,
  .shop-choice .guide-actions .primary-action,
  .shop-partners :is(#own-profile-form,#application-form) button[type=submit] {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    min-height:50px; padding:11px 16px;
    border:1px solid var(--dock-edge); border-top-color:#768495; border-bottom-color:#161e28;
    border-radius:6px; background:var(--dock-metal); color:var(--dock-face);
    box-shadow:inset 0 1px 0 rgb(255 255 255 / .06), 0 2px 3px rgb(0 0 0 / .28);
    font:600 17px/1.2 var(--bb-interface, system-ui);
    text-align:left; text-decoration:none; -webkit-tap-highlight-color:transparent;
  }
  .mobile-dock a.dock-primary { font-size:16px; padding-inline:12px; min-height:50px; }
  .mobile-dock a.dock-primary > span { color:inherit; }
  .app-page :is(#choose,#open-form,#directory-apply,#check-license,#partner-register,#partner-buy-link,#catalog-payment,#catalog-confirm),
  .shop-payment #submit,.shop-checkout .payment-actions #retry,.shop-checkout #retry[hidden]+#support,
  .shop-choice .guide-actions .primary-action,
  .shop-partners :is(#own-profile-form,#application-form) button[type=submit] { justify-content:flex-start; }
  .app-page :is(#choose,#open-form,#directory-apply,#check-license,#partner-register,#partner-buy-link,#catalog-payment,#catalog-confirm)::before,
  .shop-payment #submit::before,.shop-checkout .payment-actions #retry::before,.shop-checkout #retry[hidden]+#support::before,
  .shop-choice .guide-actions .primary-action::before,
  .shop-partners :is(#own-profile-form,#application-form) button[type=submit]::before {
    content:""; width:13px; height:10px; flex:none; transform:skewX(-24deg);
    background:linear-gradient(90deg,#5e9edc 0 42%,transparent 42% 57%,#d75161 57%);
  }
  .mobile-dock a.dock-primary::after,
  .app-page :is(#choose,#open-form,#directory-apply,#check-license,#partner-register,#partner-buy-link,#catalog-payment,#catalog-confirm)::after,
  .shop-payment #submit::after,.shop-checkout .payment-actions #retry::after,.shop-checkout #retry[hidden]+#support::after,
  .shop-choice .guide-actions .primary-action::after,
  .shop-partners :is(#own-profile-form,#application-form) button[type=submit]::after {
    content:""; flex:none; width:7px; height:7px; margin-inline:auto 2px;
    border-top:1.75px solid currentColor; border-right:1.75px solid currentColor;
    transform:rotate(45deg); color:#c0d1e6;
  }
  .app-page :is(#choose,#check-license,#partner-register,#catalog-confirm)>span[aria-hidden=true] { display:none; }
  .mobile-dock a.dock-primary:active,
  .app-page :is(#choose,#open-form,#directory-apply,#check-license,#partner-register,#partner-buy-link,#catalog-payment,#catalog-confirm,#submit,#retry,.primary-action):active,
  .shop-partners :is(#own-profile-form,#application-form) button[type=submit]:active {
    background:#202a37; box-shadow:inset 0 2px 4px rgb(0 0 0 / .45); border-color:#455468;
  }
  .app-page :is(#choose,#check-license,#partner-register,#catalog-confirm,#submit,.primary-action):disabled,
  .shop-partners :is(#own-profile-form,#application-form) button[type=submit]:disabled {
    background:#24272b; border-color:#41454a; box-shadow:none; color:#afb5bd; opacity:1;
  }
  :is(.mobile-dock,.account-dock,.cta-bar,.payment-actions,.guide-actions) :is(a,button):focus-visible {
    outline:2px solid #bad5f7; outline-offset:2px;
  }
  @media(prefers-reduced-motion:no-preference) {
    .mobile-dock a,.account-dock :is(a,button),.cta-bar button,.payment-actions :is(a,button) {
      transition:background-color .16s ease,color .16s ease,box-shadow .12s ease;
    }
  }
}
@media(max-width:680px) {
  .shop-account:has(#owner:not([hidden])) .account-dock {
    min-height:calc(var(--dock-height) + var(--dock-safe)); padding:6px 9px calc(6px + var(--dock-safe));
  }
  .shop-entry .cta-bar,.shop-payment .payment-actions,.shop-checkout .payment-actions {
    padding:10px max(16px,env(safe-area-inset-right)) calc(10px + var(--dock-safe)) max(16px,env(safe-area-inset-left));
  }
  .shop-partners:not(:has(input:focus,textarea:focus,select:focus)):has(#directory:not([hidden]),#offer:not([hidden]),#application:not([hidden]) #application-form:not([hidden]),#own-profile:not([hidden]) #own-profile-form:not([hidden]))::after {
    content:""; position:fixed; pointer-events:none; z-index:5; bottom:0; left:0; right:0;
    height:calc(var(--dock-height) + var(--dock-safe)); border-top:1px solid #44484d;
    background:var(--dock-surface);
  }
  .shop-partners :is(#open-form,#directory-apply),
  .shop-partners :is(#own-profile-form,#application-form) button[type=submit] { bottom:calc(10px + var(--dock-safe)); }
}
