/* 17.10 / v2: Keep the original baseline of every forum list row.
   Only vertically centre the icon and text group; no extra row min-height,
   no added top offset and no change to messages or reply buttons. */
html body :is(#forum,#forum_topics) .row > .col-lg-8 {
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  padding-top:10px!important;
  padding-bottom:10px!important;
}
html body :is(#forum,#forum_topics) .row > .col-lg-8 > img {
  flex:0 0 50px!important;
  align-self:center!important;
  float:none!important;
  margin:0!important;
}
html body :is(#forum,#forum_topics) .row > .col-lg-8 > div {
  flex:1 1 auto!important;
  min-width:0!important;
  width:auto!important;
  float:none!important;
  align-self:center!important;
}
html body :is(#forum,#forum_topics) .row > .col-lg-8 > div > h3 {
  height:auto!important;
  margin:0 0 3px!important;
  line-height:1.4!important;
}
html body :is(#forum,#forum_topics) .row > .col-lg-8 > div > p {
  margin:0!important;
  line-height:1.4!important;
}
/* Remove the left-side cyan/gold emphasis from actual forum section headers,
   but preserve the block fill, background gradient and horizontal separators. */
html body :is(#forum,#forum_topics) h2,
html body .topic-answers > div[id^="answer"] > .top-area {
  border-left:0!important;
  box-shadow:none!important;
}
html body :is(#forum,#forum_topics) h2::before,
html body :is(#forum,#forum_topics) h2::after {
  box-shadow:none!important;
  border-left:0!important;
}
/* Inside an opened topic, the author/date strip retains its original
   typography and height; do not shift the text or stretch its rows. */
html body .topic-answers > div[id^="answer"] > .top-area {
  align-items:center!important;
}
@media(max-width:991.98px){
  /* The site's mobile template uses a 28px icon + text CSS grid.
     Keep that grid and its original 8px vertical rhythm. */
  html.am-mobile-layout body #forum .row > .col-lg-8,
  html.am-mobile-layout body #forum_topics .row > .col-lg-8 {
    display:grid!important;
    grid-template-columns:28px minmax(0,1fr)!important;
    align-items:center!important;
    gap:8px!important;
    padding:0!important;
    min-height:0!important;
  }
  html.am-mobile-layout body #forum .row,
  html.am-mobile-layout body #forum_topics .row {
    padding-top:8px!important;
    padding-bottom:8px!important;
  }
  html.am-mobile-layout body :is(#forum,#forum_topics) .row>.col-lg-8>img {
    width:28px!important;height:28px!important;
    flex:none!important;
  }
  html.am-mobile-layout body :is(#forum,#forum_topics) .row>.col-lg-8>div>h3 {
    margin:0!important;
    line-height:1.4!important;
  }
  html.am-mobile-layout body :is(#forum,#forum_topics) .row>.col-lg-8>div>p {
    margin:4px 0 0!important;
    line-height:1.4!important;
  }
}

/* Profile card internal navigation: uniform link typography, including
   lines with icons, numeric labels and friend-request actions. Only profile. */
html body .profile-page .block.profile .vertical-navigation > ul > li > a {
  box-sizing: border-box !important;
  display: block !important;
  height: auto !important;
  min-height: 45px !important;
  padding: 11px 14px !important;
  margin: 0 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}
html body .profile-page .block.profile .vertical-navigation > ul > li > a > :is(.m-icon,i) {
  vertical-align: middle !important;
  margin-right: 5px !important;
}


/* 17.10 | Profile: identical empty-state presentation for unban requests
   and forum activity. Does not affect populated request lists. */
html body .profile-page .profile-small-is-empty #mybans.profile-empty-note {
  display:block!important;
  width:100%!important;
  max-width:none!important;
  min-height:0!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  float:none!important;
}
html body .profile-page .profile-small-is-empty #mybans.profile-empty-note::before,
html body .profile-page .profile-small-is-empty #mybans.profile-empty-note::after,
html body .profile-page .profile-small-is-empty #mybans.profile-empty-note .profile-common-empty::before,
html body .profile-page .profile-small-is-empty #mybans.profile-empty-note .profile-common-empty::after {
  content:none!important;
  display:none!important;
}
html body .profile-page .profile-small-is-empty #mybans.profile-empty-note .profile-common-empty {
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  min-height:100px!important;
  height:100px!important;
  max-height:100px!important;
  width:100%!important;
  margin:0!important;
  padding:0 30px!important;
  border:0!important;
  font-size:14px!important;
  font-weight:400!important;
  line-height:20px!important;
  text-align:left!important;
  color:#b7bacd!important;
  background:linear-gradient(180deg,#18212b00,#35405355)!important;
}

/* Friend-request notification: match unread-dialog visual, keep the
   entire toast inside the small iPhone viewport (no horizontal clipping). */
@media(max-width:650px) {
  html body ul[id^="noty_"]:has(.am-friend-request-notice) {
    box-sizing:border-box!important;
    position:fixed!important;
    left:auto!important;
    right:max(12px,env(safe-area-inset-right))!important;
    width:min(338px,calc(100vw - 24px))!important;
    min-width:0!important;
    max-width:calc(100vw - 24px)!important;
    margin:0!important;
    transform:none!important;
  }
  html body ul[id^="noty_"] > li:has(.am-friend-request-notice),
  html body .noty_bar.am-friend-request-notice {
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    left:auto!important;
    right:auto!important;
    margin:0!important;
    transform:none!important;
  }
  html body .noty_bar.am-friend-request-notice :is(.noty_message,.noty_body,.noty_text),
  html body .noty_bar.am-friend-request-notice .noty_text>a {
    box-sizing:border-box!important;
    max-width:100%!important;
    overflow-wrap:break-word!important;
  }
}

/* 17.10 | iOS mobile friend-request toast: Noty stores a measured
   height in its list item before the later visual class is applied.
   Allow the full border and content to render, not just the top part.
   Scope every selector to the friend-request toast only. */
@media (max-width:650px) {
  html body ul[id^="noty_"]:has(> li .noty_bar.am-friend-request-notice) {
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
  }
  html body ul[id^="noty_"] > li:has(.noty_bar.am-friend-request-notice) {
    display:block!important;
    box-sizing:border-box!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    padding:0!important;
    overflow:visible!important;
  }
  html body .noty_bar.am-friend-request-notice {
    display:block!important;
    box-sizing:border-box!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
    border-radius:9px!important;
  }
}

/* Tournament-match filters: use the *existing* statistics dropdown
   component, without changing select events, options or global menus. */
html body .automix .am-match-tournament-controls > .stats-sort-control.am-dark-select-host {
  box-sizing:border-box!important;
  flex:1 1 0!important;
  min-width:0!important;
  width:100%!important;
  max-width:none!important;
  background:linear-gradient(90deg,rgba(24,42,56,.96),rgba(14,28,40,.98))!important;
  border:1px solid #4a657a!important;
  border-radius:8px!important;
  box-shadow:none!important;
}
html body .automix .am-match-tournament-controls > .stats-sort-control.am-dark-select-host > .am-dark-select-button {
  box-sizing:border-box!important;
  min-width:0!important;
  width:100%!important;
  background:transparent!important;
  color:#eef5fb!important;
  border-radius:8px!important;
  font-weight:600!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
/* The real dropdown is portaled to body; target its accessible label. */
html body .am-dark-select-menu[aria-label="Турнир"],
html body .am-dark-select-menu[aria-label="Встречи турнира"] {
  box-sizing:border-box!important;
  background:linear-gradient(90deg,rgba(24,42,56,.985),rgba(14,28,40,.99))!important;
  color:#edf4fb!important;
  border:1px solid #4a657a!important;
  border-radius:0 0 8px 8px!important;
  padding:0!important;
  scrollbar-color:#748596 #14232f!important;
  scrollbar-width:thin;
}
html body .am-dark-select-menu[aria-label="Турнир"] > .am-dark-select-option,
html body .am-dark-select-menu[aria-label="Встречи турнира"] > .am-dark-select-option {
  background:transparent!important;
  color:#edf4fb!important;
  border-bottom:1px solid rgba(238,247,255,.17)!important;
}
html body .am-dark-select-menu:is([aria-label="Турнир"],[aria-label="Встречи турнира"]) > .am-dark-select-option:last-child {
  border-bottom:0!important;
}
html body .am-dark-select-menu:is([aria-label="Турнир"],[aria-label="Встречи турнира"]) > .am-dark-select-option[aria-selected="true"] {
  background:rgba(176,191,202,.16)!important;
  color:#f2f6fb!important;
}
html body .am-dark-select-menu:is([aria-label="Турнир"],[aria-label="Встречи турнира"]) > .am-dark-select-option:is(:hover,:focus-visible) {
  background:rgba(168,184,198,.10)!important;
  color:#fff6da!important;
}

/* 17.10 | Compact friend-request notice at the ORIGINAL Noty position.
   Do not set top or bottom: the notification system controls its placement.
   The border remains fully visible, but the touch target is smaller.
   :has() specificity beats the legacy mobile padding in mystyles.css. */
@media (max-width:650px) {
  html body .noty_bar.am-friend-request-notice:has(a[href$="friends"]) .noty_message,
  html body .noty_bar.am-friend-request-notice .noty_text {
    box-sizing:border-box!important;
    padding:0!important;
    margin:0!important;
    height:auto!important;
    min-height:0!important;
    line-height:18px!important;
  }
  html body .noty_bar.am-friend-request-notice .noty_text > a {
    box-sizing:border-box!important;
    display:block!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    padding:11px 10px!important;
    font-size:13px!important;
    line-height:18px!important;
    white-space:nowrap!important;
  }
}

/* 17.10 | MOBILE ONLY. A softer orange 2px frame with a truly
   feathered shadow: no solid 4px dark ring and no hard black underlay.
   Keep the 42px outer height and original Noty placement unchanged. */
@media (max-width:650px) {
  html body .noty_bar.am-friend-request-notice {
    border:2px solid #d88b4c!important;
    box-shadow:0 5px 18px rgba(0,0,0,.36),
               0 16px 36px rgba(0,0,0,.49),
               0 0 20px rgba(0,0,0,.27)!important;
  }
  /* 18px text line + 20px padding + 4px border = 42px total. */
  html body .noty_bar.am-friend-request-notice .noty_text > a {
    padding:10px 10px!important;
  }
}
