.mine-mobile-tools {
  display: none;
}

/* Keep category wrapping inside its column in the news metadata. */
.middle .mainside .news .infobtm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, max-content);
  align-items: center;
  gap: 4px 12px;
  box-sizing: border-box;
  min-height: 30px;
  height: auto;
  padding: 5px 10px;
  background: #3a2a1c url(../images/newsinfo.png) repeat-x;
  line-height: 1.4;
}

.middle .mainside .news .infobtm > li {
  float: none;
  min-width: 0;
  margin: 0;
  padding: 0;
  line-height: inherit;
}

.middle .mainside .news .infobtm > li:first-child {
  overflow-wrap: anywhere;
}

.middle .mainside .news .infobtm > li:first-child .sep {
  display: none;
}

.middle .mainside .news .infobtm > li:not(:first-child) {
  white-space: nowrap;
}

@media (max-width: 1351px) {
  .header, .middle, .footer {
    box-sizing: border-box;
    width: 100%;
    max-width: 1352px;
  }

  .middle .mainside img, .middle .mainside video,
  .middle .mainside iframe, .block img {
    max-width: 100%;
  }

  .middle .mainside img, .middle .mainside video, .block img {
    height: auto;
  }
}

@media (min-width: 1081px) and (max-width: 1351px) {
  .middle > table {
    table-layout: fixed;
  }

  .middle .leftside, .middle .rightside {
    width: 22%;
  }

  .middle .mainside {
    overflow-wrap: anywhere;
  }

  #vk_groups {
    max-width: 100%;
    overflow: hidden;
  }
}

@media (max-width: 1080px) {
  body {
    background-size: auto min(100vw, 680px);
    font-size: 15px;
    line-height: 1.55;
  }

  .middle, .footer {
    padding-inline: clamp(10px, 3vw, 26px);
  }

  .header .hmenu, .mine-mobile-tools {
    margin-inline: clamp(10px, 3vw, 26px);
  }

  .middle .mine-mobile-original-group {
    display: none;
  }

  .header .logotype {
    margin: 14px 0 10px;
  }

  .header .logotype a {
    display: block;
    width: min(100%, 483px);
    height: auto;
    aspect-ratio: 483 / 79;
    margin-inline: auto;
    background-size: contain;
    background-position: center;
  }

  .header .logotype img {
    display: none;
  }

  .header .headtop {
    height: auto;
    min-height: 30px;
    overflow: auto;
  }

  .header .hmenu {
    display: flex;
    flex-wrap: wrap;
    height: auto;
    padding: 3px 4px;
    background-color: #3a2a1c;
    background-size: auto 100%;
  }

  .header .hmenu li {
    float: none;
    margin: 0;
    line-height: 1.3;
  }

  .header .hmenu a {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 44px;
    padding: 0 9px;
  }

  .middle {
    padding-block: 12px;
  }

  .middle > table, .middle > table > tbody {
    display: block;
    box-sizing: border-box;
    width: 100%;
  }

  .middle > table > tbody > tr {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .middle .mainside, .middle .leftside, .middle .rightside {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
  }

  .middle .mainside {
    order: -1;
    padding: 0;
  }

  .middle .leftside, .middle .rightside {
    padding: 8px;
  }

  .middle .blocktitle {
    height: auto;
    min-height: 30px;
    background-color: #4a3524;
  }

  #vk_groups, #vk_groups iframe {
    max-width: 100%;
  }

  .middle .mainside .newstop {
    box-sizing: border-box;
    height: auto;
    padding: 9px 12px;
    border-radius: 8px 8px 0 0;
    background: #4a3524;
  }

  .middle .mainside .newstop .ntitle {
    padding: 0;
    margin: 0;
    font-size: 19px;
    line-height: 1.3;
  }

  .middle .mainside .newscont {
    padding: 11px 12px;
    overflow-wrap: anywhere;
  }

  .middle .mainside .maincont p {
    margin-block: 0.65em;
  }

  .middle .mainside .maincont a, .middle .mainside .attachment {
    text-decoration: underline;
    text-underline-offset: 0.15em;
  }

  .middle .mainside iframe[src*="youtube"],
  .middle .mainside iframe[src*="youtu.be"],
  .middle .mainside iframe[src*="rutube"] {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .middle .mainside pre, .middle .mainside .scriptcode {
    max-width: 100%;
    overflow-x: auto;
  }

  .middle .mainside .maincont table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .middle .mainside input:not([type="checkbox"]):not([type="radio"]),
  .middle .mainside textarea, .middle .mainside select {
    box-sizing: border-box;
    max-width: 100%;
    font-size: 16px;
  }

  .middle .mainside .tableform, .middle .mainside .tableform tbody,
  .middle .mainside .tableform tr, .middle .mainside .tableform td {
    display: block;
    box-sizing: border-box;
    width: 100%;
  }

  .middle .mainside .tableform td {
    padding: 6px 0;
  }

  .middle .mainside .infotop {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 13px;
  }

  .middle .mainside .infotop > li {
    float: none;
    margin: 0;
    line-height: 1.4;
  }

  .middle .mainside .newscont {
    container: mine-news-card / inline-size;
  }

  .middle .mainside .news .infobtm {
    grid-template-columns: max-content max-content minmax(0, 1fr);
    gap: 5px 8px;
    padding: 5px 8px;
    background: #3a2a1c;
    font-size: 13px;
  }

  .middle .mainside .news .infobtm > li:first-child {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
    padding-block: 4px 5px;
    border-bottom: 1px solid #6b513d;
  }

  .middle .mainside .news .infobtm > li:first-child > span:has(.cat-link) {
    flex: 1 1 9rem;
    min-width: 0;
    font-size: 0;
  }

  .middle .mainside .news .infobtm .cat-link {
    display: inline-block;
    box-sizing: border-box;
    max-width: 100%;
    margin: 0 4px 4px 0;
    padding: 2px 5px;
    border-radius: 4px;
    background: #503a28;
    font-size: 13px;
    line-height: 1.4;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .middle .mainside .news .infobtm > li.fullink {
    justify-self: end;
    text-align: right;
  }

  .middle .mainside .news .infobtm > li.fullink a,
  .middle .mainside .navi a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  .middle .mainside .news .infobtm > li.fullink a {
    padding-inline: 5px;
    font-size: 13px;
  }

  @container mine-news-card (max-width: 315px) {
    .middle .mainside .news .infobtm {
      grid-template-columns: minmax(0, 1fr) max-content;
    }

    .middle .mainside .news .infobtm > li.fullink {
      grid-column: 1 / -1;
      justify-self: stretch;
      text-align: center;
    }

    .middle .mainside .news .infobtm > li.fullink a {
      display: flex;
      border-radius: 4px;
      background: #503a28;
    }
  }

  .middle .mainside .navi {
    line-height: 2;
  }

  .footer .foot {
    height: auto;
    padding: 10px;
    margin-bottom: 12px;
    overflow: auto;
    background-color: #3a2a1c;
  }

  .footer .foot_left, .footer .counter {
    float: none;
    margin-top: 0;
  }

  .footer .foot_menu {
    display: flex;
    flex-wrap: wrap;
  }

  .footer .foot_menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .mine-mobile-tools {
    display: grid;
    gap: 8px;
    padding: 8px 0;
  }

  .mine-mobile-tools details {
    border: 1px solid #6b513d;
    border-radius: 8px;
    background: #35271c;
  }

  .mine-mobile-tools summary {
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .mine-mobile-tools .mine-mobile-links {
    display: grid;
    gap: 8px;
    padding: 0 8px 8px;
  }

  .mine-mobile-links > div {
    box-sizing: border-box;
    min-width: 0;
    padding: 6px 8px 8px;
    border: 1px solid #6b513d;
    border-radius: 6px;
    background: #2d2118;
  }

  .mine-mobile-links h2 {
    margin: 0;
    padding: 4px 5px 6px;
    color: #b7d99c;
    font-size: 14px;
    line-height: 1.4;
  }

  .mine-mobile-links ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
    gap: 4px;
    padding: 0;
    list-style: none;
  }

  .mine-mobile-links a, .middle .blockmenu li a {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 44px;
    height: auto;
    padding: 7px 8px;
    border-radius: 4px;
    background: #413025;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .mine-mobile-links a:hover, .middle .blockmenu li a:hover {
    background: #513b2b;
  }

  .middle .blockmenu {
    display: grid;
    gap: 4px;
  }

  .mine-mobile-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .mine-mobile-search input, .mine-mobile-search button {
    box-sizing: border-box;
    min-width: 0;
    min-height: 44px;
    border: 1px solid #6b513d;
    border-radius: 8px;
    font: inherit;
    padding: 6px 10px;
  }

  .mine-mobile-search button {
    background: #315327;
    color: #fff;
    cursor: pointer;
  }

  .header a:focus-visible, .footer a:focus-visible, .middle a:focus-visible,
  .mine-mobile-tools :focus-visible {
    outline: 2px solid #b7d99c;
    outline-offset: -2px;
  }

  .middle .rightside .adsbygoogle, .middle .leftside .adsbygoogle {
    max-width: 100%;
  }
}
