/* CSAutoMix 15.10: targeted visual carryover from 14.10.
   No page layouts, chat behaviour, tournament UI or plugins are replaced. */

/* Unified restrained scrollbars site-wide (including nested panels). */
:root {
  --am-scroll-track: #171d23;
  --am-scroll-thumb: #746b60;
  --am-scroll-thumb-hover: #9d8d73;
}
html, body, html body * {
  scrollbar-width: thin !important;
  scrollbar-color: var(--am-scroll-thumb) var(--am-scroll-track) !important;
}
html::-webkit-scrollbar, body::-webkit-scrollbar, html body *::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
  background: var(--am-scroll-track) !important;
}
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track, html body *::-webkit-scrollbar-track {
  background: var(--am-scroll-track) !important;
  border-radius: 6px !important;
}
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb, html body *::-webkit-scrollbar-thumb {
  background: var(--am-scroll-thumb) !important;
  border: 2px solid var(--am-scroll-track) !important;
  border-radius: 7px !important;
}
html::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover, html body *::-webkit-scrollbar-thumb:hover {
  background: var(--am-scroll-thumb-hover) !important;
}
html::-webkit-scrollbar-button, body::-webkit-scrollbar-button, html body *::-webkit-scrollbar-button {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
}

/* Ban appeal: the two decision colours specifically approved in 14.10. */
html body .ban-application button.btn-success[onclick*="close_ban"] {
  color: #96d1ac !important;
  -webkit-text-fill-color: #96d1ac !important;
}
html body .ban-application button.btn-warning[onclick*="close_ban"] {
  color: #df9b9b !important;
  -webkit-text-fill-color: #df9b9b !important;
}

/* TinyMCE frame chrome. The editor's inner document is handled by JS below. */
html body :is(.mce-tinymce, .tox-tinymce) {
  border-color: #515b63 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}
html body :is(.mce-tinymce .mce-toolbar-grp, .mce-tinymce .mce-statusbar, .tox-tinymce .tox-editor-header, .tox-tinymce .tox-statusbar) {
  background: #252d34 !important;
  border-color: #47525b !important;
}
html body :is(.mce-tinymce .mce-edit-area, .tox-tinymce .tox-edit-area) {
  background: #171d23 !important;
  border-color: #47525b !important;
  overflow: hidden !important;
}
html body :is(.mce-tinymce .mce-edit-area > iframe, .tox-tinymce .tox-edit-area__iframe) {
  display: block !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background: #171d23 !important;
}

/* Direct-message history: scrollbar never covers the timestamp. */
html body #place_for_messages #messages {
  box-sizing: border-box !important;
  min-width: 0 !important;
  padding-right: 12px !important;
  scrollbar-gutter: stable !important;
  background: transparent !important;
}
html body #place_for_messages #messages .im_message > div > .info {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 10px !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 18px !important;
  margin-bottom: 3px !important;
}
html body #place_for_messages #messages .im_message > div > .info > a {
  float: none !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: #e5dfc9 !important;
  -webkit-text-fill-color: #e5dfc9 !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}
html body #place_for_messages #messages .im_message > div > .info > a:hover {
  color: #fff0c8 !important;
  -webkit-text-fill-color: #fff0c8 !important;
}
html body #place_for_messages #messages .im_message > div > .info > .date,
html body #place_for_messages #messages .im_message > div > .info > span {
  float: none !important;
  flex: 0 0 auto !important;
  margin-left: auto !important;
  padding-right: 2px !important;
  white-space: nowrap !important;
  color: #97a4b0 !important;
}
html body #place_for_messages #messages .im_message > div > .info + *,
html body #place_for_messages #messages .im_message .with_code {
  color: #aeb8c1 !important;
  font-weight: 400 !important;
  line-height: 1.48 !important;
}

/* Inbox: 14.10 graphite rows, subdued actions, pale gold nicknames. */
html body #place_for_messages .dialog {
  box-sizing: border-box !important;
  background: #19242e !important;
  border: 1px solid #46545e !important;
  border-radius: 8px !important;
  box-shadow: inset 0 1px rgba(255,255,255,.025) !important;
}
html body #place_for_messages .dialog > div:nth-child(1),
html body #place_for_messages .dialog > div:nth-child(2) {
  background: transparent !important;
  border: 0 !important;
}
html body #place_for_messages .dialog:hover {
  background: #22313b !important;
  border-color: #687985 !important;
}
html body #place_for_messages .dialog > div:nth-child(1) div p:first-child {
  color: #e5dfc9 !important;
  -webkit-text-fill-color: #e5dfc9 !important;
  font-weight: 700 !important;
}
html body #place_for_messages .dialog > div:nth-child(1) div p:nth-child(2) {
  color: #aeb8c1 !important;
  -webkit-text-fill-color: #aeb8c1 !important;
}
html body #place_for_messages .dialog .text-success { color: #88bfaa !important; }
html body #place_for_messages .dialog .text-info { color: #96b9c9 !important; }
html body #place_for_messages .dialog > div:nth-child(2) span { color: #8997a2 !important; }
html body #place_for_messages .dialog > div:nth-child(2):hover span { color: #e0ab9d !important; }
@media (max-width:650px) {
  html body .wapper .content .block.dialogs,
  html body .dialogs #place_for_messages {
    box-sizing: border-box !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  html body .dialogs #place_for_messages { padding-left: 5px !important; padding-right: 5px !important; }
  html body .dialogs .dialog { margin-left: 0 !important; margin-right: 0 !important; }
}

/* General chat: do not override author inline {gp_color} from chat_message.tpl.
   Individual nickname color must follow the user's assigned group. */

/* The 14.10 unread-direct-dialog popup (does not change other notifications). */
html body ul[id^="noty_"]:has(.am-unread-dialog-notice) {
  box-sizing: border-box !important;
  right: 12px !important;
  left: auto !important;
  width: min(338px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body ul[id^="noty_"] > li:has(.am-unread-dialog-notice) {
  box-sizing: border-box !important;
  width: 100% !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
html body .noty_bar.am-unread-dialog-notice {
  box-sizing: border-box !important;
  display: block !important;
  max-width: 100% !important;
  background: linear-gradient(105deg,#263747,#182633) !important;
  border: 1px solid #aa9468 !important;
  border-radius: 9px !important;
  color: #f1dfb7 !important;
  box-shadow: 0 5px 17px rgba(0,0,0,.32) !important;
  overflow: hidden !important;
}
html body .noty_bar.am-unread-dialog-notice :is(.noty_message,.noty_body,.noty_text) {
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #f1dfb7 !important;
}
html body .noty_bar.am-unread-dialog-notice .noty_text > a {
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  padding: 10px 12px !important;
  color: #f1dfb7 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}
html body .noty_bar.am-unread-dialog-notice .noty_text > a:hover {
  background: rgba(224,196,137,.08) !important;
  color: #fff0c9 !important;
}


/* 15.10 follow-up: actual text areas from 14.10, not just their rich-editor frame.
   Only appeal/profile-wall comments and private-message compose fields. */
html body .wapper .content :is(.ban-application,#add_new_comments,#place_for_messages) textarea#text,
html body .wapper .content #place_for_messages textarea.form-control {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  background: #171d23 !important;
  color: #dbe3e9 !important;
  -webkit-text-fill-color: #dbe3e9 !important;
  border: 1px solid #515b63 !important;
  border-radius: 9px !important;
  box-shadow: inset 0 1px rgba(255,255,255,.025) !important;
}
html body .wapper .content :is(.ban-application,#add_new_comments,#place_for_messages) textarea#text:focus,
html body .wapper .content #place_for_messages textarea.form-control:focus {
  border-color: #9b8869 !important;
  box-shadow: 0 0 0 2px rgba(185,158,107,.12) !important;
  outline: none !important;
}
html body .wapper .content :is(.ban-application,#add_new_comments,#place_for_messages) textarea#text::placeholder,
html body .wapper .content #place_for_messages textarea.form-control::placeholder {
  color: #9daab7 !important;
  -webkit-text-fill-color: #9daab7 !important;
  opacity: 1 !important;
}
/* TinyMCE: match the 14.10 graphite composing field, including toolbar and
   status bar. The iframe document's background/gutter is corrected by JS. */
html body :is(.mce-tinymce,.tox-tinymce) {
  box-sizing: border-box !important;
  max-width: 100% !important;
  background: #171d23 !important;
  border: 1px solid #515b63 !important;
  border-radius: 9px !important;
  overflow: hidden !important;
}
html body :is(.mce-tinymce .mce-toolbar-grp,.mce-tinymce .mce-statusbar,.tox-tinymce .tox-editor-header,.tox-tinymce .tox-statusbar) {
  background: #252d34 !important;
  border-color: #47525b !important;
}
html body :is(.mce-tinymce .mce-edit-area,.tox-tinymce .tox-edit-area) {
  background: #171d23 !important;
  border-color: #47525b !important;
  overflow: hidden !important;
}
html body :is(.mce-tinymce .mce-edit-area > iframe,.tox-tinymce .tox-edit-area__iframe) {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  background: #171d23 !important;
}

/* Mobile private dialogs: use the available card width on both the inbox and
   an opened conversation. Do not modify the global Bootstrap container. */
@media (max-width: 650px) {
  html body .wapper .content .row > .col-lg-9:has(> .block.dialogs),
  html body .wapper .content .row > .col-md-9:has(> .block.dialogs),
  html body .wapper .content .row > .col-lg-12:has(> .block.dialogs) {
    box-sizing: border-box !important;
    min-width: 0 !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
  html body .wapper .content .block.dialogs {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  html body .wapper .content .block.dialogs > .block_head {
    box-sizing: border-box !important;
    padding: 14px 12px !important;
    margin: 0 !important;
  }
  html body .wapper .content .block.dialogs > .block_head:has(#back_btn) {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }
  html body .wapper .content .block.dialogs #back_btn {
    position: static !important;
    top: auto !important;
    right: auto !important;
    margin: 0 0 0 auto !important;
  }
  html body .wapper .content .block.dialogs > #place_for_messages {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 6px !important;
  }
  html body .wapper .content .block.dialogs #place_for_messages > .dialog {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 5px !important;
  }
  html body .wapper .content .block.dialogs #place_for_messages #chat,
  html body .wapper .content .block.dialogs #place_for_messages #drop_zone,
  html body .wapper .content .block.dialogs #place_for_messages form {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  html body .wapper .content .block.dialogs #place_for_messages #messages {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-left: 1px !important;
    padding-right: 10px !important;
    scrollbar-gutter: auto !important;
  }
  html body .wapper .content .block.dialogs #place_for_messages .im_message {
    box-sizing: border-box !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
  html body .wapper .content .block.dialogs #place_for_messages .im_message > div {
    box-sizing: border-box !important;
    min-width: 0 !important;
  }
  html body .wapper .content .block.dialogs #place_for_messages textarea#text {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}
