/* Refinements for the added controls: top menu pills and the search form.
   Layout changes are inside the narrow-screen query below; on desktop only
   these two new controls are restyled, the original design is preserved. */
.menu { white-space: nowrap !important; }
.menu ul {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
}
.menu li {
  float: none !important;
  display: inline-block !important;
  margin: 0 8px 0 0 !important;
}
.menu li a {
  display: inline-block !important;
  padding: 6px 10px !important;
  border-radius: 18px !important;
  background: #f1effa !important;
  color: #5b3a8e !important;
  font-size: 13px !important;
  font-weight: normal !important;
  text-decoration: none !important;
}
.menu li a:hover {
  background: #e6e2f7 !important;
  text-decoration: none !important;
}
.search form[data-search="1"] {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
}
.search form[data-search="1"] .input {
  width: 112px !important;
  height: 22px !important;
  margin: 0 !important;
  padding: 0 6px !important;
  border: 1px solid #d8d4e8 !important;
  border-radius: 8px !important;
}
.search form[data-search="1"] button {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  height: 22px !important;
  line-height: 1 !important;
  padding: 0 9px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #7676C7 !important;
  color: #fff !important;
  font: bold 8pt Verdana, Arial, sans-serif !important;
  cursor: pointer;
}

/* Catalog-style image card inside text-only articles. */
.article-photo {
  float: right;
  width: 250px;
  max-width: 45%;
  margin: 2px 0 16px 18px;
  padding: 5px;
  background: #fff !important;
  border: 1px solid #e3e0d6 !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 10px rgba(35, 36, 31, .12);
}
.article-photo img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
}

/* "Разделы сайта": the original corner sprites resolve to 404 here, so the
   heading used to render as a plain square bar. Draw a rounded one instead. */
.left .widget {
  background: linear-gradient(135deg, #b995c1, #9d79ad) !important;
  border-radius: 12px !important;
  overflow: hidden;
  width: 199px;
}
.left .widget div,
.left .widget div div,
.left .widget div div div {
  background: none !important;
}
.left li.linkcat h2 {
  border-radius: 12px 12px 0 0;
  padding: 8px 10px !important;
  font-size: 12px !important;
  letter-spacing: .3px;
  color: #fff !important;
}

/* Soften the original square frames on desktop as well. */
.menu, .search, .cont, .cont_top, .my_body, .blog, .blog_0,
.bottom, .publicite, .m_menu_0, .m_menu_2 {
  border-radius: 12px;
}
.cont_top, .my_body { border-radius: 10px; }
.publicite, .m_menu_0, .m_menu_2 { border-radius: 10px; }
.accordionHeader, .accordionHeaderSelected { border-radius: 10px 10px 0 0; }
.accordionContent { border-radius: 0 0 10px 10px; }
table { border-radius: 8px; border-collapse: separate; border-spacing: 0; }

@media (max-width: 767px) {
  *, *::before, *::after { box-sizing: border-box !important; }
  html, body {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body {
    background: #f7f6f2 !important;
    color: #23241f;
    font-family: Verdana, Arial, Tahoma, sans-serif;
    font-size: 15px !important;
    line-height: 1.55 !important;
    -webkit-text-size-adjust: 100%;
  }
  p, li, td { font-size: 14px !important; line-height: 1.55 !important; }
  a { color: #5b3a8e; }
  a:active { opacity: .65; }

  /* Top app bar (injected right after <body>, so sticky works immediately). */
  .mobile-menu-toggle {
    display: block !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    padding: 13px 18px !important;
    margin: 0 0 10px !important;
    font: bold 17px/1.2 Verdana, Arial, sans-serif !important;
    letter-spacing: .3px;
    color: #fff !important;
    background: #7676C7 !important;
    border: 0 !important;
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 2px 10px rgba(60, 40, 100, .22);
    cursor: pointer;
    text-align: left;
  }

  .main, .dt, .blog_0, .head {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 10px !important;
  }
  .dr { display: block !important; width: 100% !important; }
  .dc, .left, .right, .w219, .w19, .w226, .w318, .w18,
  .my_body, .blog, .publicite, .cont, .cont_top {
    float: none !important;
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 0 12px !important;
  }

  /* Drop the 2010-era table slices and 1px spacers. */
  .spacer, img[src$="s.gif"],
  img[src*="head_"][src$=".gif"],
  img[src*="head_"][src$=".jpg"] { display: none !important; }
  img { max-width: 100% !important; height: auto !important; }
  [style*="width:"] { max-width: 100% !important; }
  [style*="height:"] { height: auto !important; }
  table { width: 100% !important; max-width: 100% !important; border-collapse: collapse; }
  td, th { padding: 7px !important; border: 1px solid #e8e5dc; vertical-align: top; overflow-wrap: anywhere; }

  /* Logo and language flags. */
  .dc:has(img[src*="head_4_13.png"]) { text-align: center !important; }
  img[src*="head_4_13.png"] { width: 190px !important; max-width: 70% !important; }
  .dt:has(#flags) { text-align: center !important; }
  #flags img { margin: 0 7px !important; }

  /* Article photo: full-width card, no text wrapping on a narrow screen. */
  .article-photo {
    float: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 6px 0 18px !important;
    padding: 6px !important;
    text-align: center;
  }

  /* Card-like header blocks. */
  .menu, .search, .publicite, .left {
    background: #fff !important;
    border: 1px solid #e3e0d6 !important;
    border-radius: 12px !important;
    padding: 12px !important;
    box-shadow: 0 1px 4px rgba(35, 36, 31, .05);
  }
  .menu { padding: 10px 12px !important; }
  .menu ul {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: normal !important;
  }
  .menu li {
    float: none !important;
    display: inline-block !important;
    margin: 0 6px 6px 0 !important;
  }
  .menu li a {
    display: inline-block !important;
    padding: 6px 10px !important;
    border-radius: 18px !important;
    background: #f1effa !important;
    color: #5b3a8e !important;
    font-size: 13px !important;
    text-decoration: none !important;
  }
  .search form[data-search="1"] { display: block !important; }
  .search form[data-search="1"] .input {
    width: 100% !important;
    height: 34px !important;
    margin: 0 0 8px !important;
    padding: 0 10px !important;
    border: 1px solid #d8d4e8 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
  }
  .search form[data-search="1"] button {
    width: 100% !important;
    height: 34px !important;
    line-height: 1.2 !important;
    padding: 9px !important;
    border-radius: 8px !important;
    background: #7676C7 !important;
    color: #fff !important;
    border: 0 !important;
    font: bold 14px Verdana, Arial, sans-serif !important;
    cursor: pointer;
  }

  /* One card per article: nested wrappers stay transparent to save width. */
  .cont, .blog, .text {
    background: #fff !important;
    border: 1px solid #e3e0d6 !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: 0 2px 8px rgba(35, 36, 31, .06);
    color: #23241f;
  }
  .cont_top, .my_body, .text_top {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
  }
  .my_body h2, .cont h2 {
    font-size: 20px !important;
    line-height: 1.25 !important;
    color: #784383 !important;
    margin: 0 0 12px !important;
  }
  h3 { font-size: 15px !important; color: #5f5b8f !important; margin: 16px 0 6px !important; }
  h4 { font-size: 14px !important; }
  .text_top p { font-size: 14px !important; }
  .text img, img.left, img.right {
    float: none !important;
    display: block !important;
    margin: 10px auto !important;
    border: 1px solid #e3e0d6 !important;
    border-radius: 8px !important;
  }

  /* Section menu: hidden until the top bar is tapped. */
  .left { display: none !important; }
  body.mobile-menu-open .left { display: block !important; }
  .left li.linkcat h2 { font-size: 15px !important; color: #784383 !important; }
  .left ul li a {
    display: block !important;
    padding: 10px 8px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
  }
  .left ul li a:active { background: #f1effa; }

  /* Article first, section menu next, advertising last. */
  .dr:has(> .left) { display: flex !important; flex-direction: column; }
  .dr:has(> .left) > .dc:has(> .cont) { order: 1; }
  .dr:has(> .left) > .left { order: 2; }
  .dr:has(> .left) > .right { order: 3; }
  .dr:has(> .left) > .dc:has(> img[src$="s.gif"]) { display: none !important; }

  .bottom {
    background: #fff !important;
    border: 1px solid #e3e0d6 !important;
    border-radius: 12px !important;
    padding: 14px !important;
    text-align: center;
  }
}

@media (min-width: 768px) {
  .mobile-menu-toggle { display: none !important; }
}
