/* =====================================================================
   TANAGAR FORUM / uCoz / 1.0 / 2026-11-18
   Подключать ПОСЛЕ /_st/my.css ТОЛЬКО в главном шаблоне форума.
   Все правила ограничены body.tg-forum-page и не затрагивают статьи.
   ===================================================================== */

/* 01. ПАЛИТРА И КАРКАС */
body.tg-forum-page {
  --tgf-bg: #0a0f10;
  --tgf-panel: #101718;
  --tgf-panel-2: #141c1d;
  --tgf-border: #303e3f;
  --tgf-text: #d2d8d6;
  --tgf-muted: #919d9a;
  --tgf-accent: #79bcb2;
  --tgf-link: #b3d8cd;
}
body.tg-forum-page *,
body.tg-forum-page *::before,
body.tg-forum-page *::after { box-sizing: border-box; }
body.tg-forum-page #contanier,
body.tg-forum-page #topPick { min-width: 0; }
body.tg-forum-page #contentBlock {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
  display: flow-root;
  box-sizing: border-box;
  text-align: left;
}
body.tg-forum-page #leftColumn.tgf-main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  float: none;
  padding: 0;
  margin: 0;
  overflow: visible;
}
body.tg-forum-page .tgf-shell {
  min-width: 0;
  width: 100%;
  padding: 0 0 26px;
  font-family: Calibri, "HelveticaNeueCyr-Roman", Arial, sans-serif;
  font-size: 15px;
  color: var(--tgf-text);
}
body.tg-forum-page .tgf-content {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: var(--tgf-text);
  text-align: left;
  line-height: 1.55;
}
body.tg-forum-page .tgf-content a { color: var(--tgf-link); }
body.tg-forum-page .tgf-content a:hover { color: #e5fffa; }
body.tg-forum-page .tgf-content a:focus-visible,
body.tg-forum-page .tgf-tools a:focus-visible {
  outline: 2px solid var(--tgf-accent);
  outline-offset: 3px;
}

/* 02. ВЕРХНЯЯ НАВИГАЦИЯ: вместо строки со знаками-разделителями */
body.tg-forum-page .tgf-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
  margin: 9px 0 14px;
  background: var(--tgf-panel);
  border: 1px solid var(--tgf-border);
  border-radius: 12px;
  text-align: left;
}
body.tg-forum-page .tgf-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--tgf-text);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
body.tg-forum-page .tgf-tool:hover,
body.tg-forum-page .tgf-tool:focus-visible {
  color: #f0fffb;
  background: var(--tgf-panel-2);
  border-color: var(--tgf-border);
}
body.tg-forum-page .tgf-tool--primary {
  color: #dcf7f2;
  background: #1b3433;
  border-color: #365854;
}
body.tg-forum-page .tgf-tool--reply {
  color: #d9f7f1;
  background: #24534d;
  border-color: #377469;
  margin-left: auto;
}
body.tg-forum-page .tgf-counter {
  display: inline-flex;
  min-width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #3b7770;
  color: white;
  font-size: 11px;
  font-weight: 700;
}
body.tg-forum-page .tgf-counter[hidden] { display: none !important; }

/* 03. ОБЩИЕ СТАНДАРТНЫЕ ТАБЛИЦЫ UCOZ */
body.tg-forum-page .tgf-content .gTable {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--tgf-border);
  border-radius: 10px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--tgf-bg);
  box-shadow: none;
  overflow: hidden;
  margin: 0 0 14px;
}
body.tg-forum-page .tgf-content .gTableTop {
  height: auto;
  min-height: 42px;
  padding: 11px 15px;
  background: var(--tgf-panel-2);
  color: #e5eae8;
  font-family: Calibri, "HelveticaNeueCyr-Roman", Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: none;
  text-align: left;
}
body.tg-forum-page .tgf-content .gTableSubTop {
  height: auto;
  padding: 8px 10px;
  background: #1a2324;
  color: var(--tgf-muted);
  font-size: 12px;
  font-weight: 500;
}
body.tg-forum-page .tgf-content :is(.gTableBody, .gTableBody1, .gTableBottom, .gTableLeft, .gTableRight) {
  background: var(--tgf-panel);
  color: var(--tgf-text);
  padding: 9px 11px;
}
body.tg-forum-page .tgf-content .gTable a,
body.tg-forum-page .tgf-content .forum,
body.tg-forum-page .tgf-content .threadLink,
body.tg-forum-page .tgf-content .threadPinnedLink {
  text-decoration: none;
}
body.tg-forum-page .tgf-content :is(.forumNameTd, .forumLastPostTd, .forumIcoTd, .forumThreadTd, .forumPostTd,
  .threadNametd, .threadAuthTd, .threadLastPostTd, .threadIcoTd, .threadPostTd, .threadViewTd) {
  padding: 12px 10px;
  vertical-align: middle;
  background: var(--tgf-bg);
  border-top: 1px solid rgba(255,255,255,.055);
}
body.tg-forum-page .tgf-content :is(.forumNameTd, .threadNametd) {
  line-height: 1.5;
}
body.tg-forum-page .tgf-content a:is(.forum, .threadLink, .threadPinnedLink) {
  color: #d5ece7;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
body.tg-forum-page .tgf-content a:is(.forum, .threadLink, .threadPinnedLink):hover {
  color: #ffffff;
}
body.tg-forum-page .tgf-content :is(.forumDescr, .threadDescr, .forumModer) {
  color: var(--tgf-muted);
  font-size: 12px;
  line-height: 1.5;
}
body.tg-forum-page .tgf-content :is(.forumLastPostTd, .threadLastPostTd, .threadAuthTd) {
  color: var(--tgf-muted);
  font-size: 12px;
}
body.tg-forum-page .tgf-content :is(.threadsType, .threadsDetails, .forumOnlineBar) {
  background: #182223;
  color: var(--tgf-muted);
  padding: 9px 12px;
  height: auto;
  font-size: 12px;
}
body.tg-forum-page .tgf-content :is(.pagesInfo, .switch, .switchActive) {
  padding: 6px 10px;
  height: auto;
  min-width: 25px;
  width: auto;
  border-radius: 6px;
  font-size: 12px;
}
body.tg-forum-page .tgf-content .switchActive {
  background: #2d665f;
  color: white;
}
body.tg-forum-page .tgf-content :is(a.switchDigit, a.switchBack, a.switchNext) {
  color: var(--tgf-link);
}

/* 04. ОТДЕЛЬНЫЕ СООБЩЕНИЯ - спокойный чат вместо громоздкого профиля */
body.tg-forum-page .tgf-content table.postTable {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--tgf-border);
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 12px;
  background: var(--tgf-bg);
  box-shadow: none;
}
body.tg-forum-page .tgf-content .postTdTop {
  height: auto;
  min-height: 40px;
  background: var(--tgf-panel-2);
  color: var(--tgf-muted);
  padding: 10px 13px;
  line-height: 1.55;
  font-size: 12px;
  text-align: left;
  border-bottom: 1px solid var(--tgf-border);
}
body.tg-forum-page .tgf-content .postTdTop .postUser {
  font-size: 14px;
  font-weight: 700;
  color: #e2f2ef;
}
body.tg-forum-page .tgf-content .tgf-post-avatar { display: none; }
body.tg-forum-page .tgf-content .postTdInfo {
  width: 142px;
  max-width: 142px;
  padding: 12px 8px;
  vertical-align: top;
  background: #101718;
  color: var(--tgf-muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
  border-right: 1px solid var(--tgf-border);
}
body.tg-forum-page .tgf-content .postTdInfo img { max-width: 110px; height: auto; }
body.tg-forum-page .tgf-content .posttdMessage {
  padding: 15px 18px;
  vertical-align: top;
  background: var(--tgf-bg);
  color: var(--tgf-text);
  font-size: 15px;
  line-height: 1.7;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: normal;
}
body.tg-forum-page .tgf-content .posttdMessage :is(img, video, svg, iframe) {
  max-width: 100% !important;
  height: auto;
}
body.tg-forum-page .tgf-content .posttdMessage :is(pre, code) {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
body.tg-forum-page .tgf-content .posttdMessage blockquote,
body.tg-forum-page .tgf-content .quoteMessage {
  background: #172122;
  border-left: 3px solid #4a8f84;
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  color: #c6d4d0;
  font-size: 13px;
}
body.tg-forum-page .tgf-content .postBottom {
  height: auto;
  padding: 8px 12px;
  background: var(--tgf-panel);
  color: var(--tgf-muted);
  text-align: right;
  font-size: 12px;
  border-top: 1px solid var(--tgf-border);
}
body.tg-forum-page .tgf-content .postSeparator { height: 8px; background: transparent; }
body.tg-forum-page .tgf-content .signatureView,
body.tg-forum-page .tgf-content .edited { color: #85928f; font-size: 12px; }
body.tg-forum-page .tgf-content .signatureHr {
  margin-top: 16px;
  border: 0;
  border-top: 1px solid var(--tgf-border);
  background: transparent;
}

/* 05. ФОРМЫ, ТЕКСТОВЫЕ ПОЛЯ, КНОПКИ */
body.tg-forum-page .tgf-content :is(input, select, textarea, button) {
  max-width: 100%;
  font-family: Calibri, Arial, sans-serif;
}
body.tg-forum-page .tgf-content :is(.postTextFl, .postNameFl, .postDescrFl, .postPollFl, .postQuestionFl, .postAnswerFl) {
  max-width: 100%;
  background: #111a1b;
  color: #e3eeeb;
  border: 1px solid var(--tgf-border);
  border-radius: 8px;
  padding: 9px 11px;
}
body.tg-forum-page .tgf-content .postTextFl {
  width: 100%;
  min-height: 160px;
  line-height: 1.5;
  resize: vertical;
}
body.tg-forum-page .tgf-content :is(.postSubmit, .postPreview, .postReset, .pollSubmitBut, .pollreSultsBut, .searchSbmFl, .codeButtons) {
  max-width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  background: #1b3433;
  color: #d7eae6;
  border: 1px solid #395d58;
  border-radius: 8px;
  text-shadow: none;
  cursor: pointer;
}
body.tg-forum-page .tgf-content .postSubmit {
  background: #2d6159;
  color: #f2fffc;
}
body.tg-forum-page .tgf-content :is(.postSubmit, .postPreview, .postReset):hover {
  filter: brightness(1.14);
}
body.tg-forum-page .tgf-content .postTextFl:focus-visible,
body.tg-forum-page .tgf-content input:focus-visible {
  outline: 2px solid #538c83;
  outline-offset: 1px;
}

/* 06. ПЛАНШЕТЫ */
@media (max-width: 960px) {
  body.tg-forum-page #contentBlock { padding-inline: 12px; }
  body.tg-forum-page .tgf-content .gTable { margin-bottom: 12px; }
}

/* 07. ТЕЛЕФОН: списки превращаются в ленту диалогов */
@media (max-width: 760px) {
  body.tg-forum-page #contentBlock { width: 100%; max-width: 100%; padding: 0 10px; }
  body.tg-forum-page #leftColumn.tgf-main { width: 100%; max-width: 100%; }
  body.tg-forum-page .tgf-shell { font-size: 14px; padding-bottom: 14px; }
  body.tg-forum-page .tgf-tools {
    gap: 5px;
    padding: 7px;
    margin: 8px 0 12px;
    border-radius: 10px;
  }
  body.tg-forum-page .tgf-tool {
    flex: 0 1 auto;
    padding: 7px 9px;
    font-size: 12px;
    min-height: 36px;
    white-space: normal;
    text-align: center;
  }
  body.tg-forum-page .tgf-tool--reply { margin-left: 0; }

  body.tg-forum-page .tgf-content :is(.tgf-forum-list, .tgf-topic-list) {
    display: block;
    width: 100% !important;
    max-width: 100%;
    border-spacing: 0;
  }
  body.tg-forum-page .tgf-content :is(.tgf-forum-list, .tgf-topic-list) > tbody {
    display: block;
    width: 100%;
  }
  body.tg-forum-page .tgf-content :is(.tgf-forum-list, .tgf-topic-list) > tbody > tr {
    display: block;
    width: 100%;
  }
  body.tg-forum-page .tgf-content :is(.tgf-forum-list, .tgf-topic-list) > tbody > tr > td {
    box-sizing: border-box;
    max-width: 100%;
  }
  /* Заголовки категорий обязаны занимать всю ширину карточки. */
  body.tg-forum-page .tgf-content :is(.tgf-forum-list, .tgf-topic-list) > tbody > tr > td.gTableTop,
  body.tg-forum-page .tgf-content :is(.tgf-forum-list, .tgf-topic-list) > tbody > tr > td.threadsType {
    display: block;
    width: 100% !important;
  }
  body.tg-forum-page .tgf-content :is(.tgf-forum-list, .tgf-topic-list) > tbody > tr.tgf-column-head {
    display: none;
  }
  body.tg-forum-page .tgf-content :is(.tgf-forum-row, .tgf-topic-row) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    padding: 13px 14px;
    border-top: 1px solid var(--tgf-border);
    background: var(--tgf-bg);
    gap: 4px;
  }
  body.tg-forum-page .tgf-content :is(.tgf-forum-row, .tgf-topic-row):hover {
    background: #121c1c;
  }
  body.tg-forum-page .tgf-content .tgf-forum-row > :is(.forumNameTd, .forumLastPostTd),
  body.tg-forum-page .tgf-content .tgf-topic-row > :is(.threadNametd, .threadLastPostTd) {
    display: block;
    width: 100% !important;
    max-width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    overflow-wrap: anywhere;
    text-align: left;
  }
  /* Счетчики, пиктограммы и автор исходной темы занимали 4-5 колонок. */
  body.tg-forum-page .tgf-content .tgf-forum-row > :is(.forumIcoTd, .forumThreadTd, .forumPostTd),
  body.tg-forum-page .tgf-content .tgf-topic-row > :is(.threadIcoTd, .threadPostTd, .threadViewTd, .threadAuthTd) {
    display: none !important;
  }
  body.tg-forum-page .tgf-content .tgf-forum-row .forumLastPostTd,
  body.tg-forum-page .tgf-content .tgf-topic-row .threadLastPostTd {
    margin-top: 2px;
    color: var(--tgf-muted);
    font-size: 12px;
  }
  body.tg-forum-page .tgf-content a:is(.forum, .threadLink, .threadPinnedLink) {
    font-size: 15px;
    line-height: 1.4;
  }
  body.tg-forum-page .tgf-content .gTableTop {
    font-size: 15px;
    padding: 11px 12px;
  }
  body.tg-forum-page .tgf-content :is(.threadsType, .threadsDetails) {
    display: block;
    font-size: 12px;
    padding: 8px 12px;
  }
  /* Остальные форумные таблицы пока остаются штатными и не ломают форму. */
  body.tg-forum-page .tgf-content table:not(.postTable) { max-width: 100%; }

  /* Пост: аватар и автор в первой строке, затем только текст и действия. */
  body.tg-forum-page .tgf-content table.postTable,
  body.tg-forum-page .tgf-content table.postTable > tbody,
  body.tg-forum-page .tgf-content table.postTable > tbody > tr {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: auto;
  }
  body.tg-forum-page .tgf-content table.postTable {
    border-radius: 11px;
    margin-bottom: 12px;
    overflow: hidden;
  }
  body.tg-forum-page .tgf-content table.postTable .postTdTop,
  body.tg-forum-page .tgf-content table.postTable .posttdMessage,
  body.tg-forum-page .tgf-content table.postTable .postBottom {
    display: block;
    width: 100% !important;
    max-width: 100%;
  }
  body.tg-forum-page .tgf-content table.postTable.tgf-post--compact .postTdInfo {
    display: none !important;
  }
  body.tg-forum-page .tgf-content table.postTable:not(.tgf-post--compact) .postTdInfo {
    display: block;
    width: 100%;
    max-width: 100%;
    text-align: left;
    border-right: 0;
    border-bottom: 1px solid var(--tgf-border);
  }
  body.tg-forum-page .tgf-content .tgf-post--compact .postTdTop {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #152021;
  }
  body.tg-forum-page .tgf-content .tgf-post--compact .tgf-post-heading {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  body.tg-forum-page .tgf-content .tgf-post--compact .tgf-post-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid #456560;
    background: #24433f;
    color: white;
    font-size: 17px;
    font-weight: 700;
  }
  body.tg-forum-page .tgf-content .tgf-post-avatar > a {
    display: block;
    width: 100%;
    height: 100%;
  }
  body.tg-forum-page .tgf-content .tgf-post-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
  }
  body.tg-forum-page .tgf-content .posttdMessage {
    padding: 13px 14px;
    line-height: 1.65;
    font-size: 14px;
    overflow-wrap: anywhere;
  }
  body.tg-forum-page .tgf-content .postBottom {
    padding: 9px 11px;
    font-size: 12px;
  }
  body.tg-forum-page .tgf-content .postBottom img {
    max-height: 22px;
    width: auto;
  }
  body.tg-forum-page .tgf-content table.postTable > tbody > tr.postSeparator,
  body.tg-forum-page .tgf-content .postSeparator { display: none; }
  body.tg-forum-page .tgf-content .posttdMessage table { max-width: 100%; }

  /* Форма ответа: поля по ширине контейнера, кнопки легко нажимаются. */
  body.tg-forum-page .tgf-content .tgf-reply-form,
  body.tg-forum-page .tgf-content .tgf-reply-form > table { max-width: 100%; }
  body.tg-forum-page .tgf-content .tgf-reply-form > table.gTable,
  body.tg-forum-page .tgf-content .tgf-reply-form > table.gTable > tbody,
  body.tg-forum-page .tgf-content .tgf-reply-form > table.gTable > tbody > tr,
  body.tg-forum-page .tgf-content .tgf-reply-form > table.gTable > tbody > tr > td {
    display: block;
    width: 100% !important;
    max-width: 100%;
  }
  body.tg-forum-page .tgf-content :is(.postNameFl, .postDescrFl, .postPollFl, .postQuestionFl, .postTextFl, .postUserFl) {
    width: 100% !important;
    min-width: 0 !important;
  }
  body.tg-forum-page .tgf-content .tgf-reply-form textarea {
    width: 100% !important;
    min-height: 170px;
  }
  body.tg-forum-page .tgf-content .tgf-reply-form iframe,
  body.tg-forum-page .tgf-content iframe {
    max-width: 100% !important;
  }
  body.tg-forum-page .tgf-content .tgf-reply-form :is(.postSubmit, .postPreview) {
    min-height: 41px;
    padding: 9px 13px;
  }
}

/* 08. Очень узкие телефоны */
@media (max-width: 390px) {
  body.tg-forum-page #contentBlock { padding-inline: 7px; }
  body.tg-forum-page .tgf-tools { gap: 4px; }
  body.tg-forum-page .tgf-tool { font-size: 11.5px; padding: 7px 8px; }
  body.tg-forum-page .tgf-content .tgf-forum-row,
  body.tg-forum-page .tgf-content .tgf-topic-row { padding: 11px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  body.tg-forum-page .tgf-tool { transition: none; }
}
