/* Page-specific layout only. Existing colours, gradients and selected states stay intact. */
html.am-rules-page .wapper .content .col-lg-9.order-is-first .with_code{
  line-height:1.5!important;
  overflow-wrap:anywhere;
}
html.am-rules-page .wapper .content .col-lg-9.order-is-first .with_code :is(p,ul,ol){
  margin-bottom:.72em!important;
  line-height:1.5!important;
}
html.am-rules-page .wapper .content .col-lg-9.order-is-first .with_code li{margin-bottom:.28em!important}
html.am-rules-page .wapper .content .col-lg-9.order-is-first .with_code :is(h1,h2,h3,h4){
  margin-top:1em!important;
  margin-bottom:.42em!important;
  line-height:1.35!important;
}

@media(max-width:650px){
  /* Keep the desktop two-column team card in one scaled phone-width canvas. */
  html.am-mobile-layout.am-team-page body .automix #am-content .am-body{
    box-sizing:border-box!important;
    width:820px!important;
    min-width:820px!important;
    max-width:none!important;
    padding:16px!important;
  }
  html.am-mobile-layout.am-team-page body .automix #am-content .am-team-presentation{
    display:grid!important;
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    grid-template-columns:300px minmax(0,1fr)!important;
    gap:24px!important;
    align-items:start!important;
    transform:none!important;
    transform-origin:top left!important;
  }
  html.am-mobile-layout.am-team-page body .automix #am-content .am-team-presentation .am-team-visual{
    display:block!important;
    min-width:0!important;
  }
  html.am-mobile-layout.am-team-page body .automix #am-content .am-team-presentation .am-team-visual>img{
    display:block!important;
    width:100%!important;
    max-width:none!important;
    height:auto!important;
    margin:0!important;
  }
  html.am-mobile-layout.am-team-page body .automix #am-content .am-team-presentation .am-team-visual h2{
    margin:16px 0 6px!important;
    font-size:24px!important;
  }
  html.am-mobile-layout.am-team-page body .automix #am-content .am-team-presentation .am-team-story{
    min-width:0!important;
  }
  html.am-mobile-layout.am-team-page body .automix #am-content .am-team-presentation .am-team-awards-list{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  html.am-mobile-layout.am-team-page body .automix #am-content .am-team-presentation.am-team-awards-left .am-team-visual .am-team-awards-list{
    grid-template-columns:1fr!important;
  }

  /* Full desktop composition of the VK landing content, fitted to the viewport. */
  html.am-mobile-layout.am-vk-page body .wapper .content .col-lg-9.order-is-first .with_code{
    box-sizing:border-box!important;
    width:760px!important;
    min-width:760px!important;
    max-width:none!important;
    transform:none!important;
    transform-origin:top left!important;
    overflow:visible!important;
    margin-left:auto!important;
    margin-right:auto!important;
    text-align:center!important;
  }
  html.am-mobile-layout.am-vk-page body .wapper .content .col-lg-9.order-is-first .with_code>a{display:block!important;text-align:center!important}
  html.am-mobile-layout.am-vk-page body .wapper .content .col-lg-9.order-is-first .with_code img{
    display:block;
    box-sizing:border-box!important;
    max-width:100%!important;
    height:auto!important;
    max-height:none!important;
    object-fit:contain!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  /* Use the available phone width for forum text, including topics and replies. */
  html.am-mobile-layout.am-forum-page body .wapper .content>.container{
    box-sizing:border-box!important;
    padding-left:8px!important;
    padding-right:8px!important;
  }
  html.am-mobile-layout.am-forum-page body .wapper .content>.container>.row{
    margin-left:-8px!important;
    margin-right:-8px!important;
  }
  html.am-mobile-layout.am-forum-page body .wapper .content>.container>.row>.col-lg-9.order-is-first{
    padding-left:8px!important;
    padding-right:8px!important;
    min-width:0!important;
  }
  html.am-mobile-layout.am-forum-page body .wapper .content>.container>.row>.col-lg-9.order-is-first>.block{
    box-sizing:border-box!important;
    padding-left:0!important;
    padding-right:0!important;
  }
  html.am-mobile-layout.am-forum-page body :is(#forum,#forum_topics,#answers){
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    margin-left:0!important;
    margin-right:0!important;
    padding-left:0!important;
    padding-right:0!important;
  }
  html.am-mobile-layout.am-forum-page body :is(#forum,#forum_topics)>.row{
    margin-left:0!important;
    margin-right:0!important;
    padding-left:8px!important;
    padding-right:8px!important;
  }
  html.am-mobile-layout.am-forum-page body .topic-answers .center-area .right-side{
    box-sizing:border-box!important;
    max-width:100%!important;
    padding-left:8px!important;
    padding-right:8px!important;
  }
  html.am-mobile-layout.am-forum-page body .topic-answers,
  html.am-mobile-layout.am-forum-page body .topic-answers div[id^=answer] .top-area{
    margin-left:0!important;
    margin-right:0!important;
  }

  /* The news list uses the same compact card rhythm as the home preview. */
  html.am-mobile-layout body .wapper .content .news{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:12px 7px!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    background:none!important;
  }
  html.am-mobile-layout body .wapper .content .news::before,
  html.am-mobile-layout body .wapper .content .news::after{content:none!important;display:none!important}
  html.am-mobile-layout body .wapper .content .news>div:not(.loader){
    display:flex!important;
    flex-direction:column!important;
    box-sizing:border-box!important;
    min-width:0!important;
    width:auto!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    overflow:hidden!important;
  }
  html.am-mobile-layout body .wapper .content .news>div:not(.loader) img{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    aspect-ratio:1!important;
    object-fit:contain!important;
  }
  html.am-mobile-layout body .wapper .content .news>div:not(.loader) h3{
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    overflow:hidden!important;
    min-height:2.5em!important;
    max-height:2.5em!important;
    margin:6px 0 5px!important;
    font-size:11px!important;
    line-height:1.25!important;
    overflow-wrap:anywhere!important;
  }
  html.am-mobile-layout body .wapper .content .news>div:not(.loader)>p{
    display:none!important;
  }
  html.am-mobile-layout body .wapper .content .news>div:not(.loader)>p:last-child{
    display:block!important;
    margin:auto 0 0!important;
    font-size:9px!important;
    line-height:1.3!important;
    white-space:normal!important;
  }
}
