@import url(style_cs.1785245811.css);
@import url(https://magiascript.ru/design/bundle-overrides.css);

/* Иконический шрифт */
@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200");

/* Font Awesome */
@import url("https://kit-pro.fontawesome.com/releases/v6.6.0/css/pro.min.css");

/* Шрифты Гугл */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Lora:ital,wght@0,400..700;1,400..700&family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

@import url('https://forumstatic.ru/files/001a/fa/19/46585.css?v=1');
@import url('https://forumstatic.ru/files/001a/fa/19/85244.css');
@import url('//magiascript.ru/css/fonts/cormorantsc.css?v=2');

@import url('//magiascript.ru/css/fonts/lora.css?v=3');

@font-face {
    font-family: 'Alchemy';
    font-style: normal;
    font-weight: 500;
    src: url(//forumstatic.ru/files/001a/fa/19/54225.otf);
}


/****************************************
Чистый стиль by Alex Kolmar (бродяга)
****************************************/

/* Полезные сервисные настройки
-------------------------------------------------------------*/

.acchide,
#pun-index #pun-main h1,
#pun-navlinks h2,
#pun-pagelinks h2,
#pun-status h2,
#pun-ulinks h2,
.punbb .forum h2,
.punbb .multipage .topic h2,
.punbb dl.post-sig dt span,
.punbb p.crumbs strong,
.punbb .divider hr,
.punbb .required label em,
.punbb .formsubmit label,
.punbb .submitfield label,
.punbb .modmenu label,
#pun-userlist .main h2 {
  font-size: 0;
  height: 0;
  width: 0;
  line-height: 0.0;
  position: absolute;
  left: -9999px;
  overflow: hidden;
}

#pun:after,
.punbb .container:after,
.punbb .post-links ul:after,
.punbb .main div.inline:after,
.punbb .post-box:after,
.punbb .linksb:after {
  clear: both;
  content: ".";
  display: block;
  height: 0;
  visibility: hidden;
  overflow: hidden;
  line-height: 0.0;
  font-size: 0;
}


/* Основные переменные
------------------------------------------*/

:root {
  --main-text-color: #343434;
  --secondary-text-color: #656565;
  --third-text-color: #c9c3ad;
  --accent-red: #924035;
  --accent-blue: #3b4559;
  --accent-yellow: #b8a467;
  --opacity-cover: rgba(108, 101, 80, 0.1);
  --cover: #bbb59f;
  --light-cover: #beb8a2;
  --borders-color: #9b917a;
  --borders-color-lighter: #bdb39c;
  --borders-for-dark-bg: #575d6a;
  --scrollbar-bg: #00000026;
  --text-shadow: 0 0 8px #f6eed1;
  --pun-bg: var(--cover);
  --sec-bg: var(--light-cover);
  --link-hover: var(--accent-red);
  --pwidth: 220px;
  --pad1: 10px 70px;
  --pad2: 5px 70px;
  --pad3: 5px 10px;
  --msr: "Material Symbols Rounded";
  --fa: "Font Awesome 6 Pro", "Font Awesome 6 Brands";
  --font-family: "Lora", sans-serif;
  --second-family: "Roboto", sans-serif;
  --third-family: "Alchemy", sans-serif;
  --font3: "Verdana", sans-serif;
  --font4: "Playfair Display", sans-serif;
  --font5: "Inter", sans-serif;
  --noise: url(https://forumstatic.ru/files/0016/01/4e/87978.png) repeat;
}

/* Global
------------------------------------------*/

/* Применяется ко всем элементам */

* {
  margin: 0;
  padding: 0;
  border: none;
  box-sizing: border-box;
  text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* прокрутка 
-------------------------------------------------- */

/* Хром etc */

@supports selector(::-webkit-scrollbar) {

  *::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 5px;
  }

  *::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
    cursor: default;
  }

  *::-webkit-scrollbar-track {
    border-radius: 10px;
    background: var(--light-cover);
  }

  *::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
}

/* Мозилла */

@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) var(--light-cover);
  }
}

/* выделение текста */

::selection {
  background: var(--accent-red);
  color: var(--pun-bg);
}

:focus {
  outline: none;
}

/* все ссылки */

a,
.punbb #pun-admain a {
  text-decoration: none;
  color: var(--accent-red);
  font-weight: 600;
  transition: all .2s linear 0s;
}

a:hover,
.punbb #pun-admain a:hover {
  color: var(--accent-blue);
}


#pun-index .category, #pun-stats, .main:has(h1), #post-form {
  background: url(https://forumstatic.ru/files/0016/01/4e/71076.png) no-repeat top center;
}

.pun-modal.unread-notifications .modal-inner {
  background: url(https://forumstatic.ru/files/0016/01/4e/71076.png) no-repeat top center var(--sec-bg);
}

/* все заголовки */

h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre {
  margin: 0;
}

h1,
h2 {
  padding: 0 10px;
  text-align: center;
  box-sizing: border-box;
  min-height: 50px;
  font-family: var(--third-family);
  font-weight: 400;
  font-size: 20px;
  text-transform: lowercase;
  color: var(--accent-blue);
  text-shadow: var(--text-shadow);
}

ul,
dl,
li,
dd,
dt {
  list-style: none;
}

address,
em {
  font-style: normal;
}

/* выключить список модераторов, отредактировано etc */

#pun::after,
.modlist,
.lastedit,
.punbb div#pun-live-rusff,
.punbb .topic a.sharelink {
  display: none;
}

/* модальные окна, репутация, закладки etc */

#tags .container,
.post_report,
.post_reputation,
#MyBookmarks,
.inner.popup_graffiti,
.pun-modal .modal-inner,
.punbb-admin #pun-admin-award-form .inner {
  background: var(--sec-bg);
  border: 1px solid var(--borders-color);
  border-radius: 8px;
}

.inner.post_reputation div.container, .inner.post_report div.container {
  padding: 0 15px 15px !important;
}

#rep_form tbody, #report_form tbody {
  gap: 10px;
}

#rep_form tr .tcl, #report_form tr .tcl {
  width: 20%;
}

#rep_form tr .tc2, #report_form tr .tc2 {
  width: 80%;
  flex-grow: 1;
  display: flex;
  justify-content: left;
  gap: 10px;
  align-items: center;
}

#rep_form #reputationText, #report_form #rep_text {
  width: 100% !important;
}

/* Формы
------------------------------------------- */

/* ОФОРМЛЕНИЕ КНОПОК */

input.button, #pun-admain input.button, #sub4, input[type="button"], input[type="submit"] {
  cursor: pointer;
  transition: transform 0.5s ease, background 0.5s ease, border-color 0.5s ease;
  border: 1px solid #282f3c;
  border-radius: 10px;
  padding: 8px 15px;
  box-sizing: border-box;
  box-shadow: 0 1px 2px 0 rgba(54, 43, 43, 0.2), 0 4px 4px 0 rgba(54, 43, 43, 0.17), 0 8px 5px 0 rgba(54, 43,    43, 0.1), 0 15px 6px 0 rgba(54, 43, 43, 0.03), 0 23px 7px 0 rgba(54, 43, 43, 0);
  background: var(--noise), linear-gradient(90deg, #313b4f 0%, #3b4559 46.53%, #313b4f 100%);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  color: var(--third-text-color);
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25);
}

input.button:hover, input.button:focus,
#pun-admain input.button:hover, #pun-admain input.button:focus,
input[type="button"]:hover, input[type="button"]:focus,
input[type="submit"]:hover, input[type="submit"]:focus,
#sub4:hover, #sub4:focus {
  border: 1px solid #6c2529;
  box-shadow: 0 1px 2px 0 rgba(54, 43, 43, 0.2), 0 4px 4px 0 rgba(54, 43, 43, 0.17), 0 8px 5px 0 rgba(54, 43, 43, 0.1), 0 15px 6px 0 rgba(54, 43, 43, 0.03), 0 23px 7px 0 rgba(54, 43, 43, 0);
  background: var(--noise), linear-gradient(90deg, #782b2e 0%, #892b2f 46.53%, #782b2e 100%);
  transform: scale(1.15);
}

input.button:active,
#pun-admain input.button:active,
#sub4:active,
input[type="button"]:active,
input[type="submit"]:active {
  border: 1px solid #a4363b;
  transform: scale(1.15);
}

/* ОФОРМЛЕНИЕ ПОЛЕЙ ВВОДА */

input[type="text"], input[type="password"], input.searchKey, textarea, select, input[type="date"] {
  padding: 4px 15px;
  background: var(--light-cover);
  border: 1px solid var(--borders-color);
  border-radius: 8px;
  box-sizing: border-box;
  font-family: var(--font-family);
  font-weight: 400;
  font-size: 13px;
  line-height: 140%;
  color: var(--main-text-color);
  text-shadow: var(--text-shadow);
}

select {
 -webkit-appearance: none;
  background: url(https://forumstatic.ru/files/0016/01/4e/93846.svg) no-repeat right 5px center var(--light-cover);
  padding: 4px 25px 4px 15px;
  cursor: pointer;
}


optgroup {
  font-weight: bold;
}

/* флажки и чекбоксы */

.checkfield input[type="checkbox"],
.radiofield input[type="radio"] {
  margin: 0 3px;
}

p[class="checkfield"] *,
div[class="checkfield"] *,
fieldset[class="radiofield"] * {
  height: 20px;
  vertical-align: middle;
}

.formal .container {
  padding: var(--pad1);
}

.formsubmit {
  padding: 0;
  margin: 10px 0 0 0;
}

.formsubmit input,
.formsubmit a,
.formsubmit span {
  margin: 0 6px 0 0;
}

fieldset {
  border: none;
}

fieldset legend {
  font-weight: bold;
}

fieldset fieldset {
  border: none;
  margin: 0;
  padding: 0 0 8px 0
}

.fs-box {
  padding: 10px 0;
}

.fs-box p,
.fs-box fieldset {
  padding: 0 0 8px 0;
}

.fs-box label {
  margin-bottom: 5px;
  display: inline-block;
}

.inline .inputfield,
.inline .selectfield,
.inline .passfield {
  float: left;
  margin-right: 10px;
  font-family: var(--font-family);
  font-weight: 400;
  font-size: 13px;
  line-height: 140%;
  color: var(--main-text-color);
}

.inline .infofield {
  clear: both;
  padding: 0;
  font-size: 13px;
  line-height: 140%;
  text-align: justify;
  color: var(--main-text-color);
}

.datafield br {
  display: none;
}

.required label,
.datafield span.input {
  font-size: 10px;
}

textarea,
.longinput input {
  width: 64%;
  margin: 0;
}

.hashelp {
  position: relative;
}

.api-form {
    position: absolute;
    z-index: 999999;
    padding: 1em;
    background: url(https://forumstatic.ru/files/001a/fa/19/79976.png?v=1);
    width: 800px;
    margin-left: 15px;
    border-radius: 15px;
    box-shadow: 0 0 5px 1px #aa7e61;
}
 
.api-form-hidden {
    display: none;
}

/* ____ страница - коллекции ____ */
.box-crew {
    height: 167px;
    position: relative;
    width: 100px;
    overflow: hidden;
}
 
.box-crew span {
    background-color: #c5bfa9;
    top: -130px;
    transition-duration: 0.6s;
    padding: 10px 0;
    position: absolute;
    text-align: center;
    color: #022038;
    font-size: 10px;
    font-family: 'Lora';
    margin: 0;
    display: block;
    width: 100%;
}
 
div.box-crew:hover span {top:0;}


/*****************************
---------- МОБИЛЬНЫЙ СТИЛЬ ----------
------- by Alex Kolmar (бродяга) -------
*****************************/

@media screen and (max-width: 700px) {


  /* Основа и тело форума
  -------------------------------------------------------------*/

  * {
    box-sizing: border-box;
    max-width: 100%;
    width: unset;
  }

  #pun {
    margin: 0 auto;
    padding: 0;
    width: 100%;
    border: 10px solid transparent;
    border-image: url(https://forumstatic.ru/files/0016/01/4e/79641.png) 8/10px round round;
    background: url(https://forumstatic.ru/files/0016/01/4e/31248.jpg) repeat top left;
    box-shadow: inset 0 0 10px 0 #2f240b;
  }

  .punbb {
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
  }

  /* Порядок основных блоков */

  #html-header {
    order: initial;
  }

  #pun-title {
    order: initial;
  }

  #pun-navlinks {
    order: initial;
  }

  #pun-ulinks {
    order: initial;
  }

  #pun-status {
    order: initial;
  }

  #pun-crumbs1 {
    order: initial;
  }

  #pun-main {
    order: initial;
  }

  #pun-stats {
    order: initial;
  }

  #pun-crumbs2 {
    order: initial;
  }

  #pun-about {
    order: initial;
  }

  #html-footer {
    order: initial;
  }

  /* Основные настройки содержимого*/

  .punbb > div .container, .punbb .modmenu {
    padding: 5px 20px;
    display: flex;
    display: -webkit-flex;
    flex-wrap: wrap;
  }

  /* Поля ввода*/

  input,
  input[type="text"],
  input[type="password"],
  textarea,
  select {
    max-width: 100%;
  }

  /* Объявление
  -------------------------------------------------------------*/

  #pun-announcement {
    position: absolute;
    width: calc(100% - 20px);
    z-index: 160;
  }

#pun-announcement .container {
   padding: 0 10px;
}

#pun-announcement .html-box {
  width: 100%;
}

.hotlinks {
  flex-wrap: wrap;
  padding-bottom: 20px;
  gap: 10px
}

.hotlinks a {
   padding: 5px 10px;
}

.hotlinks a p {
  display: none;
}


  /* Шапка
  -------------------------------------------------------------*/

  #pun-title {
    min-height: 300px;
    background: url(https://forumstatic.ru/files/0016/01/4e/13197.jpg) no-repeat top center/cover;
    height: 434px;
  }

  /* Меню навигации
  -------------------------------------------------------------*/


  #pun-navlinks {
    position: sticky;
    top: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 120;
  }

  #pun-navlinks .container {
    height: auto;
    position: relative;
    display: flex;
    display: -webkit-flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    align-content: center;
    gap: 10px;
    box-sizing: border-box;
    padding: 10px 20px;
    box-shadow: inset 0 0 10px 0 #252e40;
    background: var(--noise), linear-gradient(180deg, #1a2438 0%, #313b4f 35.58%, #3b4559 101%);
    border-block: 1px solid #2c2622;
  }

  #pun-navlinks li {
    display: block;
  }

  #pun-navlinks li a {
    font-size: 0;
    padding: 0;
    display: flex;
    display: -webkit-flex;
    position: relative;
    border-radius: 5px;
    background: var(--scrollbar-bg);
    backdrop-filter: blur(10px);
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
  }

  #pun-navlinks li a::after {
    content: "";
    font: normal 16px/16px var(--fa);
    color: var(--accent-yellow);
    text-shadow: none;
    font-weight: 700;
  }

  #pun-navlinks li#navindex a:after {
    content: "\e3af";
  }

  #pun-navlinks li#navuserlist a:after {
    content: "\f0c0";
  }

  #pun-navlinks li#navsearch a:after {
    content: "\f002";
  }

  #pun-navlinks li#navprofile a:after {
    content: "\f2c2";
  }

  #pun-navlinks li#navpm a:after {
    content: "\f0e0";
  }

  #pun-navlinks li#navadmin a:after {
    content: "\f085";
  }

  #pun-navlinks li#navlogout a:after {
    content: "\f2f5";
  }

  #pun-navlinks li#navlogin a:after {
    content: "\e66d";
  }

  #pun-navlinks li#navregister a:after {
    content: "\f234";
  }

  #pun-navlinks li#navpr_1 a:after {
    content: "\f0a1";
  }

  #pun-navlinks li#navpr_2 a:after {
    content: "\f5da";
  }

  #pun-navlinks li#navawards a:after {
    content: "\f091";
  }

  #pun-navlinks li#navrules a:after {
    content: "\f03a";
  }

  #pun-navlinks li#navpm a:has(span[data-last-unread]) {
    animation: blinkColor 2s linear infinite;
    -moz-animation: blinkColor 2s linear infinite;
    -webkit-animation: blinkColor 2s linear infinite;
  }

  #pun-navlinks li#navpm a:has(span[data-last-unread]):after {
    content: "\e16f";
  }

  #pun-navlinks li#navpm span.num_msg {
    margin-top: 0;
    height: 20px !important;
  }

  span.num_msg::before {
    top: -3px !important;
    z-index: 100;
  }


  /* Меню пользовательских ссылок
  -------------------------------------------------------------*/

  #pun-ulinks {
    height: auto;
    z-index: 110;
    background: var(--opacity-cover);
    border-bottom: 1px solid var(--borders-color);
  }

  #pun-ulinks .container {
    padding: 10px 20px;
    margin: 0;
    height: auto;
    border: none;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  #pun-ulinks li a {
    display: block;
    border: none;
    background: var(--opacity-cover);
    border-radius: 5px;
    padding: 2px 5px 3px;
    color: var(--main-text-color);
  }

  #pun-ulinks>span.notify-bubble {
    display: block !important;
  }


  /* Статус и путь
  -------------------------------------------------------------*/

  #pun-status .container {
    text-align: left;
    justify-content: left;
    font-size: 12px;
  }

  #pun-crumbs1 {
    margin: 10px 0 15px;
  }

  .punbb .container.crumbs {
    display: block;
  }


  /* Футер
  -------------------------------------------------------------*/


  #ToTop, #OnBottom {
    margin: 0 !important;
    right: 10px;
  }

  /* Копирайт */
  #pun-about .container {
    justify-content: center;
  }


  /* Главная форумная таблица
  -------------------------------------------------------------*/

  /* Заголовки */
  .punbb h1,
  .punbb h2 {
    width: initial !important;
  }

  .punbb thead {
    display: none !important;
  }

  #pun-index .category h2, #pun-stats h2 {
    padding: 0 20px;
  }

  #pun-index .category {
    margin-bottom: 20px;
  }

  .punbb .main .hasicon,
  .punbb .main tr {
    display: flex;
    display: -webkit-flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
  }

  #pun-index .main .hasicon {
    gap: 10px;
  }

  #pun-index .main .hasicon tr {
    background: var(--opacity-cover);
    border-radius: 10px;
    border: none;
    padding: 10px;
    gap: 10px;
  }

  .punbb .main tr {
    padding: 8px 0;
  }

  .punbb .main .hasicon tr:not(:last-of-type) {
    border-bottom: 1px solid var(--borders-color-lighter);
  }

  .punbb .main td {
    padding: 5px 10px;
  }

  .punbb .main .tcl,
  .punbb .main .tcr,
  #pun-searchtopics .main .tcl,
  #pun-modviewforum .main .tcl {
    display: flex;
    display: -webkit-flex;
    flex-wrap: wrap;
    width: 100%;
    padding: 0 !important;
  }

  .punbb .main .intd {
    display: flex;
    display: -webkit-flex;
    width: 100%;
  }

  .punbb .tclcon {
    flex-grow: 1;
  }

  .punbb div.icon {
    position: relative;
    flex-shrink: 0;
  }

  #pun-index div.icon {
    position: absolute;
    right: 10px;
    margin: 0;
  }

  .punbb .main .tc2,
  .punbb .main .tc3,
  #pun-searchtopics .main .tc2,
  #pun-searchtopics .main .tc3 {
    text-align: left;
    width: auto;
    display: none;
  }

  .punbb .main .tc2:before,
  .punbb .main .tc3:before {
    content: "";
  }

  #pun-index .main .tc2:before {
    content: "Тем: ";
  }

  #pun-index .main .tc3:before {
    content: "Сообщений: ";
  }

  #pun-index .tcr {
    background: var(--opacity-cover);
    border-radius: 10px;
    padding: 10px 15px !important;
  }

  #pun-index .tcr:not(:has(.lastpost)) {
    display: none;
  } 

  #pun-viewforum .main .tc2:before,
  #pun-searchtopics .main .tc3:before {
    content: "Ответов: ";
  }

  #pun-viewforum .main .tc3:before {
    content: "Просмотров: ";
  }

  #pun-searchtopics .main .tc2:before {
    content: "Форум: ";
  }

  .punbb .main .tcr {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }

  .punbb .main .forum .tcr {
    padding: 0 10px !important;
  }

  .punbb .tcr .user-avatar {
    display: none;
  }

  .punbb .tcr>a,
  .punbb .tcr .lastpost,
  .punbb .tcr>.byuser {
    width: fit-content;
    text-align: left;
  }

  .punbb .user-avatar .avatar-image {
    display: flex;
    display: -webkit-flex;
  }

.forum .byuser {
  display: flex;
}

.forum .byuser-username {
   order: -1;
}

.punbb .main td.tcmod {
  margin-left: auto;
  position: absolute;
  right: 0;
  bottom: 0;
  flex-shrink: 0;
}


  /* Статистика
  -------------------------------------------------------------*/

  .punbb #pun-stats .container {

  }

  .punbb #pun-stats .container li:not(#onlinelist), #statistic-other span {
    flex-grow: 1; 
    text-align: center;
  }

  /* Футер (временно скрою)
  -------------------------------------------------------------*/

  .footer {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    position: relative;
  }

.copyright {
  order: -1;
  position: relative;
  width: 100%;
  margin: 0;
  border-radius: 0;
  height: auto;
  border-block: 1px solid #2c2622;
  box-shadow: inset 0 0 10px 0 #252e40;
  left: 0;
}

  .banners {
    display: block;
    position: relative;
    background: none;
    padding: 10px 16px;
    width: 100%;
    height: 102px;
  }

  .banners h5 {
    display: none;
  }


  /* Список пользователей
  -------------------------------------------------------------*/

  #pun-userlist  .main .tc2, #pun-userlist .main .tc3 {
    display: block;
  }


  /* Темы и страницы
  -------------------------------------------------------------*/

  #pun-searchposts .post h3 span {
    justify-content: flex-start;
    gap: 0 10px;
  }

  /* Ссылки на страницы в топике и списках тем */
  .punbb .linkst, .punbb .linksb {
    padding: 5px 20px;
  }

  .punbb .linkst:after, .punbb .linksb:after {
    display: none;
  }

  /* Меню модератора */
  .punbb .modmenu .container {
    padding: 10px;
    gap: 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
  }

  #topic-users-in .container {
    justify-content: flex-start;
  }

  .punbb .modmenu .container:after {
    display: none;
  }

  .punbb .modmenu strong,
  .punbb .modmenu a {
    height: initial;
  }

  .punbb .modmenu strong {
    width: 100%;
    margin-bottom: 10px;
  }

  #pun-viewforum .modmenu .container strong a {
    font-size: 0;
    display: flex;
  }

  #pun-viewforum .modmenu .container strong a:after {
    content: "Действия с темами";
    font-size: 12px;
  }

  .punbb .modmenu input.button {
    margin: 0;
  }

  /* Нижние ссылки в топике и списках тем */
  .punbb .linksb {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .linksb .pagelink {
    order: 1;
    flex-grow: 1;
    width: fit-content;
    max-width: fit-content;
  }

  .punbb .postlink,
  .punbb .linksb noindex {
    order: 2;
    flex-grow: 1;
    width: auto;
  }

  .subscribelink {
    order: 3;
    width: 100%;
  }

  .punbb .postlink.long {
    width: auto;
  }

  #pun-admain #tag-filter-container {
    margin-bottom: 10px;
  }

  .punbb .per-page-select,
  #profile10 .submitend .pagelink {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .punbb .per-page-select .page-container,
  .files-pagelink {
    flex-grow: 1;
  }


  /* Топик
  -------------------------------------------------------------*/

  /* Пост */
  .punbb .post {
    margin: 0;
    scroll-margin-top: 55px;
  }

  /* Дата поста */
  .punbb .post h3 {
    padding: 0;
  }

  .punbb .post h3 span {
    margin: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0;
  }

  .punbb .post h3 span .permalink {
    order: -1;
  }

  .punbb .post h3 span strong {
    margin-left: auto;
    order: 2;
  }

  .punbb .post h3 .sharelink {
    order: 3;
    margin-left: 5px;
    display: none;
  }

  /* Содержимое поста */
  .punbb .post .container {
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    padding: 10px 20px;
  }

  /* Автор */
  .punbb .post .post-author {
    margin: 0;
    padding: 10px;
    width: 100%;
    min-height: 90px;
    box-sizing: border-box;
  }

  #pun-searchposts .post .post-author {
    min-height: unset;
  }

  .punbb .post .post-author ul {
    padding: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    min-height: unset !important;
  }

  /* Скрыть поля профиля */
  .pa-reg,
  .pa-from,
  .pa-invites,
  .pa-positive,
  .pa-icq,
  .pa-sex,
  .pa-age,
  .pa-ip,
  .pa-time-visit,
  .pa-last-visit,
  .pa-online,
  .pa-awards,
  .pa-gifts,
  .pa-fld2,
  .character-summary__profile-block {
    display: none !important;
  }

.post-author .pa-fld3 {
  transform: none;
  writing-mode: horizontal-tb;
  padding: 5px 15px;
  border-radius: 0 0 10px 10px;
  border-inline: 1px solid #6d3434;
  border-bottom: 1px solid #6d3434;
  border-top: none;
  box-shadow: -1px 0 1px 0 rgba(0, 0, 0, 0.1), -2px 0 2px 0 rgba(0, 0, 0, 0.09), -5px 0 3px 0 rgba(0, 0, 0, 0.05), -9px 0 3px 0 rgba(0, 0, 0, 0.01), -13px 0 4px 0 rgba(0, 0, 0, 0);
  background: linear-gradient(180deg, #3a080a 0%, #5d1619 31.25%, #892b2f 100%);
  top: 0;
  right: 10px;
  width: fit-content;
  left: unset;
}

  /* Аватар */
  .punbb .post-author .pa-avatar {
    width: 50px;
    height: auto;
    max-height: 50px;
    max-width: 50px;
    display: block;
    position: absolute;
    order: -2;
  }

  .punbb .post-author .pa-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    max-height: 50px;
    max-width: 50px;
  }

  /* Ник и статус */
  .punbb .post-author .pa-author,
  .punbb .post-author .pa-title {
    width: 100%;
    text-align: left;
  }

  .punbb .post-author .pa-author {
    justify-content: flex-start;
    margin: 10px 0 5px 65px;
  }

  .punbb .post-author .pa-title {
    margin: 0 0 10px 65px;
  }

  /* Сообщения, репутация, лз */

  .punbb .post-author .pa-fld1, .pa-wrap {
    width: 100%;
  }

.pa-posts, .pa-respect {
  display: flex;
}

  /* Тело поста */
  .punbb .post-body {
    margin: 0;
    width: 100%;
  }

  /* Содержимое тела поста */
  .punbb .post-box {
    padding: 10px 0;
  }

  /* Строки поста */
  .punbb .post-content p {
    padding: 0 0 5px 0;
  }

  /* Цитата, спойлер и код */
  .punbb .post-content .quote-box,
  .punbb .post-content .code-box {

  }

  /* хтмл-содержимое в постах */
  .punbb .post-content iframe {
    box-sizing: border-box;
    max-width: 100%;
  }

  /* Подпись */
  .punbb .post-box .post-sig {
    display: none;
  }

  /* Ссылки профиль, удалить, цитировать и т.п. */
  .punbb .post-links {
    margin: 0;
  }

  .punbb .post-links ul {
    padding: 0;
    margin: 5px 0 0;
  }

  .punbb .post-links li a {
    font-size: 0;
    line-height: 16px;
    display: inline-flex;
    padding: 5px;
    border-radius: 5px;
  }

  .punbb .post-links ul li {
    padding: 0 0 0 10px;
    line-height: initial !important;
  }

  .punbb .post-links ul .pl-email,
  .punbb .post-links ul .pl-website {
    float: left !important;
    padding: 0 10px 0 0;
  }

  .punbb .post-links li a::before {
    content: "";
    font: 700 16px/16px var(--fa);
  }

  .punbb .post-links li.profile a:before {
    content: "\f2bb";
  }

  .punbb .post-links li.pm a:before {
    content: "\f0e0";
  }

  .punbb .post-links li.email a:before, #pun-messages .post-links li.pl-email a:before {
    content: "\40";
  }

  .punbb .post-links li.pl-website a:before {
    content: "\e60e";
  }

  .punbb .post-links li.pl-delete a:before {
    content: "\f1f8";
  }

  .punbb .post-links li.pl-edit a:before {
    content: "\f044";
  }

  .punbb .post-links li.pl-quote a:before {
    content: "\e14c";
  }

  .punbb .post-links li.pl-reports a:before {
    content: "\f848";
  }


  /* Форма ответа */

#post-form {
   margin-top: 5px;
}

  .punbb #form-buttons {
    width: 100%;
    display: block;
  }

  .punbb #form-buttons tr {
    display: flex;
    display: -webkit-flex;
    flex-wrap: wrap;
    -webkit-flex-wrap: wrap;
    justify-content: center;
    padding: 0 0 5px;
    text-align: center;
  }

  #form-buttons td {
    display: block;
    width: 26px;
    height: 26px;
  }

  #post-form #tags .container {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    left: 0;
    display: flex;
    gap: 5px 10px;
    margin-bottom: 10px;
  }

  #post-form #tags #font-area {
    padding-bottom: 15px !important;
  }

  #post-form #table-area tr {
    flex-wrap: nowrap;
    padding: 0;
  }

  /* Поиск сообщений
  -------------------------------------------------------------*/

  #pun-searchposts .post-author ul {
    justify-content: space-between;
  }

  #pun-searchposts .post li.pa-author,
  #pun-searchposts .post li.pa-replies {
    text-align: left;
    width: auto;
    margin: 0;
  }

  #pun-searchposts .post-links ul {
    margin: 0;
    height: 150%;
  }

  #pun-searchposts .post-links li a {
    font-size: initial;
  }


  /* Просмотр профиля
  -------------------------------------------------------------*/

  #viewprofile-next #profilenav {
    display: none;
  }

  #viewprofile ul,
  #profilenav ul {
    padding: 0;
    margin: 0 0 10px;
  }

  #viewprofile tr {
    padding: 0;
    flex-direction: column;
    align-items: center;
  }

  #viewprofile td {
    width: 100%;
  }

  #viewprofile li,
  #viewprofile li strong,
  #viewprofile li span,
  #viewprofile li div,
  #setmods dd,
  #setmods dl {
    margin: 0;
    padding: 0;
  }

  #viewprofile #profile-left {
    margin: 0;
  }

  #viewprofile #profile-right {
    width: 100%;
  }

  #profile-right li {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    padding: 5px;
    text-align: center;
  }

  #profile-right li span {
    width: auto;
    padding: 0
  }

  #viewprofile #profile-right li strong {
    width: auto;
    padding: 0;
  }

  #viewprofile #profile-signature {
    display: none;
    padding: 5px 10px;
  }

  #viewprofile #profile-signature ul {
    display: none;
    padding: 0;
  }


  /* Редактирование профиля и ЛС
  -------------------------------------------------------------*/

  #profile>.container {
    padding: 5px 10px !important;
  }

  .punbb #profilenav {
    width: 100%;
    margin: 0;
    display: block;
  }

  #viewprofile h2,
  #profilenav h2 {
    margin: 0;
  }

  #profilenav ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px 10px;
  }

  #profilenav li {
    padding: 0;
    box-sizing: border-box;
  }

  #pun-messages #notify-settings {
    width: 100%;
  }

  #pun-messages #notify-settings .inp2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }

  #OnOff_Notify {
    margin: 0 !important;
    order: 1;
  }

  #OnOff_Notify+label {
    display: none;
  }

  #volume-set {
    align-items: center;
    display: flex;
  }

  #profile #messages fieldset,
  #profile #messages fieldset .fs-box {
    padding: 0;
    margin: 0;
  }

  .punbb .main #profile #messages .hasicon tr {
    justify-content: space-between;
    border-bottom: 1px solid var(--borders-color-lighter);
  }

  .punbb .main #profile #messages .hasicon .tcl {
    width: 100% !important;
  }

  #profile #messages .hasicon .pmtc22 {
    display: flex;
    width: 100% !important;
  }

  #profile #messages .hasicon .tc3:before {
    content: "Дата: "
  }

  #profile #messages .hasicon .tc3,
  #profile #messages .hasicon .pmtc24 {
    display: block;
    width: auto !important;
    padding: 5px 10px !important;
  }

  #profile #messages .hasicon .pmtc24:before {
    content: "Выбрать: "
  }

#pun-messages .linksb {
  align-items: flex-start;
  margin-top: 10px;
}

#pun-messages .post h3 span {
  margin: 0 0 10px;
  padding: 3px 15px;
}


  /* Активные пользователи
  -------------------------------------------------------------*/

  #pun-online .online-list tr:not(:last-of-type) {
    border-bottom: 1px solid rgba(0, 0, 0, .2);
  }

  #pun-online .username {
    gap: 5px;
  }

  #pun-online .registered-user,
  #pun-online .tcl.action,
  #pun-online .tc3 {
    width: 100% !important;
    display: block;
  }

  /* Уважение и позитив
  -------------------------------------------------------------*/

  #pun-respect .main .container,
  #pun-positive .main .container {
    padding: 10px;
  }

  #pun-respect tr,
  #pun-positive tr {
    border-bottom: 1px solid rgba(0, 0, 0, .2);
  }

  #pun-respect td,
  #pun-positive td {
    width: 100% !important;
    font-size: 12px !important;
    line-height: 1.2;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
  }

  #pun-respect td::before,
  #pun-positive td::before {
    content: "";
    width: 100px;
    display: inline-block;
    font-weight: bold;
    flex-shrink: 0;
  }

  #pun-respect td.tcl::before,
  #pun-positive td.tcl::before {
    content: "Когда: ";
  }

  #pun-respect td.tc2::before,
  #pun-positive td.tc2::before {
    content: "Что: ";
  }

  #pun-respect td.tc3::before {
    content: "Кто: ";
  }

  #pun-positive td.tc3::before {
    content: "Кому: ";
  }

  #pun-respect td.tc4::before,
  #pun-positive td.tc4::before {
    content: "За что: ";
  }

  #pun-respect td.tcr::before,
  #pun-positive td.tcr::before {
    content: "Где: ";
  }

  #pun-respect .tcr a,
  #pun-positive .tcr a {
    width: auto;
    text-align: left;
    margin: 0;
  }


  /* Загрузка файлов
  -------------------------------------------------------------*/

  #filetable {
    margin-bottom: 10px;
  }

  #filetable tr {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(0, 0, 0, .2);
  }

  .punbb #filetable td {
    width: 100% !important;
  }

  .punbb #filetable .tc2,
  .punbb #filetable .tc3:not(.checker) {
    display: none;
  }

  .punbb #filetable .tc3.checker {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
  }

  .punbb #filetable .tc3.checker:before {
    content: "Выбрать:"
  }

  /* Админка
  -------------------------------------------------------------*/

  .punbb-admin .adminmain * {
    box-sizing: border-box;
    max-width: 100%;
  }

  .punbb-admin #pun-adnav {
    margin: 0;
    float: none;
  }

  .punbb-admin #pun-admain {
    padding: 0;
  }

  .punbb-admin #pun-adnav ul {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
  }

  .punbb-admin #pun-adnav li {
    padding: 2px 5px;
  }

  .punbb-admin #pun-admain fieldset .handle,
  .punbb-admin #pun-admain fieldset p {
    border: none;
  }

  .punbb-admin #pun-admain .adlabel {
    padding: 0 5px !important;
    margin: 0;
    position: relative;
    width: auto;
    display: block;
    text-align: center;
  }

  .punbb-admin .adcontainer {
    padding: 5px 10px !important;
  }

  .punbb-admin #pun-admain .adformal div ul,
  .punbb-admin #pun-admain div p {
    padding: 5px !important;
  }

  .punbb-admin #pun-admain .adcontainer td {
    border: none;
    padding: 5px;
  }

  .punbb-admin .adcontainer .adsubmitfield {
    display: flex;
    flex-direction: column;
  }

  .punbb-admin #pun-admain span.adsubmit {
    position: relative;
    width: auto;
    top: 0 !important;
    margin: 0 auto;
    display: block;
    padding: 5px;
    left: 0;
  }

  .punbb-admin #pun-admain1 .sortable p input[name^="cat_name"] {
    margin: 0;
    position: relative;
    width: calc(100% - 20px);
  }

  .punbb-admin #pun-admain input[type="submit"] {
    margin: 0 auto;
    display: block;
  }

  #pun-admain .adformal p.submittop,
  #pun-admain .adformal p.submitend {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px;
  }

  #pun-admain .adformal p.submittop input[type="submit"],
  #pun-admain .adformal p.submitend input[type="submit"] {
    margin: 0 5px;
  }

  .punbb-admin #pun-admain fieldset .subforums {
    margin-left: 0;
  }

  .punbb-admin .admin-advert-block {
    width: auto;
  }

  .punbb-admin input[type="text"] {
    width: 100%;
  }

  .page-list tr,
  #pun-admin_logs #pun-admain .adcontainer tr {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(0, 0, 0, .2);
  }

  .punbb-admin #pun-admain .page-list td {
    width: 100% !important;
  }

  #metatags input#fld0content {
    margin: 0 !important;
  }

  #pun-admin_paid_services #pun-admain .linksb {
    height: auto !important;
    flex-direction: column;
  }

  #pun-admin_logs #pun-admain .adcontainer tbody {
    width: 100%;
    display: block;
  }

  #pun-admin_logs #pun-admain .adcontainer td {
    width: 100% !important;
    text-align: left !important;
  }

  /* Награды
  -------------------------------------------------------------*/

  .mod-awards .category h2 {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .mod-awards .category h2 .fr {
    position: relative;
    right: unset;
    font-size: 12px;
  }

  #awards-content {
    padding: 0;
  }

  #awards-content td {
    width: 100%;
    font-size: 12px;
    display: inline-block;
  }

  .mod-awards-user #awards-content td:nth-child(3),
  .mod-awards-user #awards-content td:nth-child(4) {
    display: flex;
    gap: 5px;
  }

  #awards-content td:before {
    content: "";
    width: 100px;
    font-weight: bold;
    display: inline-block;
    flex-shrink: 0;
  }

  .mod-awards-list #awards-content td:nth-child(1)::before,
  .mod-awards-user #awards-content td:nth-child(1)::before {
    content: "Название:";
  }

  .mod-awards-list #awards-content td:nth-child(2)::before,
  .mod-awards-user #awards-content td:nth-child(2)::before {
    content: "Иконка:";
  }

  .mod-awards-list #awards-content td:nth-child(3)::before {
    content: "Описание:";
  }

  .mod-awards-list #awards-content td:nth-child(4)::before {
    content: "Лауреаты:";
  }

  .mod-awards-user #awards-content td:nth-child(3)::before {
    content: "За заслуги:";
  }

  .mod-awards-user #awards-content td:nth-child(4)::before {
    content: "Вручена:";
  }

  .mod-awards-users #awards-content td:nth-child(1)::before {
    content: "Пользователь:";
  }

  .mod-awards-users #awards-content td:nth-child(2)::before {
    content: "Кол-во наград:";
  }

  .mod-awards-users #awards-content td:nth-child(3)::before {
    content: "Награды:";
  }

  .mod-awards-users #awards-content td:nth-child(4)::before {
    content: "Детали:";
  }


  /* Дополнительно
  -------------------------------------------------------------*/

  /* Отключение закругления текстовых полей в Safari */

  button,
  input.button,
  input[type="text"],
  input[type="password"],
  select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
  }

}

@media screen and (max-width: 540px) {

  /* Список пользователей
  -------------------------------------------------------------*/

  #pun-userlist .usertable tr {
    width: 100%;
  }

}

@media screen and (max-width: 400px) {

  /* 
  -------------------------------------------------------------*/


}

@media screen and (max-width: 378px) {

  .punbb .post {
    scroll-margin-top: 80px;
  }

}

/* ____ страница - хронология ____ */

.pages div.container {
  border-radius: 15px;
  padding: var(--pad1);
}

.main table.results { width: 100%; }
.adbut input.button { padding: 0 3px; }

.container999 { height: 450px; overflow-y: auto; }
.container999 table { border-spacing: 0; }

.container999 thead tr {
  font-family: var(--third-family);
  font-size: 20px;
  letter-spacing: 1px;
  height: 32px;
}

.container999 thead th {
  background: var(--opacity-cover);
  border-radius: 10px;
  color: var(--main-text-color);
  text-shadow: var(--text-shadow);
    font-size: 12px;
    font-weight: 700;
}

.container999 thead th:hover {
  color: var(--accent-blue);
  transition: color 0.5s linear;
}

/* Simple flat icon buttons, not the heavy trigger-button style */
.adbut input.button,
.timeline-button--update,
.timeline-button--delete {
  background: rgba(108,101,80,0.1);
  border: none;
  border-radius: 8px;
  padding: 2px 8px;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 12px;
  color: var(--accent-red);
  box-shadow: none;
  transition: color 0.3s ease;
}
.adbut input.button:hover,
.timeline-button--update:hover,
.timeline-button--delete:hover {
  color: var(--accent-blue);
  background: rgba(108,101,80,0.1);
  border: none;
  box-shadow: none;
  transform: none;
}

.container999 td {
  padding: 3px 5px;
  font-family: var(--font-family);
  color: var(--main-text-color);
}

.container999 thead th {
  background: var(--opacity-cover);
  border-radius: 10px;
  color: var(--main-text-color);
  text-shadow: var(--text-shadow);
  padding: 6px 10px;
  line-height: 20px;
}

.hrono-s-date { font-size: 12px; text-align: center; }
.hrono-s-link, .hrono-s-op { text-align: center; font-size: 14px; }
.hrono-s-us {
  text-align: center;
  font-size: 12px;
  color: var(--accent-red);
  font-weight: 600;
}

.adbut { display: none; }
.ismoderator .adbut, .isadmin .adbut { display: table-cell; }

#hronoedit {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  padding: 20px 22px;
  width: 500px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-sizing: border-box;
  background: url(https://forumstatic.ru/files/001a/fa/19/79976.png) repeat;
  border: 1px solid #6C2529;
  border-radius: 10px;
  box-shadow: 0px 15px 6px rgba(54,43,43,0.03), 0px 8px 5px rgba(54,43,43,0.1), 0px 4px 4px rgba(54,43,43,0.17), 0px 1px 2px rgba(54,43,43,0.2);
  font-family: var(--font-family);
  color: var(--main-text-color);
}

#hronoedit .inputfield input { width: 100%; }

.results .delimiter {
  color: transparent;
  background: url(https://upforme.ru/uploads/001a/fa/19/2/292922.png) center no-repeat;
}
.results .delimiter td { line-height: 43px; }
.results tr.delimiter { display: table-row; }

.searchCount {
  font-family: var(--font-family);
  letter-spacing: 1px;
  color: var(--secondary-text-color);
}

.hrono-search-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

input.searchKey {
  width: 300px;
  margin: 0;
}

.searchCount {
  font-family: var(--font-family);
  letter-spacing: 1px;
  color: var(--secondary-text-color);
  margin: 0;
}


.hrono-s-date, .hrono-s-op {
  width: 15%;
}

.hrono-s-link {
  width: 30%;
}

.hrono-s-us {
  width: 30%;
}

.adbut {
  width: 10%;
}


@media screen and (max-width: 700px) {
  input.searchKey { width: 100%; margin: 0 0 10px; }
  .searchCount { margin-left: 0; }
  .container999 { height: 350px; }
}

/* ____ страница - events calendar ____ */

.eventsk {
  width: 100%;
  font-family: var(--font-family);
}

/* Both calendars: plain, real HTML table layout with FIXED pixel
   dimensions for both width and height - genuinely, reliably square,
   always. Edited 46091.js directly to remove the inline row heights
   it used to set (tr.style.height), so CSS now has clean, uncontested
   control - no more !important fights needed on the public calendar. */

#pun-main.pages #calendar table {
  table-layout: fixed;
  width: 840px;
  max-width: 100%;
  margin: 0 auto;
  border-spacing: 2px;
}

/* Admin panel's "Рабочий календарь" - kept smaller than the public
   calendar since its container is narrower; 840px caused a
   horizontal scrollbar there. .calendar-wrapper is unique to admin
   (confirmed from the real DOM), so this can't leak into public. */
.calendar-wrapper#calendar table {
  table-layout: fixed;
  width: 630px;
  max-width: 100%;
  margin: 0 auto;
  border-spacing: 2px;
}

.eventsk th {
  width: 90px;
  box-sizing: border-box;
  text-align: center;
}

.eventsk td.calendar-day-header {
  background: var(--opacity-cover);
  padding: 2px;
  border-radius: 5px 5px 0 0;
  text-align: center;
  color: var(--main-text-color);
  width: 90px;
  height: 20px;
  box-sizing: border-box;
  position: relative;
  vertical-align: top;
}

.eventsk td.calendar-day {
  background: var(--opacity-cover);
  padding: 2px;
  border-radius: 0 0 5px 5px;
  text-align: center;
  color: var(--main-text-color);
  width: 90px;
  height: 70px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  vertical-align: top;
}

/* IMPORTANT: both calendars share id="calendar" on their wrapper div
   (admin: <div class="calendar-wrapper" id="calendar">, public:
   <div class="eventsk" id="calendar">) - confirmed from the real
   admin DOM. Every bare #calendar selector below was therefore ALSO
   matching the admin calendar this whole time, fighting the .eventsk
   rules above it - explains both why the admin resize wasn't taking
   effect (ID beats class specificity) and why admin's own simple "+"
   button was getting the public page's absolutely-positioned circular
   button styling. Scoping every public-only rule to #calendar.eventsk
   (requires BOTH the id and the class - only the public wrapper has
   both) so nothing leaks into admin again. */

#calendar.eventsk th {
  width: 120px;
  box-sizing: border-box;
  text-align: center;
}

#calendar.eventsk td {
  width: 120px;
  box-sizing: border-box;
  padding: 2px;
  background: var(--opacity-cover);
  text-align: center;
}

#calendar.eventsk tbody tr:nth-child(odd) td {
  height: 30px;
  border-radius: 5px 5px 0 0;
}

#calendar.eventsk tbody tr:nth-child(even) td {
  height: 90px;
  border-radius: 0 0 5px 5px;
}

#calendar.eventsk .event-container {
  max-height: 60px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 2px;
}

/* Only moderators get the add/settings icons in the DOM at all -
   regular users' cells don't have them, so shouldn't reserve empty
   space above the events for icons that were never there. */
#calendar.eventsk td:has(.calendar-event-add) .event-container {
  margin-top: 22px;
}

/* Original design puts the delete icon on the LEFT (confirmed from
   the page's own .event-line.has-event-line-mod { padding-left: 20px }
   rule) - had this backwards before, reserving padding on the wrong
   side, which is why right:2px kept losing to their left:0. */

#calendar.eventsk .event-line {
  background: var(--opacity-cover);
  border-radius: 4px;
  padding: 2px 4px;
  margin-bottom: 2px;
  font-size: 11px;
  text-align: left;
  position: relative;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
}

#calendar.eventsk .event-line.has-event-line-mod {
  padding-left: 24px;
}

#calendar.eventsk .event-line p {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  padding: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

#calendar.eventsk .delete-event {
  position: absolute;
  top: 2px;
  left: 2px;
  right: auto;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent-red);
  background: var(--cover);
  border-radius: 50%;
  opacity: 0.85;
  transition: opacity 0.3s ease;
  z-index: 5;
}

#calendar.eventsk .delete-event:hover {
  opacity: 1;
}

/* Original design floats these at top:-22px, meant for a completely
   unstyled table with no fixed row heights - doesn't translate to my
   resized 30px header row, so keeping them positioned inside it
   instead. Kept their left/right split (settings left, add right). */

#calendar.eventsk .calendar-event-add,
#calendar.eventsk .calendar-event-settings {
  position: absolute;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--opacity-cover);
  color: var(--accent-red);
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background 0.3s ease, color 0.3s ease;
}

#calendar.eventsk .calendar-event-add {
  top: 2px;
  right: 2px;
  left: auto;
}

#calendar.eventsk .calendar-event-settings {
  top: 2px;
  left: 2px;
  right: auto;
}

#calendar.eventsk .calendar-event-add:hover,
#calendar.eventsk .calendar-event-settings:hover {
  background: var(--accent-red);
  color: var(--cover);
}

/* Admin panel's own simple + button - just a normal inline button
   inside the header cell, not absolutely positioned like the public
   page's moderator buttons. Confirmed from the real admin DOM:
   <td class="calendar-day-header">5<button class="calendar-event-add">+</button></td> */
.calendar-wrapper#calendar .calendar-event-add {
  background: rgba(108,101,80,0.15);
  border: none;
  border-radius: 4px;
  width: 16px;
  height: 16px;
  font-size: 11px;
  line-height: 1;
  color: var(--accent-red);
  cursor: pointer;
  margin-left: 2px;
  transition: color 0.3s ease;
}

.calendar-wrapper#calendar .calendar-event-add:hover {
  color: var(--accent-blue);
}

.eventsk b { font-size: 15px; }
.eventsk p { padding: 0 0 5px; margin: 0; font-weight: 600; font-size: 15px; }

@media screen and (max-width: 700px) {
  /* Public calendar only - compact date-only grid, tap a day to pop
     its content out as an overlay. Admin's "Рабочий календарь" is an
     internal tool, left as the desktop layout (with horizontal
     scroll) since admins manage it from desktop anyway. */

  #pun-main.pages #calendar table {
    width: 100%;
  }

  #calendar.eventsk th {
    width: 14.2857%;
    font-size: 10px;
    padding: 4px 2px;
  }

  #calendar.eventsk td {
    width: 14.2857% !important;
    padding: 2px;
  }

  #calendar.eventsk tbody tr:nth-child(odd) td {
    height: 22px;
    font-size: 12px;
  }

  #calendar.eventsk tbody tr:nth-child(even) td {
    height: 22px;
    overflow: visible;
  }

  /* Hidden by default - only shown when this day is tapped open */
  #calendar.eventsk .event-container,
  #calendar.eventsk .calendar-event-add,
  #calendar.eventsk .calendar-event-settings {
    display: none;
  }

  /* Small dot under any day that actually has events, so there's
     something to tap in the first place */
  #calendar.eventsk td.calendar-day:has(.event-line)::after {
    content: "";
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-red);
    margin: 2px auto 0;
  }

  /* Tapped day - event-container and icons pop out as an overlay
     beyond the cell's own boundaries. Deliberately NOT making the <td>
     itself position:absolute here - table cells don't reliably honor
     that, learned that the hard way earlier. Only the plain <div>
     children (.event-container etc, not subject to table layout)
     get repositioned. */

  #calendar.eventsk td.mobile-day-open {
    z-index: 50;
  }

  #calendar.eventsk td.mobile-day-open .event-container {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    width: 160px;
    max-width: none;
    max-height: 150px;
    margin-top: 0;
    background: var(--cover);
    border: 1px solid var(--borders-color);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    padding: 4px;
    box-sizing: border-box;
    z-index: 50;
  }

  #calendar.eventsk td.mobile-day-open .calendar-event-add,
  #calendar.eventsk td.mobile-day-open .calendar-event-settings {
    display: flex;
    position: absolute;
    top: 2px;
    z-index: 51;
  }

button#year-learning {
width: 44px;
        height: 44px;
        padding: 0;
        gap: 0;
        justify-content: center;
        font-size: 0;
}

#year-learning::after {
content: "\f6e8";
        font: 700 18px / 18px var(--fa);
        color: #C9C3AD;
        z-index: 1;
}

#ToTop {
    bottom: 320px;
}

#OnBottom {
    bottom: 280px;
}

}