/* pidruchnik.com — усі стилі шаблону study_adaptive в одному файлі.
   Порядок секцій важливий (каскад): 1) legacy 2) колонки 3) adaptive 4) pidr 5) header + темна тема. */

/* ----------------------------------------------------------------------
   КОЛЬОРИ САЙТУ — змінюйте тут, і вони зміняться всюди.
   ---------------------------------------------------------------------- */
:root{
  --brand:#2f5d50;        /* основний зелений: кнопки, активні пункти, футер */
  --brand-hover:#244a40;  /* зелений при наведенні */
  --accent:#f46604;       /* помаранчевий: посилання, лічильники, логотип */
  --accent-hover:#e05a00; /* помаранчевий при наведенні */
}

/* ######################################################################
   1. LEGACY — використовувані правила старого шаблону
   ###################################################################### */

/* legacy.css — потрібні правила зі style.css, styles.css, engine.css, default.css (DLE 15), 01.10.2026 */
/* style.css */
* { margin: 0px; padding: 0px; }
body { color: rgb(66, 64, 63); width: 100%; font: 12px / 17px Arial, Tahoma, Helvetica, sans-serif; background: url("../images/bgx.jpg") center top repeat scroll rgb(216, 174, 126); border: 0px; margin: 0px; padding: 0px; }
a { color: blue; outline: none; text-decoration: underline; }
a:hover { text-decoration: none; }
p { margin: 0px 0px 18px; }
img { border-width: medium; border-style: none; border-color: currentcolor; border-image: none; }
input { vertical-align: middle; }
#wrapper { width: 1000px; margin: 0px auto; padding-top: 10px; }
ol, ul { list-style: outside none none; }
.bnavi { margin: 0px 3px; }
.bnavi li:first-child a { border-top-width: medium; border-top-style: none; border-top-color: currentcolor; }
.bnavi li a { background: url("../images/gwdot.png") 5px 50% no-repeat scroll transparent; border-top: 1px dotted rgb(241, 240, 240); color: rgb(146, 140, 140); display: block; font-size: 12px; padding: 10px 0px 5px 15px; font-weight: bold; }
.bnavi li:first-child a { border-top-width: medium; border-top-style: none; border-top-color: currentcolor; }
.bnavi li a:hover { background: url("../images/gdot.png") 5px 50% no-repeat scroll transparent; color: rgb(112, 193, 63); text-decoration: none; }
#cssmenu > ul > li.active a { box-shadow: rgb(0, 0, 0) 0px 0px 3px inset; background: linear-gradient(rgb(38, 38, 44) 0%, rgb(7, 7, 7) 100%); }
input, select, button { font-family: Cuprum, sans-serif; vertical-align: middle; }
.panelx1 { background: url("../images/bg.jpg") center top no-repeat scroll transparent; }
#content { background: none 0px 0px repeat scroll rgb(255, 255, 255); padding: 0px 7px; }
#primary { width: 678px; }
#sidebar { background: none 0px 0px repeat scroll rgb(248, 248, 248); border-radius: 12px 12px 0px 0px; padding: 10px; width: 260px; }
.sidebar-narrow { width: 140px; }
.hidden { display: none; }
.alignleft { float: left; }
.alignright { float: right; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
a img { border-width: medium; border-style: none; border-color: currentcolor; border-image: none; }
.entry-meta { margin-bottom: 10px; }
.widget { margin-bottom: 30px; }
.hentry, .navigation-links, .hfeed, .nav, #featured, .pinglist { margin-bottom: 40px; }
h1, h2, h3, h4, h5, h6 { font-weight: normal; }
h1 { font-size: 22px; line-height: 30px; }
h2 { font-size: 20px; line-height: 22px; }
h3 { font-size: 16px; line-height: 20px; }
.entry-title, .entry-title a { font-size: 22px; line-height: 30px; }
#category-blocks { margin-bottom: 20px; }
.category-block { width: 300px; }
.category-block .post-container { background: url("../images/bg-dots.gif") left bottom repeat-x; padding: 0px 0px 10px; margin: 0px 0px 10px; }
.category-block .post-thumb { margin: 0px; padding: 0px; }
.category-block .post-thumb img { padding: 4px; background: rgb(248, 248, 248); border: 1px solid rgb(238, 238, 238); float: left; margin: 0px 10px 0px 0px; }
.category-block .post-thumb img:hover { background: rgb(51, 51, 51); border-color: rgb(34, 34, 34); }
.category-block .entry-title, .category-block .entry-title a { font-size: 13px; line-height: 20px; color: rgb(51, 51, 51); font-weight: bold; }
.category-block .entry-title a:hover { text-decoration: none; }
.category-block .entry-header { margin: 0px 0px 3px; padding: 0px; }
.category-block .entry-header, .category-block .entry-header a { font-size: 10px; text-transform: uppercase; color: rgb(153, 153, 153); }
input, textarea, button { background: rgb(255, 255, 255); border: 1px solid rgb(239, 239, 239); }
button, input[type="submit"], #mc_signup_submit { padding: 2px 10px; cursor: pointer; }
.entry-meta { font-size: 10px; color: rgb(153, 153, 153); text-transform: uppercase; }
small { font-size: 11px; }
ins { text-decoration: underline; }
th, td { vertical-align: middle; }
.xoxo, .widget ul { margin: 0px; padding: 0px; list-style-type: none; }
.xoxo a, .widget ul li a { color: rgb(51, 51, 51); }
.xoxo a:hover, .widget ul li a:hover { text-decoration: none; }
.tz_tab_widget #tab-items li a:hover, .tz_tab_widget #tab-items li.ui-tabs-selected a, .tz_tab_widget #tab-items li.ui-state-active a { background: rgb(255, 255, 255); text-decoration: none; border-left: 1px solid rgb(232, 232, 232); border-top: 1px solid rgb(232, 232, 232); border-right: 1px solid rgb(232, 232, 232); }
.tz_tab_widget .ui-tabs-hide { display: none; }
.tab-comments .avatar { padding: 4px; background: rgb(248, 248, 248); border: 1px solid rgb(238, 238, 238); float: left; margin: 0px 10px 0px 0px; }
.tab-comments .avatar:hover { background: rgb(51, 51, 51); border-color: rgb(34, 34, 34); }
.tab-comments h3, .tab-comments h3 a { font-size: 12px; line-height: 20px; font-weight: normal; font-style: italic; color: rgb(102, 102, 102); }
.tab-comments h3 a:hover { text-decoration: none; color: rgb(51, 51, 51); }
.clearfix::after { content: "."; display: block; height: 0px; clear: both; visibility: hidden; }
.clearfix { display: inline-block; }
.clearfix { display: block; }
body.ie #commentform div.input-container, body.ie #commentform div.textarea-container, body.ie #contactForm div.input-container, body.ie #contactForm div.textarea-container { overflow: visible; display: inline; padding: 3px; }
body.ie #commentform div.input-container { width: 302px; }
body.ie #commentform div.textarea-container { width: 452px; }
body.ie #commentform div.input-container input { margin: 0px !important; }
body.gecko #commentform div.input-container, body.gecko #commentform div.textarea-container, body.gecko #contactForm div.input-container, body.gecko #contactForm div.textarea-container, body.opera #commentform div.input-container, body.opera #commentform div.textarea-container, body.opera #contactForm div.input-container, body.opera #contactForm div.textarea-container { padding: 3px; }
#wrapper { width: 1020px; z-index: 1; position: relative; }
/* styles.css */
.post-tags { background: url("../images/tag.png") left top no-repeat scroll transparent; clear: both; font: 700 12px / 12px "Open Sans", sans-serif; margin: 10px 0px; padding-left: 22px; }
.post-details2 { margin: 20px 0px; }
.post-tags a { background: none 0px 0px repeat scroll rgb(170, 170, 170); color: rgb(255, 255, 255); display: inline-block; margin: 0px 2px 8px; padding: 5px; }
.post-tags a:visited { color: rgb(255, 255, 255); }
.post-tags a:hover { background: none 0px 0px repeat scroll rgb(119, 119, 119); color: rgb(255, 255, 255); text-decoration: none; }
#related-posts ul, #related-posts ul li { display: block; }
#related-posts ul li { margin: 5px 0px; width: 100%; height: auto; }
.related-small { display: block; }
#related-posts ul, #related-posts ul li { display: block; }
#related-posts ul li { margin: 5px 0px; width: 100%; height: auto; }
.related-small { display: block; }
#related-posts { float: left; margin: 10px 0px 0px; width: 680px; height: 208px; overflow: hidden; }
#related-posts img { transition: 0.3s; }
#related-posts img:hover { opacity: 0.85; }
#related-posts ul { display: inline; float: left; width: 100%; }
#related-posts ul li { display: inline; float: left; margin-left: 12px; width: 160px; height: 164px; }
#related-posts ul li:first-child { margin-left: 0px; }
#related-posts h3 { border-bottom: 1px dotted rgb(204, 204, 204); font: 700 14px / 14px "Open Sans Condensed", sans-serif; margin-bottom: 10px; margin-top: 20px; padding-bottom: 15px; text-transform: uppercase; }
.related-image { float: left; position: relative; width: 160px; height: 144px; overflow: hidden; }
.related-text { background: url("../images/featured-bg.png"); float: left; padding: 5px; position: absolute; bottom: 0px; width: 155px; }
.related-text a { color: rgb(255, 255, 255); font: 700 12px / 16px "Open Sans Condensed", sans-serif; padding: 0px; text-transform: capitalize; margin: 0px !important; }
.related-text a:visited { color: rgb(255, 255, 255); }
.related-small { display: none; }
.main-headline { color: rgb(255, 255, 255); float: left; font-size: 16px; margin-bottom: 5px; width: 100%; font-weight: bold; }
header nav { position: absolute; bottom: 0px; right: 0px; width: 740px; min-height: 50px; }
article { margin: 0px 1px; }
.comments { background: rgb(255, 255, 255); margin: -2px 1px 0px; }
.berrors { background: url("../images/icon-box-error.png") 10px 9px no-repeat scroll rgb(249, 229, 230); border-color: rgb(247, 199, 201); border-style: solid; border-width: 1px 1px 1px 4px; color: rgb(179, 105, 108); display: block; margin-bottom: 30px; padding: 10px 20px 10px 44px; margin-top: 30px; }
.berrors b { font-weight: 700; font-size: 13px; }
.berrors a { color: rgb(0, 0, 0); }
.addcomments { background: rgb(255, 255, 255); margin: 0px 1px; }
.addcomments .gbtitle { border-top: 1px solid rgb(230, 230, 230); }
.baseform { background: rgb(255, 255, 255); margin: 1px 1px 0px; }
.baseform, .mass_comments_action { padding: 1px; }
.fieldtr select, .textin, .f_textarea, .xfields textarea, .xprofile textarea, .xfields input, .xprofile input, .xfields select, .xprofile select { padding: 2px; font-family: Cuprum, sans-serif; border: 1px solid rgb(188, 192, 194); }
.f_textarea, .editor_button select { padding: 0px; }
.textin { padding: 2px; }
.navigation2 { padding: 12px 7px 5px 5px; margin: 5px 7px; background-color: rgb(255, 255, 255); background-image: -webkit-linear-gradient(top, rgb(250, 248, 248), rgb(255, 255, 255)); background-repeat: repeat-x; box-shadow: rgba(0, 0, 0, 0.07) 0px 1px 1px inset; border-radius: 7px 7px 0px 0px; }
.navigation2 .pages a, .navigation2 .pages span { padding: 1px 5px; color: rgb(155, 155, 127); margin: 0px 2px; border-radius: 8px; }
.navigation2 .pages span { background: rgb(237, 238, 236); }
.navigation2 .pages a:hover { background: rgb(117, 203, 64); color: rgb(255, 255, 255); text-decoration: none; }
.navigation2 .nparrow .prev span { background: url("../images/wbarrow.png") 7px 55% no-repeat scroll rgb(55, 120, 163); border-radius: 8px; color: rgb(255, 255, 255); padding: 3px 10px 2px 20px; text-shadow: rgb(37, 79, 107) 1px 1px 0px; }
.navigation2 .nparrow .next a { color: rgb(255, 255, 255); background: url("../images/warrow.png") 93% 55% no-repeat rgb(117, 203, 64); padding: 3px 18px 2px 10px; text-shadow: rgb(97, 169, 53) 1px 1px 0px; text-decoration: none; }
.next a { border-radius: 8px; }
.archlnk #dle_news_archive_link { text-align: center; padding: 5px 0px 10px; }
.archlnk #dle_news_archive_link a { color: rgb(195, 179, 169); font-size: 12px; }
.bvote { margin: 8px 8px 0px; padding-bottom: 10px; }
.bvote .allvote { background: url("../images/allvote.png") no-repeat; border: 0px; width: 19px; padding-top: 19px; position: absolute; top: 12px; right: 10px; }
.bvote .allvote:hover { cursor: pointer; background-position: 100% 0px; }
.bvote .vtitle { background: rgb(117, 203, 64); color: rgb(255, 255, 255); text-shadow: rgb(91, 158, 50) 1px 1px 0px; padding: 7px 10px; }
.bvote .vlist { margin: 10px 0px 0px; }
.bvote .vbtn { margin-top: 5px; border-radius: 6px 6px 0px 0px; }
.bvote .vbtn .fbutton { margin: 8px 8px 0px; border-radius: 5px; }
.bvote .vbtn .fbutton:hover { color: rgb(234, 53, 121); }
#poll_submit { clear: both !important; display: block !important; }
.clr::before, .clr::after { clear: both; content: ""; display: block; line-height: 0; }
.lcol, .rcol, form { display: inline; }
.lcol { float: left; }
.rcol { float: right; }
input, textarea, input:active, textarea:active, :focus { outline: none medium; }
.red { color: rgb(244, 102, 4); }
.searchbar, .lastcomm li, .archlnk .archives, .bvote .vtitle, .topnews .gbtitle .rcol, article .ahead h2, .related li a, .online, .offline, .bcomm .bcinfo li, .navigation .pages a, .navigation .pages span, .navigation .nparrow span, .navigation .nparrow a { border-radius: 3px; }
.grbtitle h2 { border-bottom: 1px dotted rgb(204, 204, 204); font: 700 14px / 14px "Open Sans Condensed", sans-serif; margin-bottom: 15px; padding-bottom: 15px; text-transform: uppercase; }
/* engine.css */
.mass_comments_action { display: none; }
#loading-layer { display: none; font-size: 11px; background: rgb(46, 131, 215); padding: 10px; text-align: center; color: rgb(255, 255, 255); }
.scriptcode, .title_quote, .quote, .title_spoiler, .text_spoiler { padding: 5px; background: rgb(249, 250, 250); border: 1px solid rgb(220, 231, 231); }
.title_quote, .title_spoiler { background: rgb(249, 250, 250); }
.scriptcode { color: rgb(0, 78, 141); text-align: left; font-family: "Courier New"; }
.title_spoiler { font-weight: bold; }
.text_spoiler { border-top: 0px; text-align: justify; }
.rating { color: rgb(117, 117, 117); font-size: 11px; font-family: tahoma; width: 85px; height: 16px; }
.unit-rating { list-style: none; margin: 0px; padding: 0px; width: 85px; height: 16px; position: relative; background-image: url("../dleimages/rating.png"); background-position: left top; background-repeat: repeat-x; }
.unit-rating li { text-indent: -90000px; padding: 0px; margin: 0px; float: left; }
.unit-rating li a { display: block; width: 17px; height: 16px; text-decoration: none; text-indent: -9000px; z-index: 17; position: absolute; padding: 0px; }
.unit-rating li a:hover { background-image: url("../dleimages/rating.png"); background-position: left center; z-index: 2; left: 0px; }
.unit-rating a.r1-unit { left: 0px; }
.unit-rating a.r1-unit:hover { width: 17px; }
.unit-rating a.r2-unit { left: 17px; }
.unit-rating a.r2-unit:hover { width: 34px; }
.unit-rating a.r3-unit { left: 34px; }
.unit-rating a.r3-unit:hover { width: 51px; }
.unit-rating a.r4-unit { left: 51px; }
.unit-rating a.r4-unit:hover { width: 68px; }
.unit-rating a.r5-unit { left: 68px; }
.unit-rating a.r5-unit:hover { width: 85px; }
.unit-rating li.current-rating { background-image: url("../dleimages/rating.png"); background-position: left bottom; position: absolute; height: 16px; display: block; text-indent: -9000px; z-index: 1; }
.bbcodes, .bbcodes_poll { border-width: 1px; padding: 4px 10px 3px; color: rgb(255, 255, 255); text-transform: uppercase; font-size: 12px; background-color: rgb(73, 175, 205); background-repeat: repeat-x; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); border-radius: 8px; }
.bbcodes:active, .bbcodes_poll.active { }
.bbcodes:hover, .bbcodes_poll:hover { color: rgb(224, 234, 241); cursor: pointer; background-color: rgb(47, 150, 180); }
.bbcodes_poll { width: 100px; }
.xfields textarea, .xprofile textarea { height: 186px; margin: 0px 1px 0px 0px; padding: 0px; }
.xfields input, .xprofile input { width: 250px; height: 14px; padding: 2px; }
.xfields_table td { vertical-align: top; }
.highslide-wrapper, .highslide-outline { background: rgb(255, 255, 255); }
.highslide-image { border: 2px solid rgb(255, 255, 255); }
.highslide-active-anchor { visibility: hidden; }
.highslide-active-anchor img { visibility: hidden; }
.highslide-dimming { background-color: black; }
.highslide-html { background-color: white; }
.highslide-loading { display: block; color: white; font-size: 9px; font-weight: bold; text-decoration: none; padding: 3px; border: 1px solid white; background-color: black; }
a.highslide-full-expand { background: url("../dleimages/fullexpand.gif") no-repeat; display: block; margin: 0px 10px 10px 0px; width: 34px; height: 34px; }
.highslide-display-block { display: block; }
.highslide-display-none { display: none; }
.highslide-caption { display: none; padding: 5px; background: white; }
.highslide-controls { width: 195px; height: 40px; background: url("../../../engine/classes/highslide/graphics/controlbar-black-border.gif") 0px -90px no-repeat; margin-right: 15px; margin-bottom: 10px; margin-top: 10px; }
.highslide-controls ul { position: relative; left: 15px; height: 40px; list-style: none; margin: 0px; padding: 0px; background: url("../../../engine/classes/highslide/graphics/controlbar-black-border.gif") 100% -90px no-repeat; }
.highslide-controls li { float: left; padding: 5px 0px; }
.highslide-controls a { background: url("../../../engine/classes/highslide/graphics/controlbar-black-border.gif"); display: block; float: left; height: 30px; width: 30px; outline: none; }
.highslide-controls a.disabled { cursor: default; }
.highslide-controls a span { display: none; }
.highslide-controls .highslide-previous a { background-position: 0px 0px; }
.highslide-controls .highslide-previous a:hover { background-position: 0px -30px; }
.highslide-controls .highslide-previous a.disabled { background-position: 0px -60px !important; }
.highslide-controls .highslide-play a { background-position: -30px 0px; }
.highslide-controls .highslide-play a:hover { background-position: -30px -30px; }
.highslide-controls .highslide-play a.disabled { background-position: -30px -60px !important; }
.highslide-controls .highslide-pause a { background-position: -60px 0px; }
.highslide-controls .highslide-pause a:hover { background-position: -60px -30px; }
.highslide-controls .highslide-next a { background-position: -90px 0px; }
.highslide-controls .highslide-next a:hover { background-position: -90px -30px; }
.highslide-controls .highslide-next a.disabled { background-position: -90px -60px !important; }
.highslide-controls .highslide-move a { background-position: -120px 0px; }
.highslide-controls .highslide-move a:hover { background-position: -120px -30px; }
.highslide-controls .highslide-full-expand a { background-position: -150px 0px; }
.highslide-controls .highslide-full-expand a:hover { background-position: -150px -30px; }
.highslide-controls .highslide-full-expand a.disabled { background-position: -150px -60px !important; }
.highslide-controls .highslide-close a { background-position: -180px 0px; }
.highslide-controls .highslide-close a:hover { background-position: -180px -30px; }
.ui-widget-overlay { background: rgb(0, 0, 0); opacity: 0.4; left: 0px; position: absolute; top: 0px; }
.ui-helper-clearfix::after { clear: both; content: "."; display: block; height: 0px; visibility: hidden; }
.ui-helper-clearfix { display: inline-block; }
* html .ui-helper-clearfix { height: 1%; }
.ui-helper-clearfix { display: block; }
.ui-icon { background-repeat: no-repeat; display: block; overflow: hidden; text-indent: -99999px; }
.ui-widget-header { color: rgb(42, 42, 42); }
.ui-widget-header a { color: rgb(42, 42, 42); }
.ui-widget-header .ui-icon { background-image: url("../images/ui-icons.png"); }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon { background-color: rgb(219, 20, 61); }
.ui-icon-close, .ui-icon-closethick { width: 23px; height: 24px; }
.ui-icon-close, .ui-icon-closethick:hover { background-position: 100% 0px; }
.ui-dialog { background: rgb(255, 255, 255); border: 1px solid rgb(223, 222, 219); overflow: hidden; padding: 0px; position: absolute; width: 300px; box-shadow: rgba(0, 0, 0, 0.3) 0px 0px 8px; }
.ui-widget input, .ui-widget textarea { font-family: Verdana; word-spacing: 0.1em; letter-spacing: 0px; line-height: 1.5em; font-size: 11px; color: rgb(0, 0, 0); background: url("../images/fields.png") repeat-x rgb(255, 255, 255); border: 1px solid rgb(188, 192, 194); }
.ui-dialog .ui-dialog-titlebar { padding: 10px 1em; position: relative; }
.ui-dialog .ui-dialog-title { float: left; margin: 0.1em 13px 0.3em 0px; font-weight: bold; }
.ui-dialog .ui-dialog-titlebar-close { height: 24px; margin: -10px 0px 0px; padding: 1px; position: absolute; right: 0.3em; top: 15px; width: 23px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; width: 23px; height: 24px; background: url("../images/delete2.png") 0px 0px no-repeat !important; }
.ui-dialog .ui-dialog-titlebar-close span:hover { background-position: 100% 0px; }
.ui-dialog .ui-dialog-content { background: none; border: 0px; overflow: hidden; padding: 13px 13px 0px; position: relative; zoom: 1; margin-bottom: 13px; }
.ui-dialog .ui-dialog-buttonpane { padding: 0px 6px 10px; text-align: left; }
.ui-dialog .ui-dialog-buttonpane button { cursor: pointer; float: right; line-height: 1.4em; margin: 0px 1px 0px 10px; overflow: visible; width: auto; }
.ui-button { border: 0px; background: none; cursor: pointer; }
.ui-button { background-color: rgb(255, 255, 255); background-repeat: repeat-x; border: 0px; border-radius: 15px; box-shadow: rgba(0, 0, 0, 0.17) 0px 1px 3px; color: rgb(137, 137, 137); font-size: 12px; padding: 4px 10px 3px; }
.ui-button:hover { background-position: 0px 5px; }
button.ui-button span { cursor: pointer; display: block; }
.ui-dialog .ui-resizable-se { bottom: 3px; height: 14px; right: 3px; width: 14px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
.ui-state-error { border: 1px solid rgb(205, 10, 10); color: rgb(205, 10, 10); background: 50% 50% repeat-x rgb(254, 241, 236) !important; }
.ui-autocomplete { position: absolute; cursor: default; }
* html .ui-autocomplete { width: 1px; }
.ui-menu { list-style: none; padding: 2px; margin: 0px; display: block; float: left; }
.ui-menu .ui-menu { margin-top: -3px; }
.ui-menu .ui-menu-item { margin: 0px; padding: 0px; zoom: 1; float: left; clear: left; width: 100%; }
.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 0.2em 0.4em; line-height: 1.5; zoom: 1; }
.ui-menu .ui-menu-item a.ui-state-hover, .ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
pre .comment, pre .template_comment, pre .diff .header, pre .doctype, pre .lisp .string, pre .javadoc { color: rgb(147, 161, 161); font-style: italic; }
.voteprogress { overflow: hidden; height: 15px; margin-bottom: 5px; background-color: rgb(247, 247, 247); background-image: -webkit-linear-gradient(top, rgb(245, 245, 245), rgb(249, 249, 249)); background-repeat: repeat-x; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px inset; border-radius: 4px; }
.voteprogress span { color: rgb(255, 255, 255); text-align: center; text-indent: -2000em; height: 15px; display: block; overflow: hidden; text-shadow: rgba(0, 0, 0, 0.25) 0px -1px 0px; background: -webkit-linear-gradient(top, rgb(20, 155, 223), rgb(4, 128, 190)) repeat-x rgb(14, 144, 210); }
.voteprogress .vote2 { background-color: rgb(221, 81, 76); background-image: -webkit-linear-gradient(top, rgb(238, 95, 91), rgb(196, 60, 53)); background-repeat: repeat-x; }
.voteprogress .vote3 { background-color: rgb(94, 185, 94); background-image: -webkit-linear-gradient(top, rgb(98, 196, 98), rgb(87, 169, 87)); background-repeat: repeat-x; }
.voteprogress .vote4 { background-color: rgb(75, 177, 207); background-image: -webkit-linear-gradient(top, rgb(91, 192, 222), rgb(51, 155, 185)); background-repeat: repeat-x; }
.voteprogress .vote5 { background-color: rgb(250, 167, 50); background-image: -webkit-linear-gradient(top, rgb(251, 180, 80), rgb(248, 148, 6)); background-repeat: repeat-x; }
.pollprogress { overflow: hidden; height: 18px; margin-bottom: 5px; background-color: rgb(247, 247, 247); background-image: -webkit-linear-gradient(top, rgb(245, 245, 245), rgb(249, 249, 249)); background-repeat: repeat-x; box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px inset; border-radius: 4px; }
.pollprogress span { color: rgb(255, 255, 255); height: 18px; display: block; overflow: hidden; font-size: 12px; text-align: center; text-shadow: rgba(0, 0, 0, 0.25) 0px -1px 0px; background: -webkit-linear-gradient(top, rgb(20, 155, 223), rgb(4, 128, 190)) repeat-x rgb(14, 144, 210); }
.pollprogress .poll2 { background-color: rgb(221, 81, 76); background-image: -webkit-linear-gradient(top, rgb(238, 95, 91), rgb(196, 60, 53)); background-repeat: repeat-x; }
.pollprogress .poll3 { background-color: rgb(94, 185, 94); background-image: -webkit-linear-gradient(top, rgb(98, 196, 98), rgb(87, 169, 87)); background-repeat: repeat-x; }
.pollprogress .poll4 { background-color: rgb(75, 177, 207); background-image: -webkit-linear-gradient(top, rgb(91, 192, 222), rgb(51, 155, 185)); background-repeat: repeat-x; }
.pollprogress .poll5 { background-color: rgb(250, 167, 50); background-image: -webkit-linear-gradient(top, rgb(251, 180, 80), rgb(248, 148, 6)); background-repeat: repeat-x; }
#b_spoiler { background-image: url("../bbcodes/spoiler.gif"); }
.bb-editor textarea { box-sizing: border-box; padding: 2px; border: 1px solid rgb(188, 192, 194); width: 100%; background: url("../images/fields.png") repeat-x rgb(255, 255, 255); }
.editorcomm .bb-editor { width: 465px; }
.editorcomm .bb-editor textarea { height: 156px; }
#marker-bar.show, #txtselect_marker.show { visibility: visible; transition: opacity 0.4s, visibility; opacity: 1; }
#share-popup { background: rgb(255, 255, 255); border: 1px solid rgb(170, 170, 170); border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 5px; position: absolute; width: 414px; display: none; z-index: 100; padding: 10px 0px; opacity: 0; transition: opacity 0.4s, visibility 0.1s linear 0.4s; }
#share-popup.show { display: block; transition: opacity 0.4s, visibility; opacity: 1; }
#share-popup .social { padding: 0px 0px 10px 17px; height: 40px; }
#share-popup .social p { padding-bottom: 10px; margin: 0px; font-weight: bold; }
#share-popup .social ul { list-style: none; margin: 0px; padding: 0px; }
#share-popup .social ul li { float: left; margin-right: 20px; padding-top: 2px; position: relative; }
#share-popup .social ul a { text-decoration: none; font-size: 11px; display: inline-block; color: rgb(170, 170, 170); padding-left: 25px; }
#share-popup .social ul a:hover { text-decoration: underline; color: rgb(234, 62, 38); }
#share-popup .social a span { cursor: pointer; width: 20px; height: 20px; background: url("../dleimages/social-icons.png") 20px 20px no-repeat; position: absolute; left: 0px; top: 0px; }
#share-popup .social .tw span { background-position: 0px -20px; }
#share-popup .social .tw:hover span { background-position: 0px 0px; }
#share-popup .social .fb span { background-position: -20px -20px; }
#share-popup .social .fb:hover span { background-position: -20px 0px; }
#share-popup .social .vk span { background-position: -40px -20px; }
#share-popup .social .vk:hover span { background-position: -40px 0px; }
#share-popup .social .gp span { background-position: -60px -20px; }
#share-popup .social .gp:hover span { background-position: -60px 0px; }
#share-popup .link { clear: both; border-top: 1px solid rgb(217, 217, 217); padding: 10px 5px 0px 10px; line-height: 1.2; overflow: hidden; margin: 0px 7px; }
#share-popup .link p { font-weight: bold; padding: 0px 0px 3px; margin: 0px; }
#share-popup .link span { color: rgb(153, 153, 153); font-size: 10px; display: block; padding-top: 3px; }
#share-popup .link a { display: block; }
/* default.css */
.post-entry { background: url("../images/dbl-dott.png") 0px bottom repeat-x scroll transparent; margin: 0px 0px 3px; overflow: hidden; padding: 0px 0px 9px; }
.post-entry h2 a { color: rgb(62, 59, 59); }
.post-entry h2 { margin: 0px 0px 16px; }
.post-info .post-comments { background: url("../images/comments.png") 0px 0px no-repeat scroll transparent; height: 35px; margin: -5px auto 10px; padding: 22px 0px 0px 47px; width: 35px; }
.post-info { border-bottom: 1px solid rgb(242, 242, 242); border-top: 1px solid rgb(242, 242, 242); float: left; margin-bottom: 26px; padding: 14px 0px 2px; width: 140px; }
.post-body { float: right; width: 500px; }
.post-image { border: 1px solid rgb(240, 240, 240); height: 208px; margin: 0px 0px -1px; overflow: hidden; position: relative; }
.post-image a { border: 4px solid rgb(255, 255, 255); display: block; height: 200px; overflow: hidden; width: 500px; }
.post-details { border-bottom: 1px solid rgb(240, 240, 240); border-top: 1px solid rgb(240, 240, 240); margin: 0px 0px 2px; padding: 13px 0px 11px; }
.post-details .post-tags { background: url("../images/tags.png") 0px center no-repeat scroll transparent; padding: 3px 20px 3px 22px; }
.post { padding: 1px 0px 8px; }
.alignleft, .img-frame.left { float: left; }
.goto-post .comments { float: left; margin: 0px 0px 0px 5px; padding: 0px 0px 0px 7px; }
table { border-collapse: collapse; border-spacing: 0px; }
a, #top-bar a:hover, #logo a:hover, #recent-news-block .entry-title a:hover, #featured-posts-block .entry-title a:hover, .category-block .entry-title a:hover, .category-block-summary .entry-title a:hover, .tz_tweet_widget a:hover, .xoxo a:hover, .tz_tab_widget #tab-items li a:hover, .tz_tab_widget #tab-items li.ui-tabs-selected a, .tz_tab_widget #tab-items li.ui-state-active a, .tz_tab_widget .entry-title a:hover, .widget ul li a:hover, #related-posts .entry-title a:hover, p.breadcrumb, li.bypostauthor cite, li.bypostauthor cite a, li.comment cite a:hover, #archive-posts .post-container .entry-title a:hover, #single-column-right ul.share li a:hover, #single-column-right ul.rss li a:hover, #secondary-nav ul li.current_page_item a, #secondary-nav ul li.current_page_item li a:hover, #secondary-nav ul li.current_menu_item a, #secondary-nav ul li.current_menu_item a:hover { color: rgb(244, 102, 4); }
.widget_search #searchsubmit, .tab-tags a:hover, #commentform input#submit, #contactForm button, .coda-nav ul li a.current { color: rgb(249, 156, 28); }

/* ######################################################################
   2. КОЛОНКИ (раніше вбудований <style> у main.tpl)
   ###################################################################### */

#primary { float: left; } #sidebar { float: right; }

/* ######################################################################
   3. ADAPTIVE — мобільна адаптація
   ###################################################################### */

/* ==========================================================
   Адаптивні стилі для шаблону study (pidruchnyk.com.ua)
   ПК (>1040px) — без змін. Нижче — планшети й телефони.
   ========================================================== */

.m-logo { display: none; }

/* Відео/книги з iframe ніколи не ширші за колонку */
.acontent iframe, .acon-text iframe, .tilo-book iframe { max-width: 100%; }
.acon-text img { max-width: 100%; height: auto; }

@media (max-width: 1040px) {

	html { -webkit-text-size-adjust: 100%; }
	body { font-size: 14px; line-height: 1.45; background-size: auto; }
	.panelx1 { background: none; }

	#wrapper { width: auto !important; max-width: 100%; margin: 0 8px; padding-top: 8px; }

	/* ---------- Шапка ---------- */
	#header {
		height: auto; background: #fff !important;
		border-radius: 12px 12px 0 0; padding: 12px 12px 0;
		display: flex; flex-direction: column;
	}
	#header > div { position: static !important; width: auto !important; height: auto !important; left: auto; top: auto; padding: 0 !important; }

	.m-logo {
		display: block; order: 1; text-decoration: none; margin-bottom: 8px;
		font: 700 22px/1.1 Arial, sans-serif; color: var(--accent); text-transform: uppercase; letter-spacing: .5px;
	}
	.m-logo span { display: block; font: 400 13px/1.4 Arial, sans-serif; color: #777; text-transform: none; letter-spacing: 0; }

	.study_2 { display: none; }                 /* соцкнопки */
	.study_3 { order: 2; }                      /* пошук */
	.study_4 { order: 3; margin-top: 10px; }    /* меню класів */
	.study_5 { order: 4; margin-top: 10px; }    /* закладки / замовити */
	.study_1 { order: 5; margin: 12px 0 0; color: #555; font-size: 13px; } /* SEO-текст */
	.study_6 { order: 6; }                      /* блок «дошка» */

	/* пошук */
	.study_3 .searchbar { float: none; }
	#cssmenu > ul > li { margin: 0 !important; }
	#cssmenu span { display: block; }
	.searchbar {
		width: auto; height: 44px; margin: 0; display: flex; align-items: center;
		background: #f2f2f2; border: 1px solid #ddd; border-radius: 22px;
	}
	.searchbar input[type="text"] {
		flex: 1; float: none; width: auto; margin: 0; padding: 0 16px; height: 42px;
		font-size: 16px; color: #333; font-style: normal; min-width: 0;
	}
	.searchbar input[type="image"] { float: none; margin: 0 12px 0 0; }

	/* меню класів — сітка кнопок */
	#cssmenu { width: auto; height: auto; background: none; border-radius: 0; }
	#cssmenu > ul { float: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
	#cssmenu > ul > li { float: none; }
	#cssmenu > ul > li > a,
	#cssmenu > ul > li:first-child > a,
	#cssmenu > ul > li:last-child > a {
		display: block; text-align: center; padding: 0 4px; line-height: 40px; font-size: 14px;
		border-radius: 8px; background: #2b2b31;
	}
	#cssmenu > ul > li:first-child { grid-column: 1 / -1; }
	#cssmenu > ul > li:hover:after { display: none; }

	/* блок «дошка» з випадковими підручниками */
	#header > .study_6 {
		margin: 12px -12px 0; padding: 14px 12px !important;
		background: var(--brand); color: #fff;
	}
	.study_6 .category-image { float: left; margin: 0 12px 6px 0; }
	.study_6 .category-image img { width: 90px; height: auto; }
	.study_6 .category-links { width: auto !important; float: none; }
	.study_6 .category-links ul { overflow: hidden; }
	.study_6 .main-headline { display: block; font-size: 16px; line-height: 1.3; color: #fff; margin-bottom: 6px; }
	.study_6 li { margin: 0 0 6px; }
	.study_6 .headline-small { font-size: 14px; line-height: 1.35; }
	.study_6 > .home-widget > ul:last-child { clear: both; }

	/* ---------- Контент ---------- */
	#content { padding: 0 12px; }
	#content #content { padding: 0; }
	#content #primary, #content #sidebar { float: none !important; width: auto !important; }
	#primary { overflow: hidden; }
	#sidebar { margin: 16px -12px 0; border-radius: 0; }
	#sidebar-narrow-container { display: none; }

	/* головна: два стовпці карток */
	#category-blocks .category-block { float: none; width: auto; }
	.category-block .post-thumb img { width: 90px; height: auto; }
	.category-block .entry-title, .category-block .entry-title a { font-size: 15px; }

	/* список книг у категорії */
	.post-entry h2 { font-size: 18px; line-height: 1.3; margin-bottom: 10px; }
	.post-image { height: auto; border: 0; float: left; margin: 0 12px 8px 0; }
	.post-image a { width: auto; height: auto; border: 0; }
	.post-image img { width: 110px; height: auto; display: block; }
	.post-details { border: 0; padding: 0 0 6px; }
	.post-details2 { margin: 0; }

	/* сторінка книги */
	article .ahead h1 { font-size: 20px; line-height: 1.3; float: none; }
	.acon-text { font-size: 15px; }
	.tilo-book { margin: 20px 0 10px; }
	.tilo-book iframe {
		width: 100% !important; height: auto !important; aspect-ratio: 11 / 15;
		max-height: 85vh;
	}
	#related-posts { float: none; width: auto; height: auto; }
	#related-posts ul li { float: none; }

	/* меню предметів у сайдбарі */
	.bnavi { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
	.bnavi li a { font-size: 14px; padding: 11px 0 9px 15px; border-top: 1px dotted #ddd; }
	.bnavi li:nth-child(2) a { border-top: 0; }

	/* ---------- Підвал ---------- */
	.container2 { width: auto; padding: 0 12px; }
	.two-thirds.column, .one-third.column { float: none; display: block; width: auto; }
	#footer-menu { margin: 0; }
	#footer-menu li { padding-left: 0; background: none; }

	/* дрібниці */
	img { max-width: 100%; }
	input, select, textarea { max-width: 100%; }
	table { max-width: 100%; }
	/* доповнення після перевірки на живих сторінках */
	.copyrights, .copyrights p { text-align: left !important; }
	#sidebar:empty { display: none; }
	.post-body, .post-info { float: none !important; width: auto !important; }
	.post-body { overflow: hidden; }
	.post-entry { padding-bottom: 12px; margin-bottom: 12px; }
	.post-entry .post-info { display: none; }
	.post-entry h2 { margin-bottom: 8px; }
	.acon-text img { max-width: 42% !important; height: auto !important; margin: 0 0 10px 12px; }
	.tilo-book { clear: both; }
	.tilo-zag { font-size: 17px; letter-spacing: 1px; }
	#mc_signup::before {
		content: "Підручники за предметами"; display: block;
		font: 700 16px/1.3 Arial, sans-serif; color: #333; padding: 4px 3px 8px;
	}
	[id^="admixer_"], ins.adsbygoogle { max-width: 100% !important; overflow: hidden; }
}

@media (min-width: 600px) and (max-width: 1040px) {
	#cssmenu > ul { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 480px) {
	.bnavi { grid-template-columns: 1fr; }
	.bnavi li:nth-child(2) a { border-top: 1px dotted #ddd; }
	#cssmenu > ul { grid-template-columns: repeat(4, 1fr); gap: 5px; }
	#cssmenu > ul > li > a,
	#cssmenu > ul > li:first-child > a,
	#cssmenu > ul > li:last-child > a { font-size: 13px; line-height: 38px; }
}

/* ######################################################################
   4. PIDR — компоненти сайту: книга, картки, кнопки, діалоги
   ###################################################################### */

/* ==========================================================
   pidruchnyk.com.ua — сторінка книги, закладки, шапка
   ========================================================== */

.m-only { display: none; }
@media (max-width: 1040px) { .m-only { display: block; } }

/* ---------- Шапка: кнопки замість форми входу ---------- */
.hdr-actions { padding: 34px 18px 0 22px; display: flex; flex-direction: column; gap: 10px; }
.ha-btn {
	display: block; padding: 10px 14px; border-radius: 10px; text-decoration: none !important;
	font: 700 14px/1.2 Arial, sans-serif; color: #fff !important; background: rgba(255,255,255,.14);
	border: 1px solid rgba(255,255,255,.28); transition: background .15s;
}
.ha-btn:hover { background: rgba(255,255,255,.26); }
.ha-btn b { display: inline-block; min-width: 20px; margin-left: 4px; padding: 1px 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; text-align: center; }
.ha-order { background: var(--accent); border-color: var(--accent); }
.ha-order:hover { background: var(--accent-hover); }

.board-label { font: 700 11px/1 Arial, sans-serif; letter-spacing: 1px; text-transform: uppercase; color: #ffd27a; margin: 0 0 8px; }

@media (max-width: 1040px) {
	.hdr-actions { padding: 0; flex-direction: row; flex-wrap: wrap; gap: 6px; }
	.ha-btn { flex: 1 1 auto; text-align: center; color: #333 !important; background: #f2f2f2; border-color: #e2e2e2; font-size: 13px; padding: 10px 8px; }
	.ha-btn:hover { background: #e8e8e8; }
	.ha-order { background: var(--accent); border-color: var(--accent); color: #fff !important; flex-basis: 100%; }
	.ha-order:hover { background: var(--accent-hover); }
	.board-label { font-size: 12px; }
}

/* ---------- Хлібні крихти ---------- */
.crumbs { font-size: 13px; color: #888; margin: 4px 0 12px; line-height: 1.5; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { margin: 0 4px; color: #bbb; }
.crumbs b { font-weight: normal; color: #666; }

/* ---------- Сторінка книги ---------- */
.book { font-size: 15px; line-height: 1.5; color: #333; }
.book-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.book-head h1 { flex: 1; margin: 0; font: 700 24px/1.25 Arial, sans-serif; color: #222; }
.book-tools a { font-size: 13px; color: #999; }

.book-top { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 18px; }
.book-cover { flex: 0 0 200px; }
.book-cover img { display: block; width: 200px; height: auto; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.book-info { flex: 1; min-width: 0; }

.book-props { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.book-props th, .book-props td { text-align: left; padding: 8px 0; border-bottom: 1px solid #eee; vertical-align: top; font-size: 14px; }
.book-props th { width: 140px; color: #888; font-weight: normal; padding-right: 10px; }
.book-props td a { color: var(--accent); }

.book-rating { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.book-rating .lbl, .book-share .lbl { font-size: 13px; color: #888; }

.book-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.bbtn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 11px 18px; border-radius: 10px; border: 2px solid transparent; cursor: pointer;
	font: 700 15px/1.2 Arial, sans-serif; text-decoration: none !important; transition: .15s;
}
.bbtn-read { background: var(--brand); color: #fff !important; }
.bbtn-read:hover { background: var(--brand-hover); }
.bbtn-dl { background: var(--accent); color: #fff !important; }
.bbtn-dl:hover { background: var(--accent-hover); }
.bbtn-fav { background: #fff; color: #333; border-color: #ddd; }
.bbtn-fav:hover { border-color: var(--accent); }
.bbtn-fav.on { color: var(--accent); border-color: var(--accent); background: #fff6ef; }

.book-share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sh { font-size: 13px; padding: 5px 10px; border-radius: 14px; text-decoration: none !important; color: #fff !important; }
.sh-tg { background: #2aa3df; } .sh-vb { background: #7360f2; } .sh-fb { background: #1877f2; } .sh-cp { background: #888; }
.book-share-bottom { margin: 16px 0 6px; }
.sh:hover { opacity: .85; }

.book .acon-text { margin: 0 0 16px; font-size: 15px; line-height: 1.55; }
.book-gdz { background: #eef7ee; border: 1px solid #cfe7cf; border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; }
.book-gdz a { font-weight: bold; }

.book .tilo-book { display: block; text-align: center; margin: 24px auto 20px; }
.book .tilo-book.empty { display: none; }
.book .tilo-zag { text-align: center; margin: 22px 0 12px; font: 700 18px/1.3 Arial, sans-serif; letter-spacing: 1px; text-transform: uppercase; color: var(--brand); }
.book .tilo-book iframe { display: block; margin: 0 auto 10px; max-width: 100%; border-radius: 6px; background: #f4f4f4; }

.book-files { background: #fafafa; border: 1px solid #eee; border-radius: 10px; padding: 14px 16px; margin: 0 0 16px; }
.book-files h3 { margin: 0 0 8px; font: 700 15px/1.3 Arial, sans-serif; }
.book-files ul { margin: 0; padding: 0; list-style: none; }
.book-files li { padding: 6px 0; border-bottom: 1px dashed #e5e5e5; word-break: break-word; }
.book-files li:last-child { border-bottom: 0; }
.book-files a { color: var(--accent); font-weight: bold; }
.book-files .src, .book-files .hint { margin: 8px 0 0; font-size: 12px; color: #999; }

.gdz-links:empty, .gdz-links:not(:has(a)) { display: none; }
.gdz-links a { display: inline-block; margin: 0 6px 6px 0; padding: 6px 10px; border-radius: 8px; background: #eef7ee; color: var(--brand) !important; font-size: 13px; font-weight: bold; text-decoration: none; }

.complian { margin: 10px 0 14px; }
.complian a { display: inline-block; padding: 7px 14px; border-radius: 15px; background: #e53935; color: #fff !important; font-size: 13px; text-decoration: none; }

.ad-m { margin: 12px 0; }
/* резерв місця під мобільну рекламу — щоб контент не стрибав (CLS) */
@media (max-width: 1040px) { .ad-m { min-height: 250px; } }

/* ---------- Нещодавно переглянуті + панель закладок ---------- */
.recent-box { clear: both; margin: 20px 0; }
.recent-box h3, #related-posts.related-similar h3 { font: 700 16px/1.3 Arial, sans-serif; margin: 0 0 10px; color: #333; text-transform: uppercase; }
.recent-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.recent-list .fav-item { display: block; }
.recent-list .fav-img img { width: 100%; height: auto; aspect-ratio: 3/4; object-fit: cover; border-radius: 6px; display: block; }
.recent-list .fav-title { display: block; font-size: 12px; line-height: 1.3; margin-top: 4px; color: #333; text-decoration: none; }

html.fav-open { overflow: hidden; }
.fav-panel { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding: 60px 12px 12px; }
.fav-panel[hidden] { display: none; }
.fav-box { background: #fff; width: 100%; max-width: 560px; max-height: calc(100vh - 80px); display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.fav-tabs { display: flex; border-bottom: 1px solid #eee; }
.fav-tabs button { flex: 1; padding: 14px 10px; background: none; border: 0; font: 700 14px/1 Arial, sans-serif; color: #888; cursor: pointer; border-bottom: 3px solid transparent; }
.fav-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.fav-tabs .fav-close { flex: 0 0 52px; font-size: 18px; color: #999; }
.fav-list { overflow-y: auto; padding: 8px 14px 14px; }
.fav-list .fav-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.fav-list .fav-img { flex: 0 0 48px; }
.fav-list .fav-img img { width: 48px; height: 64px; object-fit: cover; border-radius: 4px; display: block; }
.fav-list .fav-title { flex: 1; color: #333; font-size: 14px; font-weight: bold; text-decoration: none; line-height: 1.3; }
.fav-list .fav-title:hover { color: var(--accent); }
.fav-del { background: none; border: 0; color: #bbb; font-size: 16px; cursor: pointer; padding: 6px; }
.fav-del:hover { color: #e53935; }
.fav-empty { color: #888; text-align: center; padding: 30px 10px; font-size: 14px; }

/* ---------- Вкладки читалок і джерела скачування ---------- */
.reader-tabs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 0 0 6px; }
.reader-tabs[hidden] { display: none; }
.rt-lbl { font-size: 13px; color: #888; margin-right: 4px; }
.reader-tabs button { padding: 8px 14px; border-radius: 18px; border: 1px solid #ddd; background: #fff; font: 700 13px/1 Arial, sans-serif; color: #555; cursor: pointer; }
.reader-tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.reader[hidden] { display: none; }
.book-files h3 { font-size: 17px; margin-bottom: 10px; }
.dl-src { padding: 10px 0; border-top: 1px solid #eee; }
.dl-src:first-of-type { border-top: 0; padding-top: 0; }
.dl-name { font: 700 14px/1.3 Arial, sans-serif; color: #333; margin-bottom: 6px; }
.dl-name small { font-weight: normal; color: #999; margin-left: 4px; }
.dl-src ul { display: flex; flex-wrap: wrap; gap: 6px; }
.book-files .dl-src li { padding: 0; border: 0; }
.dl-src li a { display: inline-block; padding: 8px 12px; border-radius: 8px; background: #fff; border: 1px solid #f3c7a5; font-size: 13px; text-decoration: none; }
.dl-src li a:hover { background: #fff6ef; }

/* ---------- Попередні видання ---------- */
.prev-ed { background: #f4f8ff; border: 1px solid #d6e3f7; border-radius: 10px; padding: 14px 16px; margin: 0 0 16px; }
.prev-ed h3 { margin: 0 0 10px; font: 700 17px/1.3 Arial, sans-serif; color: #2b4a7a; }
.prev-ed-body { font-size: 14px; }
.prev-ed-body br { display: none; }
.prev-ed-body a { display: inline-block; margin: 0 6px 6px 0; padding: 8px 12px; border-radius: 8px; background: #fff; border: 1px solid #c9d9f2; color: #2b4a7a !important; font-weight: bold; text-decoration: none; }
.prev-ed-body a:hover { background: #e9f1ff; }

/* ---------- Дві колонки карток на телефоні ---------- */
@media (max-width: 1040px) {
	#category-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
	#category-blocks .category-block { display: contents; }
	#category-blocks .post-container { margin: 0; padding: 0; background: none; text-align: center; }
	#category-blocks .post-thumb img {
		float: none; display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover;
		margin: 0 0 6px; padding: 0; border: 0; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.15);
	}
	#category-blocks .entry-title, #category-blocks .entry-title a { font-size: 14px; line-height: 1.3; }
	#category-blocks .entry-meta { font-size: 12px; }

	.post-entry {
		display: inline-flex; flex-direction: column; vertical-align: top;
		width: calc(50% - 10px); margin: 0 4px 16px; padding: 0; background: none; text-align: center;
	}
	.post-entry h2 { order: 2; font-size: 14px; line-height: 1.3; margin: 0 0 4px; }
	.post-entry .post-body { order: 1; overflow: visible; }
	.post-entry .post-image { float: none; margin: 0 0 6px; }
	.post-entry .post-image img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
	.post-entry .post-details { order: 3; }
	.post-entry .post-tags { padding: 0; background: none; }
	.post-entry .post-tags a { margin: 0 2px 4px; padding: 3px 6px; font-size: 11px; }
}

/* ---------- Телефони ---------- */
@media (max-width: 1040px) {
	.book-head h1 { font-size: 20px; }
	.book-top { gap: 14px; }
	.book-cover { flex: 0 0 110px; }
	.book-cover img { width: 110px; }
	.book-props th { width: auto; }
	.book-props th, .book-props td { font-size: 13px; padding: 6px 0; }
	.bbtn { flex: 1 1 auto; }
	.recent-list { grid-template-columns: repeat(3, 1fr); }
	.fav-panel { padding: 20px 8px 8px; }
	body:has(#book) #header > .study_6 { display: none; }
	.ha-recent { font-size: 0 !important; }
	.ha-recent::after { content: "🕘 Переглянуті"; font-size: 13px; }
	.ha-fav, .ha-recent { flex: 1 1 40%; }
}
@media (max-width: 560px) {
	.book-top { flex-wrap: wrap; }
	.book-info { flex-basis: 100%; }
	.book-cover { flex: 0 0 auto; margin: 0 auto; }
	.book-cover img { width: 140px; }
	.book-btns .bbtn { flex: 1 1 100%; }
}

/* ---------- зміст підручника ---------- */
.book-toc { margin: 22px 0; padding: 16px 18px; background: #f7f8fa; border: 1px solid #e3e6ea; border-radius: 12px; }
.book-toc h2 { margin: 0 0 4px; font: 700 20px/1.3 Arial, sans-serif; color: #222; }
.toc-hint { margin: 0 0 10px; color: #666; font-size: 13px; }
.toc-list { position: relative; }
.toc-list.collapsed { max-height: 290px; overflow: hidden; }
.toc-list.collapsed::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: linear-gradient(rgba(247,248,250,0), #f7f8fa); }
.toc-sec { margin: 14px 0 4px; font: 700 14px/1.3 Arial, sans-serif; color: var(--brand); text-transform: uppercase; letter-spacing: .3px; }
.toc-sec:first-child { margin-top: 0; }
.toc-i { display: flex; gap: 10px; align-items: baseline; padding: 7px 8px; margin: 0 -8px; border-radius: 8px; color: #1a4f8b; text-decoration: none; font-size: 15px; line-height: 1.35; }
.toc-i:hover { background: #e9eef5; }
.toc-i.on { background: #fff1e6; color: #b04a00; }
.toc-t { flex: 1; }
.toc-p { flex: none; color: #888; font-size: 13px; min-width: 28px; text-align: right; }
.toc-plain { padding: 6px 0; color: #444; }
.toc-more { margin-top: 10px; padding: 9px 16px; border: 1px solid #cfd6de; border-radius: 20px; background: #fff; cursor: pointer; font-size: 14px; color: #1a4f8b; }
.toc-now { margin: 0 0 10px; padding: 8px 12px; background: #fff1e6; border-radius: 8px; font-size: 14px; }
.toc-now a { margin-left: 8px; white-space: nowrap; }
.bbtn-toc { background: #eef3f9; color: #1a4f8b; }
@media (max-width: 1040px) {
	.book-toc { padding: 12px; margin: 16px 0; }
	.book-toc h2 { font-size: 18px; }
	.toc-i { font-size: 14px; padding: 8px; }
}

.pdf-fs { display: block; margin: 0 auto 10px; padding: 9px 18px; border: 1px solid #cfd6de; border-radius: 20px; background: #fff; color: #1a4f8b; cursor: pointer; font-size: 15px; font-weight: 600; }
.pdf-fs:hover { background: #eef3f9; }

.bbtn-resume { background: #fff1e6; color: #b04a00; }

.toc-raw { font-size: 14px; line-height: 1.6; color: #444; }
.js .toc-raw { display: none; }

.js ul[data-relpool] > li { display: none; }
.js ul[data-relpool] > li.rel-on { display: block; }
html:not(.js) ul[data-relpool] > li:nth-child(n+9) { display: none; }

/* ---------- зміст: вкладки частин ---------- */
.toc-tabs { display: flex; gap: 6px; margin: 6px 0 12px; flex-wrap: wrap; }
.toc-tabs button { padding: 8px 16px; border: 1px solid #cfd6de; border-radius: 20px; background: #fff; color: #1a4f8b; font: 600 14px/1.2 Arial, sans-serif; cursor: pointer; }
.toc-tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.toc-pane[hidden] { display: none; }

/* ---------- перехід на сторінку / вправу ---------- */
.pgjump { margin: 12px 0 4px; padding: 10px 12px; background: #f7f8fa; border: 1px solid #e3e6ea; border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.pgjump-pg, .pgjump-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pgjump label { font: 600 14px/1.2 Arial, sans-serif; color: var(--brand); min-width: 150px; }
.pgjump input { width: 90px; padding: 8px 10px; border: 1px solid #cfd6de; border-radius: 8px; font-size: 16px; }
.pgjump select { padding: 8px 10px; border: 1px solid #cfd6de; border-radius: 8px; font-size: 15px; background: #fff; }
.pgjump button { padding: 8px 16px; border: 0; border-radius: 20px; background: var(--brand); color: #fff; font: 600 14px/1.2 Arial, sans-serif; cursor: pointer; }
.pgjump button:hover { background: var(--brand-hover); }
.pgjump-msg { color: #b04a00; font-size: 13px; }
@media (max-width: 600px) { .pgjump label { min-width: 0; width: 100%; } }
.pgjump-pg[hidden], .pgjump-ex[hidden] { display: none; }

/* ---------- Вікна DLE (скарга тощо) під дизайн сайту, 01.10.2026 ---------- */
.ui-widget-overlay{position:fixed;inset:0;background:rgba(20,30,27,.45);z-index:10040}
.ui-dialog{z-index:10050 !important;background:#fff;border:0;border-radius:14px;box-shadow:0 14px 44px rgba(0,0,0,.28);padding:0;max-width:calc(100vw - 24px);font:15px/1.45 Arial,sans-serif;color:#333;overflow:hidden;height:auto !important}
.ui-dialog .ui-dialog-titlebar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px 14px 20px;border:0;border-bottom:1px solid #eee;background:#f7f9f8;font-weight:700;font-size:16px;color:var(--brand);cursor:move}
.ui-dialog .ui-dialog-title{float:none;margin:0}
.ui-dialog .ui-dialog-titlebar-close{position:relative;flex:0 0 32px;width:32px;height:32px;margin:0;padding:0;border:0;border-radius:8px;background:#eceeed;cursor:pointer;font-size:0;color:transparent;right:auto;top:auto}
.ui-dialog .ui-dialog-titlebar-close:hover{background:#e2e5e4}
.ui-dialog .ui-dialog-titlebar-close:before{content:"\2715";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:15px;color:#555}
.ui-dialog .ui-dialog-titlebar-close *{display:none !important}
.ui-dialog .ui-dialog-content{height:auto !important;min-height:0 !important;max-height:70vh;padding:18px 20px;background:#fff;color:#333;overflow:auto}
.ui-dialog textarea,.ui-dialog input[type=text],.ui-dialog input[type=email]{display:block;width:100% !important;box-sizing:border-box;margin:8px 0 0;border:1px solid #d9dedc;border-radius:10px;padding:10px 12px;font:15px/1.4 Arial,sans-serif;color:#333;background:#fff}
.ui-dialog textarea{min-height:120px;resize:vertical}
.ui-dialog textarea:focus,.ui-dialog input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(47,93,80,.15)}
.ui-dialog .ui-state-error{border-color:#e53935 !important;box-shadow:0 0 0 3px rgba(229,57,53,.12) !important}
.ui-dialog .ui-dialog-buttonpane{margin:0;padding:12px 20px 18px;border:0;border-top:1px solid #eee;background:#fff}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:none;display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.ui-dialog .ui-dialog-buttonpane button{margin:0;border:2px solid #ddd;background:#fff;color:#333;border-radius:10px;padding:9px 18px;font:700 14px Arial,sans-serif;cursor:pointer;box-shadow:none;text-shadow:none}
.ui-dialog .ui-dialog-buttonpane button:hover{border-color:#bbb}
.ui-dialog .ui-dialog-buttonpane button:last-child{background:var(--brand);border-color:var(--brand);color:#fff}
.ui-dialog .ui-dialog-buttonpane button:last-child:hover{background:#264c41;border-color:#264c41}
@media (max-width:600px){.ui-dialog{left:12px !important;right:12px !important;width:auto !important}.ui-dialog .ui-dialog-buttonpane button{flex:1}}
/* кнопка «Скарги і пропозиції» */
.complian{margin:14px 0}
.complian a{display:inline-flex;align-items:center;gap:6px;background:#fff !important;color:#6b6b6b !important;border:1px solid #ddd !important;border-radius:10px !important;padding:8px 14px !important;font:13px/1.2 Arial,sans-serif !important;text-decoration:none !important;transition:color .15s,border-color .15s,background .15s}
.complian a:hover{color:#c62828 !important;border-color:#ef9a9a !important;background:#fff6f6 !important}

/* H1 на головній і в категоріях (SEO), 01.10.2026 */
.nh-h1{margin:0;padding:14px 12px 0;background:#fff;font:700 20px/1.25 Arial,sans-serif;color:#222}
.nh-h1 + .nh-intro{padding-top:6px}
@media (max-width:600px){.nh-h1{font-size:18px}}

/* ---------- Картки книг (головна, сторінки класів) ---------- */
.category-block .post-container{background:#fff none;border:1px solid #ebe7de;border-radius:12px;padding:10px;margin:0 0 12px;box-shadow:0 1px 2px rgba(0,0,0,.04);transition:box-shadow .2s,transform .2s}
.category-block .post-container:hover{box-shadow:0 6px 18px rgba(0,0,0,.09);transform:translateY(-2px)}
.category-block .post-container img.wp-post-image{padding:0;border:0;border-radius:6px;background:none;box-shadow:0 1px 4px rgba(0,0,0,.18)}
@media (min-width:1041px){#category-blocks .category-block{width:calc(50% - 8px)}}
@media (max-width:1040px){.category-block .post-container{padding:6px}}

.post-entry{box-sizing:border-box;background:#fff none;border:1px solid #ebe7de;border-radius:12px;box-shadow:0 1px 2px rgba(0,0,0,.04);transition:box-shadow .2s,transform .2s}
.post-entry:hover{box-shadow:0 6px 18px rgba(0,0,0,.09);transform:translateY(-2px)}
@media (max-width:1040px){.post-entry{padding:6px}}
@media (min-width:1041px){
.post-entry{display:inline-flex;flex-direction:column;vertical-align:top;width:calc(25% - 12px);margin:0 6px 14px;padding:10px;text-align:center}
.post-entry h2{order:2;font-size:14px;line-height:1.3;margin:0 0 6px}
.post-entry .post-info{display:none}
.post-entry .post-body{order:1;float:none;width:auto;overflow:visible}
.post-entry .post-image{float:none;height:auto;border:0;margin:0 0 8px}
.post-entry .post-image a{width:auto;height:auto;border:0;display:block}
.post-entry .post-image img{width:100%;height:auto;aspect-ratio:3/4;object-fit:cover;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.18);display:block}
.post-entry .post-details{order:3}
.post-entry .post-tags{padding:0;background:none}
.post-entry .post-tags a{margin:0 2px 4px;padding:3px 6px;font-size:11px}
}
.post-entry .post-body{display:contents}
.post-entry .post-image{order:1}
.post-entry h2{order:2}
.post-entry h2 a{font-weight:700;color:#222}
.post-entry .post-details{order:3;border:0;padding:2px 0 0;margin:0}
.post-entry .post-details2{order:4;margin:0}
.post-entry .post-tags a{background:#eef3f1;color:var(--brand) !important;border-radius:6px;font-weight:600}
.post-entry .post-tags a:hover{background:var(--brand);color:#fff !important}
/* автори (теги) в картках сховані — вони є на сторінці книги */
.post-entry .post-details,.post-entry .post-details2{display:none}

/* ######################################################################
   5. HEADER — шапка, футер, темна тема
   ###################################################################### */

/* ==========================================================
   pidruchnyk.com.ua — нова шапка (v1)
   ========================================================== */
body { background: #f2efe8 !important; }
.panelx1 { background: none !important; }
#wrapper { padding-top: 14px; }

.nh {
	background: #fff; border-radius: 16px 16px 0 0; padding: 16px 20px 0;
	box-shadow: 0 1px 0 #ece7dc; position: relative; z-index: 5;
}
.nh-top { display: flex; align-items: center; gap: 18px; }

.nh-logo { display: flex; align-items: center; gap: 10px; text-decoration: none !important; flex: 0 0 auto; }
.nh-logo-ico {
	width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
	background: var(--brand); color: #fff;
}
.nh-logo-txt b { display: block; font: 800 20px/1.1 Arial, sans-serif; color: #222; letter-spacing: -.2px; }
.nh-logo-txt b::first-letter { color: var(--accent); }
.nh-logo-txt small { display: block; font: 400 12px/1.5 Arial, sans-serif; color: #8a8a8a; margin-top: 2px; }

.nh-search { flex: 1; display: flex; align-items: center; height: 46px; background: #f4f4f2; border: 1px solid #e4e1da; border-radius: 23px; padding: 0 6px 0 18px; transition: border-color .15s, box-shadow .15s; }
.nh-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,93,80,.12); background: #fff; }
.nh-search input[type="text"] { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; font: 15px/1 Arial, sans-serif; color: #222; height: 44px; }
.nh-search input::placeholder { color: #9a9a9a; }
.nh-search button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; }
.nh-search button:hover { background: var(--brand-hover); }

.nh-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.nh-act { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 12px; text-decoration: none !important; color: #333 !important; font: 700 13px/1 Arial, sans-serif; background: #f4f4f2; border: 1px solid #e4e1da; }
.nh-act:hover { border-color: var(--accent); color: var(--accent) !important; }
.nh-act .i { font-size: 15px; line-height: 1; }
.nh-act b { min-width: 18px; padding: 2px 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; text-align: center; }

.nh .nh-classes { position: static; width: auto; min-height: 0; background: none; box-shadow: none; border-radius: 0; }
.nh-classes { display: flex; gap: 4px; margin: 14px -20px 0; padding: 0 20px; border-top: 1px solid #efece5; overflow-x: auto; scrollbar-width: none; }
.nh-classes::-webkit-scrollbar { display: none; }
.nh-classes a { flex: 0 0 auto; padding: 13px 12px 12px; font: 700 14px/1 Arial, sans-serif; color: #444 !important; text-decoration: none !important; border-bottom: 3px solid transparent; white-space: nowrap; }
.nh-classes a:hover { color: var(--accent) !important; border-bottom-color: var(--accent); }
.nh-classes a.on { color: var(--brand) !important; border-bottom-color: var(--brand); }

.nh-intro { background: #fff; padding: 0 20px; color: #666; font-size: 13px; line-height: 1.55; }
.nh-intro:not(:empty) { padding-top: 12px; padding-bottom: 4px; }

/* блок «Нові підручники» */
.nh-board { background: #fff; padding: 12px 20px 16px; }
.nh-board-in {
	display: grid; grid-template-columns: 96px 1fr; grid-template-rows: auto auto 1fr; column-gap: 16px;
	background: linear-gradient(135deg, var(--brand), #3b7363); color: #fff; border-radius: 14px; padding: 16px 18px; overflow: hidden;
}
.nh-board-in .board-label { grid-column: 2; margin: 0 0 6px; color: #ffd27a; font: 700 11px/1 Arial, sans-serif; letter-spacing: 1px; text-transform: uppercase; }
.nh-board-in .category-image { grid-column: 1; grid-row: 1 / span 3; float: none; margin: 0; }
.nh-board-in .category-image img { width: 96px; height: auto; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.25); display: block; }
.nh-board-in .category-links { grid-column: 2; width: auto !important; float: none !important; position: static !important; }
.nh-board-in .category-links ul { margin: 0; padding: 0; list-style: none; }
.nh-board-in .main-headline { display: block; color: #fff !important; font: 700 18px/1.3 Arial, sans-serif; text-decoration: none; margin-bottom: 8px; }
.nh-board-in ul + ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; align-content: start; }
.nh-board-in li { margin: 0; }
.nh-board-in .headline-small { color: #e6f0ec !important; font-size: 13px; line-height: 1.35; text-decoration: none; }
.nh-board-in a:hover { color: #ffd27a !important; }

#content { border-radius: 0 0 16px 16px; }

/* ---------- Планшети й телефони ---------- */
@media (max-width: 1040px) {
	#wrapper { padding-top: 8px; }
	.nh { padding: 12px 12px 0; border-radius: 14px 14px 0 0; }
	.nh-top { flex-wrap: wrap; gap: 10px; }
	.nh-logo { flex: 1 1 0; min-width: 0; }
	.nh-logo-txt { min-width: 0; }
	.nh-logo-txt b, .nh-logo-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.nh-actions { gap: 6px; }
	.nh-logo-ico { width: 38px; height: 38px; border-radius: 10px; }
	.nh-logo-txt b { font-size: 16px; letter-spacing: 0; }
	.nh-act { padding: 9px 9px; }
	.nh-search { order: 3; flex: 1 1 100%; height: 44px; }
	.nh-search input[type="text"] { font-size: 16px; }
	.nh-act { padding: 9px 10px; }
	.nh-act .t { display: none; }
	.nh-classes { margin: 10px -12px 0; padding: 0 8px; }
	.nh-classes a { padding: 12px 10px 11px; font-size: 14px; }
	.nh-intro { padding: 0 12px; }
	body:has(#book) .nh-intro, body:has(#book) .nh-board { display: none; }
	.nh-board { padding: 10px 12px 12px; }
	.nh-board-in { grid-template-columns: 72px 1fr; column-gap: 12px; padding: 12px; }
	.nh-board-in .category-image img { width: 72px; }
	.nh-board-in .main-headline { font-size: 15px; }
	.nh-board-in ul + ul { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
	.nh-act[data-recentopen] { display: none; }
}

/* ---------- SEO-текст під списком категорії ---------- */
html { scroll-behavior: smooth; }
.cat-seo { clear: both; margin: 24px 0 10px; padding: 18px 20px; background: #faf8f3; border: 1px solid #ece7dc; border-radius: 12px; color: #555; font-size: 14px; line-height: 1.65; }
.cat-seo h2 { margin: 0 0 10px; font: 700 18px/1.3 Arial, sans-serif; color: var(--brand); }
.cat-seo p { margin: 0 0 10px; }
.cat-seo p:last-child { margin-bottom: 0; }
@media (max-width: 1040px) { .cat-seo { padding: 14px; font-size: 14px; } }

/* ---------- «Ще підручники для цього класу» — сітка без обрізання ---------- */
#related-posts { height: auto !important; overflow: visible !important; width: auto !important; float: none !important; }
#related-posts ul { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 10px; }
#related-posts ul li { width: auto !important; margin: 0 !important; float: none !important; }
#related-posts .related-image img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
@media (max-width: 1040px) { #related-posts ul { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Меню предметів класу ---------- */
.nh-subjects { align-items: center; }
.nh-allcls { flex: 0 0 auto; margin: 6px 6px 6px 0; padding: 8px 12px; border-radius: 10px; border: 1px solid #e4e1da; background: #f4f4f2; font: 700 13px/1 Arial, sans-serif; color: #333; cursor: pointer; }
.nh-allcls:hover, .nh-allcls.open { border-color: var(--brand); color: var(--brand); }
.nh-subjects a.nh-cur { margin: 6px 4px 6px 0; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--brand); color: #fff !important; }
.nh-subjects a.nh-cur:hover { background: var(--brand-hover); color: #fff !important; }
.nh-subjects a { font-weight: 600; }
.nh-clsdrop { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 12px; border-top: 1px solid #efece5; }
.nh-clsdrop[hidden] { display: none; }
.nh-clsdrop a { padding: 8px 12px; border-radius: 10px; background: #f4f4f2; border: 1px solid #e4e1da; font: 700 13px/1 Arial, sans-serif; color: #333 !important; text-decoration: none !important; }
.nh-clsdrop a:hover, .nh-clsdrop a.on { border-color: var(--brand); color: var(--brand) !important; }
@media (max-width: 1040px) { .nh-clsdrop { padding: 8px 0 10px; } }

/* ==========================================================
   ТЕМНА ТЕМА (вмикається data-theme="dark" на <html>; перемикач у шапці, js/pidr.js)
   Блок 1 — ручні правила; блок 2 — автоматично перераховані кольори
   з legacy/adaptive/pidr/header.css. Правила мають ту саму вагу, що й оригінальні.
   ========================================================== */

/* ---- перемикач теми ---- */
.nh-theme .i-sun{display:none}
html[data-theme="dark"] .nh-theme .i-moon{display:none}
html[data-theme="dark"] .nh-theme .i-sun{display:inline}

/* ---- автоматично перераховані кольори ---- */
/* legacy.css */
:where(html[data-theme="dark"]) body{color:#bdc2c7}
:where(html[data-theme="dark"]) a{color:#6767e9}
:where(html[data-theme="dark"]) .bnavi li a{color:#8f979f;border-top-color:#363c42}
:where(html[data-theme="dark"]) .bnavi li a:hover{color:#9dd57c}
:where(html[data-theme="dark"]) #content{background-color:#1d2125}
:where(html[data-theme="dark"]) #sidebar{background-color:#21262a}
:where(html[data-theme="dark"]) .category-block .post-thumb img{background-color:#21262a;border-top-color:#373d43;border-right-color:#373d43;border-bottom-color:#373d43;border-left-color:#373d43}
:where(html[data-theme="dark"]) .category-block .entry-title, :where(html[data-theme="dark"]) .category-block .entry-title a{color:#c5cace}
:where(html[data-theme="dark"]) .category-block .entry-header, :where(html[data-theme="dark"]) .category-block .entry-header a{color:#89929a}
:where(html[data-theme="dark"]) input, :where(html[data-theme="dark"]) textarea, :where(html[data-theme="dark"]) button{background-color:#1d2125;border-top-color:#373d43;border-right-color:#373d43;border-bottom-color:#373d43;border-left-color:#373d43}
:where(html[data-theme="dark"]) .entry-meta{color:#89929a}
:where(html[data-theme="dark"]) .xoxo a, :where(html[data-theme="dark"]) .widget ul li a{color:#c5cace}
:where(html[data-theme="dark"]) .tz_tab_widget #tab-items li a:hover, :where(html[data-theme="dark"]) .tz_tab_widget #tab-items li.ui-tabs-selected a, :where(html[data-theme="dark"]) .tz_tab_widget #tab-items li.ui-state-active a{background-color:#1d2125;border-top-color:#3a4046;border-right-color:#3a4046;border-left-color:#3a4046}
:where(html[data-theme="dark"]) .tab-comments .avatar{background-color:#21262a;border-top-color:#373d43;border-right-color:#373d43;border-bottom-color:#373d43;border-left-color:#373d43}
:where(html[data-theme="dark"]) .tab-comments h3, :where(html[data-theme="dark"]) .tab-comments h3 a{color:#a7aeb4}
:where(html[data-theme="dark"]) .tab-comments h3 a:hover{color:#c5cace}
:where(html[data-theme="dark"]) .post-tags a{background-color:#4a555e}
:where(html[data-theme="dark"]) .post-tags a:hover{background-color:#657381}
:where(html[data-theme="dark"]) #related-posts h3{border-bottom-color:#454d54}
:where(html[data-theme="dark"]) .comments{background-color:#1d2125}
:where(html[data-theme="dark"]) .berrors{background-color:#342122;color:#c58c8e;border-top-color:#3d444b;border-right-color:#3d444b;border-bottom-color:#3d444b;border-left-color:#3d444b}
:where(html[data-theme="dark"]) .berrors a{color:#e3e6e8}
:where(html[data-theme="dark"]) .addcomments{background-color:#1d2125}
:where(html[data-theme="dark"]) .addcomments .gbtitle{border-top-color:#3a4147}
:where(html[data-theme="dark"]) .baseform{background-color:#1d2125}
:where(html[data-theme="dark"]) .fieldtr select, :where(html[data-theme="dark"]) .textin, :where(html[data-theme="dark"]) .f_textarea, :where(html[data-theme="dark"]) .xfields textarea, :where(html[data-theme="dark"]) .xprofile textarea, :where(html[data-theme="dark"]) .xfields input, :where(html[data-theme="dark"]) .xprofile input, :where(html[data-theme="dark"]) .xfields select, :where(html[data-theme="dark"]) .xprofile select{border-top-color:#4a535b;border-right-color:#4a535b;border-bottom-color:#4a535b;border-left-color:#4a535b}
:where(html[data-theme="dark"]) .navigation2{background-color:#1d2125;background-image:-webkit-linear-gradient(top, #202529, #1d2125)}
:where(html[data-theme="dark"]) .navigation2 .pages a, :where(html[data-theme="dark"]) .navigation2 .pages span{color:#9098a0}
:where(html[data-theme="dark"]) .navigation2 .pages span{background-color:#272c31}
:where(html[data-theme="dark"]) .bvote .vbtn .fbutton:hover{color:#e96798}
:where(html[data-theme="dark"]) .red{color:#e99c67}
:where(html[data-theme="dark"]) .grbtitle h2{border-bottom-color:#454d54}
:where(html[data-theme="dark"]) .scriptcode, :where(html[data-theme="dark"]) .title_quote, :where(html[data-theme="dark"]) .quote, :where(html[data-theme="dark"]) .title_spoiler, :where(html[data-theme="dark"]) .text_spoiler{background-color:#202529;border-top-color:#3c434a;border-right-color:#3c434a;border-bottom-color:#3c434a;border-left-color:#3c434a}
:where(html[data-theme="dark"]) .title_quote, :where(html[data-theme="dark"]) .title_spoiler{background-color:#202529}
:where(html[data-theme="dark"]) .scriptcode{color:#67afe9}
:where(html[data-theme="dark"]) .rating{color:#9ea5ac}
:where(html[data-theme="dark"]) .highslide-wrapper, :where(html[data-theme="dark"]) .highslide-outline{background-color:#1d2125}
:where(html[data-theme="dark"]) .highslide-image{border-top-color:#30363b;border-right-color:#30363b;border-bottom-color:#30363b;border-left-color:#30363b}
:where(html[data-theme="dark"]) .highslide-html{background-color:#1d2125}
:where(html[data-theme="dark"]) .highslide-loading{border-top-color:#30363b;border-right-color:#30363b;border-bottom-color:#30363b;border-left-color:#30363b}
:where(html[data-theme="dark"]) .highslide-caption{background-color:#1d2125}
:where(html[data-theme="dark"]) .ui-widget-header{color:#cbcfd2}
:where(html[data-theme="dark"]) .ui-widget-header a{color:#cbcfd2}
:where(html[data-theme="dark"]) .ui-dialog{background-color:#1d2125;border-top-color:#3e454c;border-right-color:#3e454c;border-bottom-color:#3e454c;border-left-color:#3e454c}
:where(html[data-theme="dark"]) .ui-widget input, :where(html[data-theme="dark"]) .ui-widget textarea{background-color:#1d2125;color:#e3e6e8;border-top-color:#4a535b;border-right-color:#4a535b;border-bottom-color:#4a535b;border-left-color:#4a535b}
:where(html[data-theme="dark"]) .ui-button{background-color:#1d2125;color:#929aa2}
:where(html[data-theme="dark"]) .ui-state-error{background-color:#33221b !important;color:#e96767}
:where(html[data-theme="dark"]) .voteprogress{background-color:#21262b;background-image:-webkit-linear-gradient(top, #22272c, #202529)}
:where(html[data-theme="dark"]) .pollprogress{background-color:#21262b;background-image:-webkit-linear-gradient(top, #22272c, #202529)}
:where(html[data-theme="dark"]) .bb-editor textarea{background-color:#1d2125;border-top-color:#4a535b;border-right-color:#4a535b;border-bottom-color:#4a535b;border-left-color:#4a535b}
:where(html[data-theme="dark"]) #share-popup{background-color:#1d2125;border-top-color:#535c65;border-right-color:#535c65;border-bottom-color:#535c65;border-left-color:#535c65}
:where(html[data-theme="dark"]) #share-popup .social ul a:hover{color:#e97767}
:where(html[data-theme="dark"]) #share-popup .link{border-top-color:#40474e}
:where(html[data-theme="dark"]) #share-popup .link span{color:#89929a}
:where(html[data-theme="dark"]) .post-entry h2 a{color:#c0c4c9}
:where(html[data-theme="dark"]) .post-info{border-top-color:#353c41;border-bottom-color:#353c41}
:where(html[data-theme="dark"]) .post-image{border-top-color:#363d42;border-right-color:#363d42;border-bottom-color:#363d42;border-left-color:#363d42}
:where(html[data-theme="dark"]) .post-image a{border-top-color:#30363b;border-right-color:#30363b;border-bottom-color:#30363b;border-left-color:#30363b}
:where(html[data-theme="dark"]) .post-details{border-top-color:#363d42;border-bottom-color:#363d42}
:where(html[data-theme="dark"]) a, :where(html[data-theme="dark"]) #top-bar a:hover, :where(html[data-theme="dark"]) #logo a:hover, :where(html[data-theme="dark"]) #recent-news-block .entry-title a:hover, :where(html[data-theme="dark"]) #featured-posts-block .entry-title a:hover, :where(html[data-theme="dark"]) .category-block .entry-title a:hover, :where(html[data-theme="dark"]) .category-block-summary .entry-title a:hover, :where(html[data-theme="dark"]) .tz_tweet_widget a:hover, :where(html[data-theme="dark"]) .xoxo a:hover, :where(html[data-theme="dark"]) .tz_tab_widget #tab-items li a:hover, :where(html[data-theme="dark"]) .tz_tab_widget #tab-items li.ui-tabs-selected a, :where(html[data-theme="dark"]) .tz_tab_widget #tab-items li.ui-state-active a, :where(html[data-theme="dark"]) .tz_tab_widget .entry-title a:hover, :where(html[data-theme="dark"]) .widget ul li a:hover, :where(html[data-theme="dark"]) #related-posts .entry-title a:hover, :where(html[data-theme="dark"]) p.breadcrumb, :where(html[data-theme="dark"]) li.bypostauthor cite, :where(html[data-theme="dark"]) li.bypostauthor cite a, :where(html[data-theme="dark"]) li.comment cite a:hover, :where(html[data-theme="dark"]) #archive-posts .post-container .entry-title a:hover, :where(html[data-theme="dark"]) #single-column-right ul.share li a:hover, :where(html[data-theme="dark"]) #single-column-right ul.rss li a:hover, :where(html[data-theme="dark"]) #secondary-nav ul li.current_page_item a, :where(html[data-theme="dark"]) #secondary-nav ul li.current_page_item li a:hover, :where(html[data-theme="dark"]) #secondary-nav ul li.current_menu_item a, :where(html[data-theme="dark"]) #secondary-nav ul li.current_menu_item a:hover{color:#e99c67}
:where(html[data-theme="dark"]) .widget_search #searchsubmit, :where(html[data-theme="dark"]) .tab-tags a:hover, :where(html[data-theme="dark"]) #commentform input#submit, :where(html[data-theme="dark"]) #contactForm button, :where(html[data-theme="dark"]) .coda-nav ul li a.current{color:#e9b367}
/* adaptive.css */
@media (max-width: 1040px){
  :where(html[data-theme="dark"]) #header{background-color:#1d2125 !important}
  :where(html[data-theme="dark"]) .m-logo{color:#e99c67}
  :where(html[data-theme="dark"]) .m-logo span{color:#9da4ab}
  :where(html[data-theme="dark"]) .study_1{color:#b1b7bd}
  :where(html[data-theme="dark"]) .searchbar{background-color:#24292e;border-top-color:#3e454c;border-right-color:#3e454c;border-bottom-color:#3e454c;border-left-color:#3e454c}
  :where(html[data-theme="dark"]) .searchbar input[type="text"]{color:#c5cace}
  :where(html[data-theme="dark"]) .bnavi li a{border-top-color:#3e454c}
  :where(html[data-theme="dark"]) #mc_signup::before{color:#c5cace}
}
@media (max-width: 480px){
  :where(html[data-theme="dark"]) .bnavi li:nth-child(2) a{border-top-color:#3e454c}
}
/* pidr.css */
:where(html[data-theme="dark"]) .ha-btn{background-color:rgba(29,33,37,0.14);border-top-color:rgba(48,54,59,0.28);border-right-color:rgba(48,54,59,0.28);border-bottom-color:rgba(48,54,59,0.28);border-left-color:rgba(48,54,59,0.28)}
:where(html[data-theme="dark"]) .ha-btn:hover{background-color:rgba(29,33,37,0.26)}
@media (max-width: 1040px){
  :where(html[data-theme="dark"]) .ha-btn{background-color:#24292e;color:#c5cace !important;border-top-color:#3c4349;border-right-color:#3c4349;border-bottom-color:#3c4349;border-left-color:#3c4349}
  :where(html[data-theme="dark"]) .ha-btn:hover{background-color:#292f35}
}
:where(html[data-theme="dark"]) .crumbs{color:#939ba3}
:where(html[data-theme="dark"]) .crumbs a{color:#e99c67}
:where(html[data-theme="dark"]) .crumbs b{color:#a7aeb4}
:where(html[data-theme="dark"]) .book{color:#c5cace}
:where(html[data-theme="dark"]) .book-head h1{color:#cfd3d6}
:where(html[data-theme="dark"]) .book-tools a{color:#89929a}
:where(html[data-theme="dark"]) .book-props th, :where(html[data-theme="dark"]) .book-props td{border-bottom-color:#373d43}
:where(html[data-theme="dark"]) .book-props th{color:#939ba3}
:where(html[data-theme="dark"]) .book-props td a{color:#e99c67}
:where(html[data-theme="dark"]) .book-rating .lbl, :where(html[data-theme="dark"]) .book-share .lbl{color:#939ba3}
:where(html[data-theme="dark"]) .bbtn-fav{background-color:#1d2125;color:#c5cace;border-top-color:#3e454c;border-right-color:#3e454c;border-bottom-color:#3e454c;border-left-color:#3e454c}
:where(html[data-theme="dark"]) .bbtn-fav.on{background-color:#332419;color:#e99c67}
:where(html[data-theme="dark"]) .sh-cp{background-color:#5c6975}
:where(html[data-theme="dark"]) .book-gdz{background-color:#242e24;border-top-color:#3f464d;border-right-color:#3f464d;border-bottom-color:#3f464d;border-left-color:#3f464d}
:where(html[data-theme="dark"]) .book .tilo-zag{color:#8cc5b5}
:where(html[data-theme="dark"]) .book .tilo-book iframe{background-color:#23282d}
:where(html[data-theme="dark"]) .book-files{background-color:#202428;border-top-color:#373d43;border-right-color:#373d43;border-bottom-color:#373d43;border-left-color:#373d43}
:where(html[data-theme="dark"]) .book-files li{border-bottom-color:#3b4248}
:where(html[data-theme="dark"]) .book-files a{color:#e99c67}
:where(html[data-theme="dark"]) .book-files .src, :where(html[data-theme="dark"]) .book-files .hint{color:#89929a}
:where(html[data-theme="dark"]) .gdz-links a{background-color:#242e24;color:#8cc5b5 !important}
:where(html[data-theme="dark"]) .recent-box h3, :where(html[data-theme="dark"]) #related-posts.related-similar h3{color:#c5cace}
:where(html[data-theme="dark"]) .recent-list .fav-title{color:#c5cace}
:where(html[data-theme="dark"]) .fav-box{background-color:#1d2125}
:where(html[data-theme="dark"]) .fav-tabs{border-bottom-color:#373d43}
:where(html[data-theme="dark"]) .fav-tabs button{color:#939ba3}
:where(html[data-theme="dark"]) .fav-tabs button.on{color:#e99c67}
:where(html[data-theme="dark"]) .fav-tabs .fav-close{color:#89929a}
:where(html[data-theme="dark"]) .fav-list .fav-item{border-bottom-color:#363d42}
:where(html[data-theme="dark"]) .fav-list .fav-title{color:#c5cace}
:where(html[data-theme="dark"]) .fav-list .fav-title:hover{color:#e99c67}
:where(html[data-theme="dark"]) .fav-del:hover{color:#e96a67}
:where(html[data-theme="dark"]) .fav-empty{color:#939ba3}
:where(html[data-theme="dark"]) .rt-lbl{color:#939ba3}
:where(html[data-theme="dark"]) .reader-tabs button{background-color:#1d2125;color:#b1b7bd;border-top-color:#3e454c;border-right-color:#3e454c;border-bottom-color:#3e454c;border-left-color:#3e454c}
:where(html[data-theme="dark"]) .dl-src{border-top-color:#373d43}
:where(html[data-theme="dark"]) .dl-name{color:#c5cace}
:where(html[data-theme="dark"]) .dl-name small{color:#89929a}
:where(html[data-theme="dark"]) .dl-src li a{background-color:#1d2125}
:where(html[data-theme="dark"]) .dl-src li a:hover{background-color:#332419}
:where(html[data-theme="dark"]) .prev-ed{background-color:#182131;border-top-color:#3a4147;border-right-color:#3a4147;border-bottom-color:#3a4147;border-left-color:#3a4147}
:where(html[data-theme="dark"]) .prev-ed h3{color:#7f9fd2}
:where(html[data-theme="dark"]) .prev-ed-body a{background-color:#1d2125;color:#7f9fd2 !important;border-top-color:#3e454b;border-right-color:#3e454b;border-bottom-color:#3e454b;border-left-color:#3e454b}
:where(html[data-theme="dark"]) .prev-ed-body a:hover{background-color:#1a2436}
:where(html[data-theme="dark"]) .book-toc{background-color:#212529;border-top-color:#3a4147;border-right-color:#3a4147;border-bottom-color:#3a4147;border-left-color:#3a4147}
:where(html[data-theme="dark"]) .book-toc h2{color:#cfd3d6}
:where(html[data-theme="dark"]) .toc-hint{color:#a7aeb4}
:where(html[data-theme="dark"]) .toc-list.collapsed::after{background-image:linear-gradient(rgba(247, 248, 250, 0), #212529)}
:where(html[data-theme="dark"]) .toc-sec{color:#8cc5b5}
:where(html[data-theme="dark"]) .toc-i{color:#6da5e4}
:where(html[data-theme="dark"]) .toc-i:hover{background-color:#252a30}
:where(html[data-theme="dark"]) .toc-i.on{background-color:#37271a;color:#e99e67}
:where(html[data-theme="dark"]) .toc-p{color:#939ba3}
:where(html[data-theme="dark"]) .toc-plain{color:#bbc0c5}
:where(html[data-theme="dark"]) .toc-more{background-color:#1d2125;color:#6da5e4;border-top-color:#41484f;border-right-color:#41484f;border-bottom-color:#41484f;border-left-color:#41484f}
:where(html[data-theme="dark"]) .toc-now{background-color:#37271a}
:where(html[data-theme="dark"]) .bbtn-toc{background-color:#21272f;color:#6da5e4}
:where(html[data-theme="dark"]) .pdf-fs{background-color:#1d2125;color:#6da5e4;border-top-color:#41484f;border-right-color:#41484f;border-bottom-color:#41484f;border-left-color:#41484f}
:where(html[data-theme="dark"]) .pdf-fs:hover{background-color:#21272f}
:where(html[data-theme="dark"]) .bbtn-resume{background-color:#37271a;color:#e99e67}
:where(html[data-theme="dark"]) .toc-raw{color:#bbc0c5}
:where(html[data-theme="dark"]) .toc-tabs button{background-color:#1d2125;color:#6da5e4;border-top-color:#41484f;border-right-color:#41484f;border-bottom-color:#41484f;border-left-color:#41484f}
:where(html[data-theme="dark"]) .pgjump{background-color:#212529;border-top-color:#3a4147;border-right-color:#3a4147;border-bottom-color:#3a4147;border-left-color:#3a4147}
:where(html[data-theme="dark"]) .pgjump label{color:#8cc5b5}
:where(html[data-theme="dark"]) .pgjump input{border-top-color:#41484f;border-right-color:#41484f;border-bottom-color:#41484f;border-left-color:#41484f}
:where(html[data-theme="dark"]) .pgjump select{background-color:#1d2125;border-top-color:#41484f;border-right-color:#41484f;border-bottom-color:#41484f;border-left-color:#41484f}
:where(html[data-theme="dark"]) .pgjump-msg{color:#e99e67}
:where(html[data-theme="dark"]) .ui-dialog{background-color:#1d2125;color:#c5cace}
:where(html[data-theme="dark"]) .ui-dialog .ui-dialog-titlebar{background-color:#21262a;color:#8cc5b5;border-bottom-color:#373d43}
:where(html[data-theme="dark"]) .ui-dialog .ui-dialog-titlebar-close{background-color:#272c31}
:where(html[data-theme="dark"]) .ui-dialog .ui-dialog-titlebar-close:hover{background-color:#2c3238}
:where(html[data-theme="dark"]) .ui-dialog .ui-dialog-titlebar-close::before{color:#b1b7bd}
:where(html[data-theme="dark"]) .ui-dialog .ui-dialog-content{background-color:#1d2125;color:#c5cace}
:where(html[data-theme="dark"]) .ui-dialog textarea, :where(html[data-theme="dark"]) .ui-dialog input[type="text"], :where(html[data-theme="dark"]) .ui-dialog input[type="email"]{background-color:#1d2125;color:#c5cace;border-top-color:#3f464c;border-right-color:#3f464c;border-bottom-color:#3f464c;border-left-color:#3f464c}
:where(html[data-theme="dark"]) .ui-dialog .ui-dialog-buttonpane{background-color:#1d2125;border-top-color:#373d43}
:where(html[data-theme="dark"]) .ui-dialog .ui-dialog-buttonpane button{background-color:#1d2125;color:#c5cace;border-top-color:#3e454c;border-right-color:#3e454c;border-bottom-color:#3e454c;border-left-color:#3e454c}
:where(html[data-theme="dark"]) .ui-dialog .ui-dialog-buttonpane button:hover{border-top-color:#4c545d;border-right-color:#4c545d;border-bottom-color:#4c545d;border-left-color:#4c545d}
:where(html[data-theme="dark"]) .complian a{background-color:#1d2125 !important;color:#a4abb1 !important;border-top-color:#3e454c !important;border-right-color:#3e454c !important;border-bottom-color:#3e454c !important;border-left-color:#3e454c !important}
:where(html[data-theme="dark"]) .complian a:hover{background-color:#301717 !important;color:#e26f6f !important}
:where(html[data-theme="dark"]) .nh-h1{background-color:#1d2125;color:#cfd3d6}
/* header.css */
:where(html[data-theme="dark"]) body{background-color:#302e28 !important}
:where(html[data-theme="dark"]) .nh{background-color:#1d2125}
:where(html[data-theme="dark"]) .nh-logo-txt b{color:#cfd3d6}
:where(html[data-theme="dark"]) .nh-logo-txt b::first-letter{color:#e99c67}
:where(html[data-theme="dark"]) .nh-logo-txt small{color:#919aa2}
:where(html[data-theme="dark"]) .nh-search{background-color:#24292d;border-top-color:#3d444b;border-right-color:#3d444b;border-bottom-color:#3d444b;border-left-color:#3d444b}
:where(html[data-theme="dark"]) .nh-search:focus-within{background-color:#1d2125}
:where(html[data-theme="dark"]) .nh-search input[type="text"]{color:#cfd3d6}
:where(html[data-theme="dark"]) .nh-act{background-color:#24292d;color:#c5cace !important;border-top-color:#3d444b;border-right-color:#3d444b;border-bottom-color:#3d444b;border-left-color:#3d444b}
:where(html[data-theme="dark"]) .nh-act:hover{color:#e99c67 !important}
:where(html[data-theme="dark"]) .nh-classes{border-top-color:#393f45}
:where(html[data-theme="dark"]) .nh-classes a{color:#bbc0c5 !important}
:where(html[data-theme="dark"]) .nh-classes a:hover{color:#e99c67 !important}
:where(html[data-theme="dark"]) .nh-classes a.on{color:#8cc5b5 !important}
:where(html[data-theme="dark"]) .nh-intro{background-color:#1d2125;color:#a7aeb4}
:where(html[data-theme="dark"]) .nh-board{background-color:#1d2125}
:where(html[data-theme="dark"]) .cat-seo{background-color:#2c2921;color:#b1b7bd;border-top-color:#3b4248;border-right-color:#3b4248;border-bottom-color:#3b4248;border-left-color:#3b4248}
:where(html[data-theme="dark"]) .cat-seo h2{color:#8cc5b5}
:where(html[data-theme="dark"]) .nh-allcls{background-color:#24292d;color:#c5cace;border-top-color:#3d444b;border-right-color:#3d444b;border-bottom-color:#3d444b;border-left-color:#3d444b}
:where(html[data-theme="dark"]) .nh-allcls:hover, :where(html[data-theme="dark"]) .nh-allcls.open{color:#8cc5b5}
:where(html[data-theme="dark"]) .nh-clsdrop{border-top-color:#393f45}
:where(html[data-theme="dark"]) .nh-clsdrop a{background-color:#24292d;color:#c5cace !important;border-top-color:#3d444b;border-right-color:#3d444b;border-bottom-color:#3d444b;border-left-color:#3d444b}
:where(html[data-theme="dark"]) .nh-clsdrop a:hover, :where(html[data-theme="dark"]) .nh-clsdrop a.on{color:#8cc5b5 !important}
/* inline-style */
:where(html[data-theme="dark"]) .nf-ico{background-color:rgba(29,33,37,0.12)}

/* ---- ручні правила (стоять останніми, щоб переважати автоматичні) ---- */
:where(html[data-theme="dark"]){color-scheme:dark}
:where(html[data-theme="dark"]) body{background:#0f1316 !important}
:where(html[data-theme="dark"]) .panelx1{background-image:none}
:where(html[data-theme="dark"]) .category-block .post-container, :where(html[data-theme="dark"]) .post-entry{background:#181d21 none;border-color:#283037;box-shadow:none}
:where(html[data-theme="dark"]) .category-block .post-container:hover, :where(html[data-theme="dark"]) .post-entry:hover{box-shadow:0 6px 18px rgba(0,0,0,.45)}
:where(html[data-theme="dark"]) .post-entry h2 a{color:#e4e6e8}
:where(html[data-theme="dark"]) .post-entry .post-tags a{background:#1f2e29;color:#9fd3c0 !important}
:where(html[data-theme="dark"]) .post-entry .post-tags a:hover{background:var(--brand);color:#fff !important}

/* ---- мобільна шапка з кнопкою теми: щоб назва сайту не обрізалась ---- */
@media (max-width:600px){.nh-top{gap:8px}.nh-actions{gap:4px}.nh-act{padding-left:8px;padding-right:8px}}
@media (max-width:400px){.nh-logo-txt b{font-size:15px}}
@media (max-width:370px){.nh-logo-txt b{font-size:14px}}

/* ######################################################################
   6. БОКОВИЙ БЛОК «Підручники за предметами»
   ###################################################################### */
#sidebar.aside{background:#fff;border:1px solid #ebe7de;border-radius:14px;padding:14px 16px 8px;box-shadow:0 1px 2px rgba(0,0,0,.04)}
#mc_signup::before{content:"Підручники за предметами";display:block;font:700 16px/1.3 Arial,sans-serif;color:#222;padding:0;margin:0 0 6px}
#sidebar .widget_mailchimpsf_widget{margin-bottom:0}
#sidebar .bnavi li{border-bottom:1px solid #eef0ee}
#sidebar .bnavi li:last-child{border-bottom:0}
#sidebar .bnavi li a{display:block;padding:8px 0;background:none;font:600 13.5px/1.35 Arial,sans-serif;color:#333;transition:color .15s,padding .15s}
#sidebar .bnavi li a:hover{color:var(--brand);padding-left:4px}
#sidebar .bnavi li a.is-active{color:var(--brand);font-weight:700}
#sidebar .bnavi li a.is-active::before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--brand);margin:0 7px 1px 0;vertical-align:middle}
#sidebar-narrow-container{display:none} /* порожній рекламний віджет старого шаблону */
:where(html[data-theme="dark"]) #sidebar.aside{background:#181d21;border-color:#283037;box-shadow:none}
:where(html[data-theme="dark"]) #mc_signup::before{color:#e4e6e8}
:where(html[data-theme="dark"]) #sidebar .bnavi li{border-bottom-color:#262d33}
:where(html[data-theme="dark"]) #sidebar .bnavi li a{color:#c9ced3}
:where(html[data-theme="dark"]) #sidebar .bnavi li a:hover, :where(html[data-theme="dark"]) #sidebar .bnavi li a.is-active{color:#7fc4ab}
:where(html[data-theme="dark"]) #sidebar .bnavi li a.is-active::before{background:#7fc4ab}

/* ######################################################################
   7. ПАГІНАЦІЯ  ‹ 1 2 3 … 20 ›   (розмітка DLE не змінена — стрілки переставлені через order)
   ###################################################################### */
.navigation2{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;background:none;border:0;box-shadow:none;padding:4px 0;margin:8px 0 22px;height:auto}
.navigation2 .pages,.navigation2 .nparrow{float:none;display:contents}
.navigation2 .nparrow .prev{order:1;display:inline-flex}
.navigation2 .pages > *{order:2}
.navigation2 .nparrow .next{order:3;display:inline-flex}
.navigation2 .pages a,.navigation2 .pages span,.navigation2 .nparrow .prev a,.navigation2 .nparrow .prev span,.navigation2 .nparrow .next a,.navigation2 .nparrow .next span{box-sizing:border-box;min-width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;margin:0;padding:0 8px;border-radius:9px;border:1px solid #e3e6ea;background:#fff none;color:#333;font:600 14px/1 Arial,sans-serif;text-decoration:none;text-shadow:none;box-shadow:0 1px 1px rgba(0,0,0,.03);transition:border-color .15s,color .15s,background .15s}
.navigation2 .pages a:hover,.navigation2 .nparrow .prev a:hover,.navigation2 .nparrow .next a:hover{background:#fff;border-color:var(--brand);color:var(--brand)}
.navigation2 .pages > span:not(.nav_ext){background:var(--brand);border-color:var(--brand);color:#fff}
.navigation2 .pages > span.nav_ext{border:0;background:none;box-shadow:none;min-width:24px;padding:0;color:#888}
.navigation2 .nparrow .prev > a::before,.navigation2 .nparrow .prev > span::before{content:"‹";font-size:22px;line-height:1;margin-top:-3px}
.navigation2 .nparrow .next > a::after,.navigation2 .nparrow .next > span::after{content:"›";font-size:22px;line-height:1;margin-top:-3px}
.navigation2 .nparrow .prev > a,.navigation2 .nparrow .prev > span,.navigation2 .nparrow .next > a,.navigation2 .nparrow .next > span{font-size:0;padding:0}
.navigation2 .nparrow .prev > span,.navigation2 .nparrow .next > span{color:#c3c7cc;border-color:#eef0f2;box-shadow:none;cursor:default}
:where(html[data-theme="dark"]) .navigation2 .pages a,:where(html[data-theme="dark"]) .navigation2 .nparrow .prev a,:where(html[data-theme="dark"]) .navigation2 .nparrow .next a{background:#181d21;border-color:#2c343b;color:#c9ced3;box-shadow:none}
:where(html[data-theme="dark"]) .navigation2 .pages a:hover,:where(html[data-theme="dark"]) .navigation2 .nparrow .prev a:hover,:where(html[data-theme="dark"]) .navigation2 .nparrow .next a:hover{background:#181d21;border-color:#7fc4ab;color:#7fc4ab}
:where(html[data-theme="dark"]) .navigation2 .pages > span:not(.nav_ext){background:var(--brand);border-color:var(--brand);color:#fff}
:where(html[data-theme="dark"]) .navigation2 .nparrow .prev > span,:where(html[data-theme="dark"]) .navigation2 .nparrow .next > span{background:#14181b;border-color:#22292f;color:#4a535b}

/* ######################################################################
   8. СТОРІНКА ПОШУКУ
   ###################################################################### */
.search-form{margin:4px 0 16px}
#searchtable td.search > div{margin:0 !important;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#searchtable td.search > div > br{display:none}
#searchinput{flex:1 1 240px;width:auto !important;height:42px;box-sizing:border-box;padding:0 14px;border:1px solid #e3e6ea;border-radius:10px;background:#fff;color:#222;font:15px Arial,sans-serif}
#searchinput:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(47,93,80,.15)}
#searchtable .bbcodes{height:42px;padding:0 18px;border-radius:10px;border:1px solid var(--brand);background:var(--brand) none;color:#fff;font:700 14px Arial,sans-serif;text-transform:none;text-shadow:none;box-shadow:none;cursor:pointer}
#searchtable .bbcodes:hover{background:var(--brand-hover)}
#searchtable #dofullsearch{display:none} /* розширений пошук прибрано */
#searchtable #dofullsearch:hover{border-color:var(--brand);color:var(--brand)}
#sidebar:not(:has(.bnavi)){display:none} /* порожня права колонка (пошук тощо) */
:where(html[data-theme="dark"]) #searchinput{background:#181d21;border-color:#2c343b;color:#e4e6e8}
:where(html[data-theme="dark"]) #searchtable #dofullsearch{background:#181d21;border-color:#2c343b;color:#c9ced3}

/* сітка карток на flex (без «пробілів» між inline-картками); без правої колонки — на всю ширину, 5 у ряд */
@media (min-width:1041px){
#primary:has(> .post-entry){display:flex;flex-wrap:wrap;align-content:flex-start;column-gap:12px}
#primary:has(> .post-entry) > *:not(.post-entry){flex:0 0 100%;max-width:100%;box-sizing:border-box}
#primary > .post-entry{width:calc(25% - 9px);margin:0 0 14px}
#primary:not(:has(~ #sidebar .bnavi)){width:100%}
#primary:not(:has(~ #sidebar .bnavi)) > .post-entry{width:calc(20% - 9.6px)}
}

/* головна: картки як на сторінках класів — обкладинка зверху, 5 у ряд (ліва колонка = книги 1–10, права = 11–20) */
@media (min-width:1041px){
#category-blocks{display:flex;flex-wrap:wrap;column-gap:12px;align-content:flex-start}
#category-blocks .category-block{display:contents}
#category-blocks .post-container{width:calc(20% - 9.6px);box-sizing:border-box;display:flex;flex-direction:column;text-align:center;margin:0 0 14px}
#category-blocks .post-container .post-thumb{order:1}
#category-blocks .post-container img.wp-post-image{float:none;width:100%;height:auto;aspect-ratio:3/4;object-fit:cover;margin:0 0 8px;display:block}
#category-blocks .post-container .entry-title{order:2;font-size:14px;line-height:1.3;margin:0 0 4px}
#category-blocks .post-container .entry-meta{order:3}
}

/* ######################################################################
   9. СЛУЖБОВІ СТОРІНКИ: статичні, зворотний зв'язок, хмара авторів, повідомлення
   ###################################################################### */
.page-h{padding:4px 0 12px;background:none}
.static-body{font:15px/1.65 Arial,sans-serif;color:#333;max-width:780px}
.static-body h2,.static-body h3{font:700 18px/1.3 Arial,sans-serif;color:#222;margin:22px 0 8px}
.static-body p{margin:0 0 12px}
.static-body ul{list-style:disc;margin:0 0 12px 22px}
.static-body ol{list-style:decimal;margin:0 0 12px 22px}
.static-body li{margin:0 0 4px}
.static-body a{color:var(--brand);text-decoration:underline}

.tags-cloud{display:flex;flex-wrap:wrap;gap:6px;padding:4px 0 10px}
.tags-cloud span{display:inline-flex}
.tags-cloud a{display:inline-block;padding:5px 10px;border:1px solid #e3e6ea;border-radius:8px;background:#fff;color:#333 !important;font:600 13px/1.3 Arial,sans-serif;text-decoration:none}
.tags-cloud a:hover{border-color:var(--brand);color:var(--brand) !important}

.pform{max-width:620px;padding:0 0 10px}
.pform-intro{color:#555;font:14px/1.55 Arial,sans-serif;margin:0 0 16px}
.pf-row{margin:0 0 14px}
.pf-row label{display:block;font:600 14px/1.3 Arial,sans-serif;color:#333;margin:0 0 6px}
.pform .f_input,.pform .f_textarea{display:block;width:100%;box-sizing:border-box;border:1px solid #e3e6ea;border-radius:10px;padding:10px 12px;font:15px/1.4 Arial,sans-serif;background:#fff;color:#222;box-shadow:none}
.pform .f_input{height:44px}
.pform .pf-short{max-width:160px}
.pform .f_textarea{min-height:150px;resize:vertical}
.pform .f_input:focus,.pform .f_textarea:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(47,93,80,.15)}
.pform .fieldsubmit{padding:0;margin:4px 0 0;background:none;border:0}
.pform .fbutton{height:44px;padding:0 26px;border-radius:10px;border:0;background:var(--brand) none;color:#fff;font:700 15px Arial,sans-serif;cursor:pointer;box-shadow:none;text-shadow:none}
.pform .fbutton:hover{background:var(--brand-hover)}

.berrors{background:#fff7f6 none;border:1px solid #f1d2ce;border-left:4px solid #d9534f;border-radius:10px;padding:14px 16px;margin:16px 0;color:#5a2a26;font:14px/1.5 Arial,sans-serif}
.berrors b{display:block;font-size:15px;color:#b3261e;margin:0 0 4px}

:where(html[data-theme="dark"]) .static-body{color:#c9ced3}
:where(html[data-theme="dark"]) .static-body h2,:where(html[data-theme="dark"]) .static-body h3{color:#e4e6e8}
:where(html[data-theme="dark"]) .static-body a{color:#7fc4ab}
:where(html[data-theme="dark"]) .tags-cloud a{background:#181d21;border-color:#2c343b;color:#c9ced3 !important}
:where(html[data-theme="dark"]) .tags-cloud a:hover{border-color:#7fc4ab;color:#7fc4ab !important}
:where(html[data-theme="dark"]) .pform-intro,:where(html[data-theme="dark"]) .pf-row label{color:#c9ced3}
:where(html[data-theme="dark"]) .pform .f_input,:where(html[data-theme="dark"]) .pform .f_textarea{background:#181d21;border-color:#2c343b;color:#e4e6e8}
:where(html[data-theme="dark"]) .berrors{background:#2a1a1a;border-color:#4a2a2a;color:#e6c9c6}
:where(html[data-theme="dark"]) .berrors b{color:#ff8a80}

/* «Ще підручники для цього класу» на сторінці книги — картки замість обрізаних смужок з плашкою */
#related-posts ul{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:0;margin:0}
#related-posts ul li{float:none;width:auto;height:auto;margin:0;padding:0;list-style:none}
#related-posts ul li:not(.rel-on){display:none}
#related-posts .related-image{position:relative;float:none;width:auto;height:100%;box-sizing:border-box;overflow:visible;background:#fff none;border:1px solid #ebe7de;border-radius:12px;padding:8px;box-shadow:0 1px 2px rgba(0,0,0,.04);transition:box-shadow .2s,transform .2s}
#related-posts .related-image:hover{box-shadow:0 6px 18px rgba(0,0,0,.09);transform:translateY(-2px)}
#related-posts .related-image img{display:block;width:100%;height:auto;aspect-ratio:3/4;object-fit:cover;border-radius:6px;margin:0 0 8px;box-shadow:0 1px 4px rgba(0,0,0,.18)}
#related-posts .related-text{position:static;width:auto;height:auto;background:none;padding:0;margin:0;text-align:center}
#related-posts .related-text a{color:#222;font:700 13px/1.3 Arial,sans-serif;text-transform:none;text-shadow:none}
@media (max-width:600px){#related-posts ul{grid-template-columns:repeat(2,minmax(0,1fr))}}
.berrors > br:first-of-type{display:none}
:where(html[data-theme="dark"]) #related-posts .related-image{background:#181d21;border-color:#283037;box-shadow:none}
:where(html[data-theme="dark"]) #related-posts .related-text a{color:#e4e6e8}

/* ######################################################################
   10. АДМІН-ІНСТРУМЕНТИ НА САЙТІ: меню «Редагувати», вікно «Швидке редагування»
   ###################################################################### */
#dropmenudiv{position:absolute;z-index:10040;box-sizing:border-box;min-width:200px;background:#fff;border:1px solid #e3e6ea;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.14);padding:6px;font:14px/1.3 Arial,sans-serif}
#dropmenudiv a{display:block;padding:8px 12px;border-radius:7px;color:#333;text-decoration:none;white-space:nowrap}
#dropmenudiv a:hover{background:#eef3f1;color:var(--brand)}
/* діалоги jQuery UI: не вищі за екран, вміст прокручується, кнопки завжди видно */
.ui-dialog{display:flex !important;flex-direction:column;max-height:calc(100vh - 24px)}
.ui-dialog[style*="display: none"]{display:none !important}
.ui-dialog .ui-dialog-titlebar,.ui-dialog .ui-dialog-buttonpane{flex:0 0 auto}
.ui-dialog .ui-dialog-content{flex:1 1 auto;min-height:0;height:auto !important;overflow:auto !important;max-height:none !important}
.ui-dialog .ui-dialog-titlebar{display:flex;align-items:center;gap:10px}
.ui-dialog .ui-dialog-title{flex:1 1 auto;min-width:0}
.ui-dialog .ui-dialog-titlebar-close{position:relative;top:auto;right:auto;margin:0 0 0 auto;flex:0 0 auto}
.ui-dialog .xfieldsrow{margin:12px 0}
.ui-dialog .xfieldscolleft{font:600 14px/1.3 Arial,sans-serif;color:#333;margin:0 0 6px}
.ui-dialog .xfieldsrow select[multiple]{min-width:320px;border:1px solid #e3e6ea;border-radius:8px;padding:4px}
.ui-dialog form > div{margin-bottom:10px}
:where(html[data-theme="dark"]) #dropmenudiv{background:#181d21;border-color:#2c343b;box-shadow:0 8px 24px rgba(0,0,0,.5)}
:where(html[data-theme="dark"]) #dropmenudiv a{color:#c9ced3}
:where(html[data-theme="dark"]) #dropmenudiv a:hover{background:#1f2e29;color:#7fc4ab}
