/*
 * Core stability v237
 * One final ownership layer for authenticated account geometry, OTP, compose,
 * marketplace AI/filter overlays and public chrome stacking.
 */

html body.bu-nalog-page{
  --v237-head:72px;
  --v237-tabs:56px;
  --v237-side:220px;
  --v237-top:calc(var(--v237-head) + var(--v237-tabs));
  min-height:100dvh!important;
  overflow-x:clip!important;
}
html body.bu-nalog-page *,html body.bu-nalog-page *:before,html body.bu-nalog-page *:after{box-sizing:border-box!important}

/* One header, one account tab row, one sidebar. */
html body.bu-nalog-page .bu-global-chrome.bu-global-chrome-market{
  position:fixed!important;inset:0 0 auto!important;z-index:90000!important;
  width:100%!important;height:var(--v237-head)!important;min-height:var(--v237-head)!important;max-height:var(--v237-head)!important;
  margin:0!important;overflow:visible!important;
}
html body.bu-nalog-page .bu-global-chrome-market>.bu-board-header,
html body.bu-nalog-page .bu-board-header-inner{
  position:relative!important;inset:auto!important;width:100%!important;height:var(--v237-head)!important;
  min-height:var(--v237-head)!important;max-height:var(--v237-head)!important;margin:0!important;
}
html body.bu-nalog-page nav.bu-account-subnav{
  position:fixed!important;top:var(--v237-head)!important;right:0!important;left:var(--v237-side)!important;z-index:89500!important;
  display:block!important;width:auto!important;height:var(--v237-tabs)!important;min-height:var(--v237-tabs)!important;max-height:var(--v237-tabs)!important;
  margin:0!important;padding:0 14px!important;overflow:visible!important;border-radius:0!important;
}
html body.bu-nalog-page .bu-account-subnav-inner{
  display:flex!important;align-items:center!important;gap:5px!important;width:100%!important;height:100%!important;min-width:0!important;
  margin:0!important;padding:0!important;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:none!important;
}
html body.bu-nalog-page .bu-account-subnav-inner::-webkit-scrollbar{display:none!important}
html body.bu-nalog-page #bu-workspace-sidebar.bu-board-sidebar{
  position:fixed!important;top:var(--v237-head)!important;right:auto!important;bottom:0!important;left:0!important;z-index:89000!important;
  display:flex!important;flex-direction:column!important;width:var(--v237-side)!important;min-width:var(--v237-side)!important;max-width:var(--v237-side)!important;
  height:auto!important;min-height:0!important;margin:0!important;overflow:hidden!important;
}
html body.bu-nalog-page #bu-workspace-sidebar .bu-board-sidebar-nav{
  flex:1 1 auto!important;min-height:0!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain!important;
}
html body.bu-nalog-page #bu-workspace-sidebar .bu-board-sidebar-foot{
  position:relative!important;inset:auto!important;flex:0 0 auto!important;width:100%!important;max-width:100%!important;margin:0!important;
  padding:10px 12px 13px!important;overflow:hidden!important;background:#062d43!important;
}
html body.bu-nalog-page #bu-workspace-sidebar :is(.bu-side-legal,.bu-edition-rail){max-width:100%!important;overflow:hidden!important}

/* The shell width includes no hidden second viewport. */
html body.bu-nalog-page .bu-board-shell-wrap{
  position:relative!important;display:block!important;width:calc(100% - var(--v237-side))!important;max-width:none!important;min-width:0!important;
  min-height:calc(100dvh - var(--v237-top))!important;height:auto!important;max-height:none!important;
  margin:var(--v237-top) 0 0 var(--v237-side)!important;padding:0!important;overflow:visible!important;transform:none!important;
}
html body.bu-nalog-page .bu-board-main-col{
  position:relative!important;inset:auto!important;display:block!important;width:100%!important;max-width:none!important;min-width:0!important;
  height:auto!important;max-height:none!important;margin:0!important;padding:0!important;overflow:visible!important;transform:none!important;
}
html body.bu-nalog-page main.bu-nalog-flow{
  position:relative!important;inset:auto!important;display:block!important;width:min(100%,1520px)!important;max-width:1520px!important;min-width:0!important;
  min-height:calc(100dvh - var(--v237-top))!important;height:auto!important;max-height:none!important;
  margin:0 auto!important;padding:22px clamp(14px,2vw,26px) 44px!important;overflow:visible!important;transform:none!important;
}
html body.bu-nalog-page .bu-dash-main,
html body.bu-nalog-page .bu-nalog-win,
html body.bu-nalog-page .bu-account-panel,
html body.bu-nalog-page .bu-nalog-compose,
html body.bu-nalog-page .bu-post-layout-nalog{
  position:relative!important;inset:auto!important;width:100%!important;max-width:100%!important;min-width:0!important;
  height:auto!important;max-height:none!important;margin-inline:0!important;overflow:visible!important;transform:none!important;
}
html body.bu-nalog-page .bu-dash-main{margin:0!important;padding:0!important}
html body.bu-nalog-page .bu-nalog-win[hidden],html body.bu-nalog-page .bu-account-panel[hidden]{display:none!important}
html body.bu-nalog-page :is(.bu-account-panel,.bu-nalog-win,.bu-dash-v3){margin-left:0!important;margin-right:0!important}
html body.bu-nalog-page :is(.bu-team-grid,.bu-fleet-control-grid,.bu-fleet-account-grid,.bu-message-workspace,.bu-listings-row,.bu-bill-grid,.bu-data-split)>*{min-width:0!important;max-width:100%!important}

/* Account header controls stay inside their boxes at laptop widths. */
html body.bu-nalog-page .bu-board-header-inner{grid-template-columns:var(--v237-side) minmax(120px,1fr) auto!important;gap:12px!important;padding-right:12px!important}
html body.bu-nalog-page .bu-board-header-right{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:7px!important;min-width:0!important;max-width:100%!important}
html body.bu-nalog-page :is(.bu-header-app-launcher,.bu-lang-btn,.bu-bell-board,.bu-board-userchip){flex:0 0 auto!important;min-width:0!important;overflow:hidden!important}
html body.bu-nalog-page .bu-board-userchip{max-width:172px!important}
html body.bu-nalog-page .bu-board-userchip :is(strong,small){max-width:112px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
@media(min-width:901px) and (max-width:1280px){
  html body.bu-nalog-page{--v237-side:196px}
  html body.bu-nalog-page .bu-board-header-context:before{display:none!important}
  html body.bu-nalog-page .bu-board-header-context>strong{font-size:14px!important}
  html body.bu-nalog-page .bu-header-app-launcher{min-width:112px!important;max-width:128px!important}
  html body.bu-nalog-page .bu-board-userchip{width:44px!important;max-width:44px!important;padding:5px!important}
  html body.bu-nalog-page .bu-board-userchip .bu-target-user-copy{display:none!important}
  html body.bu-nalog-page .bu-compose-steps{grid-template-columns:1fr!important}
  html body.bu-nalog-page .bu-compose-step[data-step]{grid-column:1!important}
  html body.bu-nalog-page .bu-post-layout-nalog{grid-template-columns:minmax(0,1fr)!important}
  html body.bu-nalog-page .bu-post-map-card{position:relative!important;top:auto!important}
}

/* Compose is a readable task flow rather than four cramped panels. */
html body.bu-nalog-page .bu-nalog-compose{display:grid!important;gap:14px!important}
html body.bu-nalog-page .bu-compose-head{margin:0!important;padding:18px clamp(16px,2vw,24px)!important}
html body.bu-nalog-page .bu-compose-ai{
  position:relative!important;display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;gap:13px!important;
  width:100%!important;min-width:0!important;margin:0!important;padding:16px!important;overflow:hidden!important;
}
html body.bu-nalog-page .bu-compose-ai-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:9px!important;min-width:0!important}
html body.bu-nalog-page .bu-compose-ai-row :is(input,textarea){min-width:0!important}
html body.bu-nalog-page .bu-compose-steps{width:100%!important;min-width:0!important}
html body.bu-nalog-page .bu-compose-step{min-width:0!important;overflow:visible!important}
html body.bu-nalog-page .bu-geo-wrap,html body.bu-nalog-page .bu-place-row{position:relative!important;isolation:isolate!important}
html body.bu-nalog-page .bu-geo-wrap:focus-within,html body.bu-nalog-page .bu-place-row:focus-within{z-index:80!important}
html body.bu-nalog-page :is(.bu-geo-list,.bu-ac-list,.bu-autocomplete):not([hidden]){z-index:350000!important;max-height:260px!important;overflow:auto!important;background:#fff!important;box-shadow:0 20px 48px rgba(3,35,54,.22)!important}

/* OTP: topmost modal, centered copy and a submit path with visible progress. */
html body .bu-otp{
  position:fixed!important;inset:0!important;z-index:2147483000!important;align-items:center!important;justify-content:center!important;
  width:100vw!important;height:100dvh!important;margin:0!important;padding:18px!important;overflow:auto!important;
  background:rgba(3,24,39,.62)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
html body .bu-otp:not(.is-open){display:none!important}
html body .bu-otp.is-open{display:flex!important}
html body.bu-otp-open{overflow:hidden!important}
html body .bu-otp-card{
  position:relative!important;z-index:1!important;display:block!important;width:min(480px,100%)!important;max-width:480px!important;min-width:0!important;
  margin:auto!important;padding:clamp(22px,4vw,32px)!important;overflow:visible!important;text-align:center!important;pointer-events:auto!important;
}
html body .bu-otp-card .bu-kicker{display:block!important;width:100%!important;margin:0 auto 7px!important;text-align:center!important}
html body .bu-otp-card :is(h2,p){text-align:center!important}
html body .bu-otp-form{position:relative!important;z-index:2!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px!important;width:100%!important;pointer-events:auto!important}
html body .bu-otp-form :is(input,button){position:relative!important;z-index:2!important;pointer-events:auto!important}
html body .bu-otp-form button[disabled]{cursor:wait!important;opacity:.72!important}
html body .bu-otp-status{min-height:18px!important;margin:8px 0 0!important;color:#315b6e!important;font-size:12px!important;font-weight:750!important;text-align:center!important}
html body .bu-otp-bar{z-index:360000!important;max-width:min(470px,calc(100vw - 24px))!important}
html body:has(.bu-otp.is-open) .bu-otp-bar{display:none!important}

/* Marketplace: overlays always own the viewport; one AI entry point per mode. */
html body.bu-filters-open #bu-filter-scrim,html body #bu-filter-scrim:not([hidden]){z-index:510000!important}
html body.bu-filters-open #bu-filter-fold.open{z-index:510100!important;isolation:isolate!important}
html body.bu-filters-open #bu-filter-fold.open :is(.bu-geo-wrap,.bu-lane,.bu-filter-section):focus-within{position:relative!important;z-index:150!important}
html body.bu-filters-open #bu-filter-fold.open :is(.bu-geo-list,.bu-ac-list,.bu-autocomplete):not([hidden]){z-index:510250!important}
html body.bu-filters-open :is(.bu-cal,.bu-date-popover,.bu-calendar-popover){z-index:510300!important}
html body.bu-shell-unified #bu-notes:not([hidden]){z-index:500000!important}
html body.bu-shell-unified.bu-notes-open::before{z-index:499000!important;pointer-events:auto!important}
html body.bu-shell-unified.bu-notes-open #bu-notes.bu-notes:not([hidden]),
html body.bu-nalog-page.bu-notes-open #bu-notes.bu-notes:not([hidden]),
html body.bu-public-unified.bu-notes-open #bu-notes.bu-notes:not([hidden]){
  position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:auto!important;z-index:500000!important;
  display:grid!important;grid-template-rows:auto auto minmax(0,1fr)!important;width:min(460px,100vw)!important;height:100dvh!important;max-height:100dvh!important;
  margin:0!important;border-radius:0!important;overflow:hidden!important;background:#f6fbfd!important;box-shadow:-24px 0 70px rgba(2,30,47,.24)!important;
}
html body #bu-notes.bu-notes>header{
  display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;min-height:82px!important;
  margin:0!important;padding:16px!important;background:#07334a!important;color:#fff!important;
}
html body #bu-notes.bu-notes>header>strong{font-size:clamp(20px,4vw,28px)!important;line-height:1!important}
html body #bu-notes .bu-notes-head-actions{display:flex!important;align-items:center!important;gap:7px!important;min-width:0!important}
html body #bu-notes .bu-notes-head-actions .bu-btn{min-height:42px!important;padding:8px 12px!important;white-space:nowrap!important}
html body #bu-notes .bu-notes-head-actions [data-notes-close]{width:42px!important;min-width:42px!important;padding:0!important;font-size:24px!important}
html body #bu-notes .bu-notes-legend{margin:0!important;padding:11px 16px!important;border-bottom:1px solid #d9e8ee!important;background:#eef7fa!important;color:#456477!important;font-size:13px!important}
html body #bu-notes .bu-notes-list{min-height:0!important;padding:14px!important;overflow:auto!important;overscroll-behavior:contain!important}
html body #bu-notes .bu-note{max-width:100%!important;overflow:hidden!important}
@layer bu-workspace{
  @media(min-width:1100px){
    html body.bu-workspace.bu-board-page.bu-shell-unified .ut-right-rail:not([hidden]) .bu-dispo-fab,
    html body.bu-workspace.bu-board-page.bu-shell-unified .ut-right-rail:not([hidden])~#bu-fab-ai,
    html body.bu-workspace.bu-board-page.bu-shell-unified:has(.ut-right-rail:not([hidden])) #bu-fab-ai,
    html body.bu-workspace.bu-board-page.bu-shell-unified:has(.ut-right-rail:not([hidden])) #bu-dispo-fab,
    html body.bu-workspace.bu-board-page.bu-shell-unified:has(.ut-right-rail:not([hidden])) .bu-board-ai-fab{display:none!important}
  }
}
@media(min-width:900px) and (max-width:1365px){
  html body.bu-shell-unified.bu-ai-open:before{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  html body.bu-shell-unified.bu-ai-open .ut-right-rail{z-index:520000!important}
}

/* Public shell: Explore row sits in the main column and never covers sidebar. */
@media(min-width:901px){
  html body.bu-public-unified #bu-public-subnav{
    position:sticky!important;top:calc(var(--bu-pub-rail,28px) + var(--bu-pub-head,72px))!important;left:auto!important;z-index:82000!important;
    width:100%!important;margin:0!important;transform:none!important;
  }
  html body.bu-public-unified #bu-public-subnav .bu-public-subnav-inner{width:100%!important;max-width:none!important;padding:0 16px!important}
  html body.bu-public-unified .bu-board-sidebar{z-index:83000!important}
}

/* Phone contract. No desktop sidebar, no clipped account pages, modal fits. */
@media(max-width:900px){
  html body.bu-nalog-page{--v237-head:62px;--v237-tabs:56px;--v237-side:0px;--v237-top:118px}
  html body.bu-nalog-page #bu-workspace-sidebar.bu-board-sidebar{display:none!important}
  html body.bu-nalog-page nav.bu-account-subnav{top:var(--v237-head)!important;right:0!important;left:0!important;padding:0 8px!important}
  html body.bu-nalog-page .bu-board-shell-wrap{width:100%!important;min-height:calc(100dvh - var(--v237-top))!important;margin:var(--v237-top) 0 0!important}
  html body.bu-nalog-page main.bu-nalog-flow{width:100%!important;max-width:none!important;min-height:calc(100dvh - var(--v237-top))!important;padding:11px 9px calc(96px + env(safe-area-inset-bottom))!important}
  html body.bu-nalog-page .bu-board-header-inner{display:flex!important;grid-template-columns:none!important;gap:5px!important;padding:0 7px!important}
  html body.bu-nalog-page .bu-board-brand{flex:1 1 auto!important;width:auto!important;min-width:48px!important;max-width:112px!important;padding:6px 2px!important}
  html body.bu-nalog-page .bu-board-header-context{display:none!important}
  html body.bu-nalog-page .bu-board-header-right{flex:0 0 auto!important;gap:4px!important;margin-left:auto!important}
  html body.bu-nalog-page :is(.bu-header-app-launcher,.bu-lang-btn,.bu-bell-board,.bu-board-userchip){height:40px!important;min-height:40px!important;max-height:40px!important;border-radius:12px!important}
  html body.bu-nalog-page .bu-header-app-launcher{width:40px!important;min-width:40px!important;max-width:40px!important;padding:4px!important}
  html body.bu-nalog-page .bu-header-app-launcher>span:last-child{display:none!important}
  html body.bu-nalog-page .bu-lang-pick,html body.bu-nalog-page .bu-lang-btn{width:40px!important;min-width:40px!important;max-width:40px!important}
  html body.bu-nalog-page .bu-lang-btn-meta,html body.bu-nalog-page .bu-lang-btn-caret{display:none!important}
  html body.bu-nalog-page .bu-bell-board{width:40px!important;min-width:40px!important;max-width:40px!important}
  html body.bu-nalog-page .bu-board-userchip{width:40px!important;min-width:40px!important;max-width:40px!important;padding:4px!important}
  html body.bu-nalog-page .bu-board-userchip .bu-target-user-copy{display:none!important}
  html body.bu-nalog-page :is(.bu-account-panel,.bu-nalog-win,.bu-dash-v3){width:100%!important;padding:13px!important;border-radius:17px!important}
  html body.bu-nalog-page :is(.bu-team-grid,.bu-fleet-control-grid,.bu-fleet-account-grid,.bu-bill-grid,.bu-data-split,.bu-post-maps-2){grid-template-columns:minmax(0,1fr)!important}
  html body.bu-nalog-page .bu-message-workspace{display:grid!important;grid-template-columns:minmax(0,1fr)!important;height:auto!important;min-height:0!important;overflow:visible!important}
  html body.bu-nalog-page .bu-poruke-dock{width:100%!important;height:auto!important;min-height:460px!important;overflow:hidden!important}
  html body.bu-nalog-page .bu-compose-ai{grid-template-columns:minmax(0,1fr)!important;padding:14px!important}
  html body.bu-nalog-page .bu-compose-ai-row{grid-template-columns:minmax(0,1fr)!important}
  html body.bu-nalog-page .bu-compose-ai-row .bu-btn{width:100%!important}
  html body.bu-nalog-page .bu-compose-steps{grid-template-columns:minmax(0,1fr)!important}
  html body.bu-nalog-page .bu-compose-step[data-step]{grid-column:1!important}
  html body.bu-nalog-page .bu-otp-bar{right:8px!important;bottom:calc(82px + env(safe-area-inset-bottom))!important;left:8px!important;width:auto!important}
}
@media(max-width:520px){
  html body #bu-notes.bu-notes>header{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:11px!important;padding:15px!important}
  html body #bu-notes .bu-notes-head-actions{display:grid!important;grid-template-columns:minmax(0,1fr) auto 44px!important;width:100%!important}
  html body #bu-notes .bu-notes-head-actions .bu-btn{width:100%!important;min-width:0!important;padding:8px 9px!important;font-size:12px!important}
  html body #bu-notes .bu-notes-list{padding:10px!important}
  html body .bu-otp{padding:10px!important}
  html body .bu-otp-card{padding:22px 15px!important;border-radius:21px!important}
  html body .bu-otp-form{grid-template-columns:minmax(0,1fr)!important}
  html body .bu-otp-form .bu-btn{width:100%!important}
  html body .bu-otp-secondary{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important}
  html body .bu-otp-secondary form,html body .bu-otp-secondary .bu-btn{width:100%!important}
  html body.bu-nalog-page .bu-board-brand-system{display:none!important}
  html body.bu-nalog-page .bu-board-brand{max-width:54px!important}
  html body.bu-nalog-page a.bu-account-subtab{min-width:42px!important;padding:0 10px!important}
  html body.bu-nalog-page a.bu-account-subtab span{display:none!important}
  html body.bu-nalog-page a.bu-account-subtab.is-on span{display:inline!important}
}

@media(prefers-reduced-motion:reduce){html body.bu-nalog-page *,html body .bu-otp *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

