html, body, div, span, applet, object, iframe, p, blockquote, pre, a, abbr, acronym, address, big, cite, del, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, u, center, fieldset, form, label, legend, caption, tbody, tfoot, thead, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  border: 0 none;
  font: inherit;
  margin: 0;
  padding: 0;
  vertical-align: baseline;
  line-height: 1
}

:root {
  --body-width: 132ex;
}

/*@font-face {*/
/*  font-family: 'Roboto';*/
/*  src: url('../fonts/Roboto-Regular.ttf') format('truetype');*/
/*  font-weight: 400;*/
/*}*/
/*@font-face {*/
/*  font-family: 'Roboto';*/
/*  src: url('../fonts/Roboto-Bold.ttf') format('truetype');*/
/*  font-weight: 700;*/
/*}*/
/*@font-face {*/
/*  font-family: 'Roboto Slab';*/
/*  src: url('../fonts/RobotoSlab-Regular.ttf') format('truetype');*/
/*  font-weight: 400;*/
/*}*/
@font-face {
  font-family: 'Cascadia Mono';
  src: url('../fonts/CascadiaMono-Light.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}


body {
  color: black;
  font-family: Arial, Helvetica, Garuda, sans-serif;
  line-height: 1.5;
  background: none repeat scroll 0 0 #F0F0F0;
  border-collapse: separate;
  max-width: var(--body-width);
  min-width: 70ex;
  min-height: 101%;
  position: relative;
  margin: 0 auto
}




#header {
  background-color: #393939;
  background-image: linear-gradient(#494949, #292929);
  font-family: Arial, Helvetica, Garuda, sans-serif;
  height: 2.3em;
  line-height: 2.3em;
  margin: 0 0 1em 0;
  padding: 0;
  text-align: center;
  font-size: 190%;
  color: white;
  width: 100%;
  border-bottom-left-radius: 1em;
  border-bottom-right-radius: 1em;
  box-shadow: 2px 2px 1em .1em #888;
}

#content {
  box-sizing: border-box;
  width: 100%;
  clear: both;
  position: relative;
  border-top: 2px dashed transparent;
  border-bottom: 1px solid #A1A5A4;
  border-left: 1px solid #A1A5A4;
  border-right: 1px solid #A1A5A4;
  background: none repeat scroll 0 0 #D9E2DF;
  margin-right: 2px;
  margin-top: -1px;
  padding: 0 5px
}

#footer {
  background: none repeat scroll 0 0 #F0F0F0;
  border-top: 1px dotted #818181;
  margin-top: 2em;
  bottom: 0;
  color: #333;
  font: 75% Arial;
  padding-top: 2px;
  position: relative;
  width: 100%
}

.danger::before {
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAA3CAMAAABJoPgRAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABhQTFRFICAg0dHR5+fnr6+v9/f3W1tbAAAA////JKFCFQAAAAh0Uk5T/////////wDeg71ZAAABcUlEQVR42uzVSXLEIAwF0K8J3//GkWUMiKHTiyzDzq5XEoMQuOahBhgtv7H8YZgV+QryhW+gfhmRrZjPkn6DHMY1fYbu+Fn6LLF1sUl0ht2tEge3SJzcLJEd8UkiOS5+ziKsq0TKS+UZtyZNEml+UoZx11CXSOsQlDSkS+T1MomfdA+qTWK3L6GDU5snVlcHIXK/EgdH9ka8K9QldONY7Jmjaa1lZ1Ymp9JW0zbR7xGK7VI+8foBiq9NNinrdl8jhA1fXYmmRL5b0kJSSynz8qgIrnY3bZPydXZveJWMCKbXzmkc4SMjsxDr1j1FEVKRazG7WmYhLdWiCY3uLVyL0svFaKNrVyFiploM2Fy/XHXt2itXRjdc16HXKYvcRTi4sQEsXZHQXWopk0wuN6kks5va3iAnNzfSJme3tOYqF7c2e+/1rFJmt3k+ZLh+v7wzIqC/fLn4bgv/8Lzhn6BflTaKn0z/evsQ3qo6jhr8R4ABACL+Mim30UQFAAAAAElFTkSuQmCC) no-repeat scroll left bottom transparent;
  border: 0 solid red;
  content: " ";
  display: block;
  float: left;
  height: 55px;
  margin-top: 2px;
  margin-right: 5px;
  width: 40px
}

.nobr {
  white-space: nowrap
}

.lesson_data, article, section {
  line-height: 1.5;
  font-family: 'Georgia', Helvetica, Garuda, sans-serif;
  font-size: 0.95rem;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  hyphens: auto;
  background: none repeat scroll 0 0 #FFF;
  border-color: #FFF #ABAFAE #ABAFAE #FFF;
  border-style: solid;
  border-width: 1px;
  margin: 10px 4px;
  padding: 10px 15px;
  position: relative;
  box-shadow: 6px 6px 8px 0 #888
}

.lesson_data p, article p, section p {
  margin-bottom: 1em;
  margin-top: 1em;
  text-align: justify;
  line-height: 1.5
}

.lesson_data img, article img, section img {
  margin: 5px
}

.lesson_data pre, article pre, section pre {
  color: black;
  font-family: 'Cascadia Mono', Consolas, 'Lucida Console', 'DejaVu Sans Mono', monospace;
  line-height: 1;
  margin: 20px auto
}

.lesson_data code, article code, section code {
  color: #006699;
  font-family: 'Cascadia Mono', Consolas, 'Lucida Console', 'DejaVu Sans Mono', monospace;
  white-space: nowrap;
  padding: 0 3px
}

.lesson_data:after, article:after, section:after {
  content: '';
  display: block;
  clear: both
}

article {
  box-shadow: 5px 5px 5px 0 rgba(55, 110, 55, .6);
}

section {
  box-shadow: 5px 5px 5px 0 rgba(110, 55, 55, .6);
}

sup {
  vertical-align: baseline;
  position: relative;
  top: -.4em
}

sub {
  vertical-align: baseline;
  position: relative;
  bottom: -.4em
}

.nodisplay {
  display: none
}

table pre {
  color: black;
  font-family: 'Cascadia Mono', Consolas, 'Lucida Console', 'DejaVu Sans Mono', monospace;
  line-height: 1;
  margin: 5px auto !important
}

h1 {
  margin-top: 22px;
  margin-bottom: 15px
}

h2 {
  margin-top: 15px;
  margin-bottom: 7px
}

h3 {
  margin-top: 15px;
  margin-bottom: 7px
}

h4 {
  margin-top: 10px;
  margin-bottom: 5px
}

.contProblem {
  margin-left: 2em;
}

.contTheory {
  font-weight: bold;
}

.center {
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.flm1 {
  background-color: lightgreen;
  border: thin solid black;
  padding: .2em .4em
}

.flm2 {
  background-color: lightcoral;
  border: thin solid black;
  padding: .2em .4em
}

.spoiler, .spoiler2 {
  overflow: hidden
}

.spoiler::before, .spoiler2::before {
  background: url(spoiler.icon.png) no-repeat scroll left top rgba(0, 0, 0, 0);
  border: 0 solid red;
  content: " ";
  display: block;
  float: left;
  height: 16px;
  margin-top: 2px;
  width: 16px
}

.spoiler.spoiler_open::before, .spoiler2.spoiler2_open::before {
  background: url(spoiler.icon.png) no-repeat scroll left bottom rgba(0, 0, 0, 0)
}

.spoiler .spoiler_title {
  cursor: pointer;
  font-weight: bold;
  font-size: 110%;
  border-bottom: 1px dashed;
  line-height: 1.5;
}

.spoiler2 .spoiler2_title {
  border-bottom: 1px dashed;
  color: #6da3bd;
  cursor: pointer;
  font-weight: normal
}

.spoiler .spoiler_text {
  display: none;
  margin-top: 10px;
  overflow: hidden
}

.spoiler2 .spoiler2_text {
  background: none repeat scroll 0 0 #f9f9f9;
  border: 1px solid #eee;
  display: none;
  margin-top: 10px;
  overflow: hidden;
  padding: 10px
}

.f12 {
  font-size: 120%
}

.f14 {
  font-size: 140%
}

.f16 {
  font-size: 160%
}

.excel {
  font-family: Calibri, Arial, sans-serif;
  line-height: 1;
  font-size: 100%
}

.excel TABLE {
  border-collapse: collapse;
  border-spacing: 0
}

.excel TH {
  background: #dfe3e8;
  text-align: center;
  border: 1px solid #b1b5ba
}

.excel TD {
  background: #fff;
  text-align: center;
  border: 1px solid #dadcdd
}

.excel TH, .excel TD {
  padding: 0 5px;
  margin: -2px 5px;
  min-width: 70px
}

.normtbl {
  margin-bottom: 1em
}

.normtbl TABLE {
  border-collapse: collapse;
  border-spacing: 0;
  overflow-x: scroll
}

.normtbl TH {
  background: #dfe3e8;
  border: 1px solid #b1b5ba;
  font-weight: bold
}

.normtbl TD {
  background: #fff;
  border: 1px solid #dadcdd
}

.normtbl TH, TD {
  padding: 0 5px;
  margin: -2px 5px;
  min-width: 20px;
  line-height: 1.5;
}

.normtbl tr:nth-child(even) td {
  background: #F8F8F8
}

.normtbl tr:nth-child(odd) td {
  background: #FEFEFE
}

.extbl TABLE {
  border-collapse: separate;
  padding: 2px;
  border-spacing: 2px;
  text-align: left
}

.extbl TH {
  background: #ccc
}

.extbl TD, TH {
  border: .5px solid #aaa;
  padding: 2px 5px;
  margin: -2px 5px;
  min-width: 70px;
  vertical-align: top;
  line-height: 1.2;
}

.extbl tr:nth-child(even) td {
  background: #FEFEFE
}

.extbl tr:nth-child(odd) td {
  background: #FBFBFB
}

.bklgreen {
  background-color: #98FB98
}

.bklblue {
  background-color: #87CEEB
}

.bklbrown {
  background-color: #FFDAB9
}

.bklgray {
  background-color: #A9A9A9
}

.bklpink {
  background-color: #FFC0CB
}

summary {
  clear: both;
  overflow: hidden;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #6da3bd
}

details {
  overflow: hidden
}

.answer {
  background-color: rgba(51, 170, 51, .4) !important;
}

/* Примеры тестов */
.python, .cpp, .js, .sql, .tex {
  /* Стили будут добавлены js'ом */
}

.example {
  vertical-align: top;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  margin-top: 0.5em;
  flex-wrap: wrap;
  overflow: hidden;
}

.input, .output, .fcall, .freturn, .fparms,
.optionAns, .trace, .comment, .pyVS, .cppVS, .jsVS, .justblock, .sqlVS, .rustVS, .bashVS {
  display: inline-block;
  border: 1px solid #aaa;
  margin: 2px;
  vertical-align: top;
  color: black;
  line-height: 1.3;
  clear: both;
  padding: 5px;
}


pre .input, pre .output, pre .fcall, pre .freturn, pre .fparms {
  display: inline-block;
}

.traceField {
  margin-top: 2em;
}

.input, .output, .fcall, .freturn, .fparms, .optionAns, .trace, .pyVS, .cppVS, .jsVS, .sqlVS, .rustVS, .bashVS {
  white-space: pre-wrap;
  font-family: 'Cascadia Mono', Consolas, 'Lucida Console', 'DejaVu Sans Mono', monospace;
  min-width: 10em;
}

.optionAns {
  min-width: 12em;
}

.comment {
  white-space: normal;
  max-width: 40%;
}

.input:before {
  content: "INPUT:  📋";
}

.output:before {
  content: "OUTPUT:  📋";
}

.optionAns:before {
  content: "YOUR ANSWER:  📋";
}

.trace::before {
  content: "TRACE"
}

.comment:before {
  content: "Comment";
}

.pyVS:before {
  content: "Python:  📋";
}

.bashVS:before {
  content: "Bash:  📋";
}

.cppVS:before {
  content: "C++:  📋";
}

.jsVS:before {
  content: "Javascript:  📋";
}

.sqlVS:before {
  content: "SQL:  📋";
}

.rustVS:before {
  content: "RUST:  📋";
}

.fcall:before {
  content: "Func Call:  📋";
}

.freturn:before {
  content: "Returns:  📋";
}

.fparms:before {
  content: "Parms:  📋";
}

.input:before, .output:before, .fcall:before, .freturn:before, .fparms:before, .optionAns:before, .trace:before, .comment:before, .pyVS:before, .cppVS:before, .jsVS:before, .sqlVS:before, .rustVS:before, .bashVS:before {
  font-family: 'Georgia', Helvetica, Garuda, sans-serif;
  font-weight: bold;
  display: inline-block;
  background-color: lightgray;
  padding: 5px;
  margin: -5px -5px 5px -5px;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  height: 1.2em;
}

.contIgnore {
}


@media print {
  @page {
    size: A4;
    margin: 8mm 9mm 12mm 9mm; @bottom-right {
    content: counter(page) "/" counter(pages);
  }
  }

  #header {
    background: none;
    color: black;
    border: none;
    box-shadow: none;
    height: 1.3em;
    line-height: 1.3em;
    margin: 0 0 0.3em 0;
  }

  #content, body {
    border: none;
    background: none;
    padding: 0;
  }

  .lesson_data, article, section {
    box-shadow: none;
    border-color: #ABAFAE #FFF #ABABAB #FFF;
    border-style: solid;
    border-width: 1px;
    background: none;
    margin: 0 0;
    padding: 10px 0;
  }

  .input:before {
    content: "INPUT:";
  }

  .output:before {
    content: "OUTPUT:";
  }

  .optionAns:before {
    content: "YOUR ANSWER:";
  }

  .trace::before {
    content: "TRACE"
  }

  .pyVS:before {
    content: "Python:";
  }

  .pyVS:before {
    content: "Bash:";
  }

  .cppVS:before {
    content: "C++:";
  }

  .jsVS:before {
    content: "Javascript:";
  }

  .sqlVS:before {
    content: "SQL:";
  }

  .rustVS:before {
    content: "RUST:";
  }

  .fcall:before {
    content: "Func Call:";
  }

  .freturn:before {
    content: "Returns:";
  }

  .fparms:before {
    content: "Parms:";
  }

  .spoiler, .spoiler2, .spoiler_title, .spoiler2_title, .spoiler_text, .spoiler2_text {
    display: none
  }

  th, tr, td {
    page-break-inside: avoid !important;
  }

  .input, .output, .fcall:before, .freturn:before, .fparms:before, .optionAns, .trace, .comment {
    page-break-inside: avoid !important;
  }

  H1, H2, H3, H4, H5, H6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  h1 + p, h2 + p, h3 + p {
    page-break-before: avoid;
  }

  p {
    orphans: 3;
    widows: 4;
  }
}

/* --- Table of Contents Sidebar --- */

/* Base link style (Mobile/Narrow) */
#doc_toc a {
  display: block; /* Makes them stack without <br> */
  padding: 2px 0;
  line-height: 1.3;
  text-decoration: none;
  color: #555;
  border-left: 3px solid transparent; /* Reserve space for border */
  padding-left: 8px;
}

#doc_toc a:hover {
  color: #000;
  text-decoration: underline;
}

/* Active State */
#doc_toc a.toc-active {
  color: #c0392b;
  font-weight: bold;
  border-left: 3px solid #c0392b; /* Left border for left alignment */
  background-color: rgba(0,0,0,0.03); /* Slight highlight */
  text-decoration: none;
  transition: all 0.1s;
}

/* --- Wide Screen Layout (Sidebar Mode) --- */
@media (min-width: 1500px) {

  /* 1. Shift the main body content to the right */
  body {
    margin-left: max(420px, calc((100vw - var(--body-width)) / 2)) !important;
    max-width: var(--body-width);
  }

  /* 2. Pin the TOC to the left */
  #doc_toc {
    position: fixed;
    left: 20px;
    top: 20px;
    width: 340px; /* Wider as requested */
    bottom: 20px; /* Takes full height minus padding */

    /* Layout & Scroll */
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */

    /* Reset styles */
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 10px 0 0 !important; /* Padding on right for scrollbar space */
    margin: 0 !important;
    z-index: 1000;

    /* Text Formatting */
    text-align: left;
    font-size: 0.9rem;
    word-wrap: break-word; /* Ensure long words wrap */
    white-space: normal;   /* Allow text wrapping */
  }

  #doc_toc h2 {
    display: none;
  }

  /* Subtle Scrollbar */
  #doc_toc::-webkit-scrollbar {
    width: 6px;
  }
  #doc_toc::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
  }
}