:root {
  --color-primary: #485FC7;
  --color-primary-light: #6B82FF;
  --color-primary-dark: #3A4DB3;
  --color-primary-alpha: rgba(72, 95, 199, 0.1);

  --color-surface-primary: #FFFFFF;
  --color-surface-secondary: #F3FBFF;
  --color-surface-tertiary: #F8FAFC;
  --color-surface-hover: #D0E0FF;
  --color-surface-active: #B8D0FF;

  --color-border: #E2E8F0;
  --color-border-light: #F1F5F9;
  --color-border-dark: #CBD5E0;
  --color-warning: #FFF3CD;
  --color-success: #D4EDDA;
  --color-error: #F8D7DA;

  --color-text-primary: #141313;
  --color-text-secondary: #484848;
  --color-text-tertiary: #666666;

  --font-family-primary: 'Arial', sans-serif;
  --font-family-secondary: 'Roboto', sans-serif;
  --font-family-heading: 'Raleway', sans-serif;

  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --font-size-xs: 13px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-md: 20px;
  --font-size-lg: 24px;
  --font-size-xl: 32px;
  --font-size-xxl: 36px;

  --line-height-tight: 1.2;
  --line-height-normal: 1.4;
  --line-height-relaxed: 1.5;

  --spacing-xs: 6px;
  --spacing-sm: 10px;
  --spacing-md: 20px;
  --spacing-lg: 25px;
  --spacing-xl: 36px;
  --spacing-xxl: 48px;

  --border-radius-xs: 4px;
  --border-radius-sm: 8px;
  --border-radius-md: 15px;
  --border-radius-lg: 18px;
  --border-radius-xl: 30px;
  --border-radius-full: 50px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);

  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;

  --primary-color: var(--color-primary);
  --primary-light: var(--color-primary-light);
  --background-light: var(--color-surface-secondary);
  --text-color: var(--color-text-secondary);
  --text-dark: var(--color-text-primary);
  --white: var(--color-surface-primary);
  --font-primary: var(--font-family-primary);
  --font-secondary: var(--font-family-secondary);
  --font-tertiary: var(--font-family-heading);
  --radius-sm: var(--border-radius-sm);
  --radius-md: var(--border-radius-md);
  --radius-lg: var(--border-radius-xl);
}

.column {
  padding-top: 0 !important;
}

.filter {
  background-color: #F3FBFF !important;
  padding: 25px 30px;
  border-radius: 10px;
  margin-top: 0px !important;
  display: flex;
  flex-direction: column;
}

/* .filter_column {
  width: 100% !important; 
} REMOVED WRONG STYLE */

.book-main {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
}

.filter_column {
  flex: 0 0 300px;
  /* Fixed width for sidebar like logic */
  max-width: 30%;
  width: 300px;
}

.frame-15 {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  padding: 3rem;
  margin: 0 auto;
  width: 100%;
  max-width: 1920px;
  z-index: 1;
}

.books-right-col {
  flex: 1;
  width: 0;
  /* Fix flex overflow */
  min-width: 0;
}

.main-search {
  padding: 0 24px;
  width: 100%;
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  margin: 3px 0;
  transition: border-color 0.2s ease;
}

.main-search:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(72, 95, 199, 0.1);
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
}


.card-content .title a {
  color: var(--color-primary);
  text-decoration: none;
}


/* Restore original desktop styles */
.card-content.book-card-flex {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #F3FBFF;
  gap: 20px;
  padding: 0.75rem;
  align-items: stretch;
}

.book-card-image {
  width: 100%;
}

.book-card-image figure.image {
  width: 100%;
  margin-top: 0;
  margin: 0;
}

.book-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile Layout */
@media screen and (max-width: 768px) {
  .frame-15 {
    padding: 1rem;
  }

  /* Hide desktop filters on mobile */
  .filter_column {
    display: none !important;
  }


  /* Show mobile filter button */
  .mobile-filter-button-row {
    display: block !important;
    padding: 10px 0 0 0;
    width: 100%;
  }

  .mobile_filter_toggle {
    display: inline-flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    /* Use margin on text instead */
    background: #F3FBFF;
    border: none;
    border-radius: 10px;
    padding: 14px 24px !important;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.2;
    color: var(--color-primary);
    width: auto;
    min-width: 180px;
  }

  .mobile_filter_toggle .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  .mobile_filter_toggle .icon img {
    width: 100%;
    height: 100%;
    display: block;
  }

  .mobile_filter_toggle>span:not(.icon) {
    white-space: nowrap;
    margin-left: 24px !important;
    /* Explicit fallback for gap */
    position: relative;
    top: -2px;
    /* Lift text slightly */
  }

  /* Stack book cards vertically, full width */
  .book-main {
    flex-direction: column !important;
  }

  .books-right-col {
    width: 100% !important;
  }

  .books-right-col .columns {
    margin: 0 !important;
  }

  .books-right-col .column {
    padding: 0.5rem 0 !important;
    /* Reduce side padding for column */
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Book card layout - perfect match for Screenshot 2 */
  /* Use high specificity to override desktop styles */
  .card-content.book-card-flex {
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 0 !important;
    /* Force override padding */
    overflow: hidden;
    border-radius: 12px;
    height: auto !important;
    /* Allow height to fit content */
    min-height: 180px !important;
    /* Increased minimum height for better cover display */
  }

  /* Fixed-size image container for mobile */
  .card-content.book-card-flex .book-card-image {
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    height: 100% !important;
    min-height: 180px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 12px 0 0 12px !important;
  }

  /* Override Bulma's is-3by4 aspect ratio class with maximum specificity */
  .card-content.book-card-flex .book-card-image figure.image.is-3by4 {
    margin: 0 !important;
    padding: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 100% !important;
    width: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
  }

  /* Image styling with object-fit */
  .card-content.book-card-flex .book-card-image img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    max-height: none !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
  }


  .book-card-info {
    flex: 1;
    padding: 12px 15px !important;
    /* Inner padding for text */
    margin-top: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center text vertically if short */
    background: transparent;
    /* Ensure no white bg overlay */
  }

  /* Filter Panel Overlay */
  .filter_column {
    display: none !important;
  }

  .filter_column.active {
    display: block !important;
    position: static;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 15px;
    z-index: 10;
    background: transparent;
    padding: 0;
    overflow: visible;
  }

  .filter_column.active .sticky {
    position: static;
    width: 100%;
    max-width: 100%;
  }

  /* High specificity to override homework.css */
  @media screen and (max-width: 768px) {
    .filter_column.active .sticky .filter {
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      /* Force children to stretch, removing center alignment */
      justify-content: flex-start !important;
      padding: 24px !important;
      background: #F3FBFF !important;
      border-radius: 12px !important;
      box-shadow: none !important;
      margin: 0 !important;
      width: 100% !important;
      box-sizing: border-box !important;
      text-align: left !important;
    }

    /* Force form to behave as a block block */
    .filter_column.active .sticky .filter form {
      width: 100% !important;
      display: block !important;
      text-align: left !important;
    }

    /* Let Bulma classes handle colors - just fix alignment */
    .filter_column.active .sticky .filter h4 {
      margin-bottom: 20px !important;
      font-size: 28px !important;
      text-align: left !important;
      align-self: flex-start !important;
      /* Ensure it sticks to left */
      width: 100% !important;
    }

    .filter_column.active .sticky .filter .my-3 {
      margin-bottom: 20px !important;
      width: 100% !important;
      text-align: left !important;
      display: block !important;
    }

    .filter_column.active .sticky .filter .my-3 p {
      margin-bottom: 8px !important;
      font-size: 18px !important;
      font-weight: 600 !important;
      text-align: left !important;
      display: block !important;
      width: 100% !important;
      color: #485fc7 !important;
    }

    /* Fix select2 dropdowns in overlay */
    .filter_column.active .sticky .filter .select2-container {
      width: 100% !important;
      max-width: 100% !important;
      display: block !important;
      text-align: left !important;
    }

    .filter_column.active .sticky .filter .select2-selection {
      min-height: 50px !important;
      padding: 10px 14px !important;
      width: 100% !important;
      font-size: 16px !important;
      text-align: left !important;
    }

    .filter_column.active .sticky .filter .select2-selection__rendered {
      text-align: left !important;
    }

    /* Make filter inputs full width */
    .filter_column.active .sticky .filter select,
    .filter_column.active .sticky .filter input {
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
      display: block !important;
      text-align: left !important;
    }

    /* Center button text in purple background */
    .filter_column.active .sticky .filter button[type="submit"] {
      width: 100% !important;
      margin-top: 20px !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      text-align: center !important;
      padding: 18px 20px !important;
      font-size: 18px !important;
      font-weight: 500 !important;
    }
  }

  /* Book card layout - image left, text right */
  .book-card-flex {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 12px !important;
  }

  .book-card-image {
    width: 100px !important;
    flex-shrink: 0;
  }

  .book-card-image figure.image {
    margin: 0 !important;
    width: 100% !important;
  }

  .book-card-image img {
    min-height: auto !important;
    height: auto !important;
    border-radius: 6px;
  }

  .book-card-info {
    flex: 1;
    margin-top: 0 !important;
  }

  .book-card-info .book-title {
    font-size: 14px !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
  }

  .book-card-info-text {
    font-size: 11px !important;
    line-height: 1.4 !important;
  }

  /* Filter panel expands below button when active */
  .mobile_filter_secret.active {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 15px !important;
    z-index: 10;
    background: transparent;
    padding: 0;
    overflow: visible !important;
    height: auto !important;
  }

  /* Pagination layout fix for mobile */
  .paginationjs {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
  }

  .paginationjs-pages {
    float: none !important;
    display: inline-flex !important;
    order: 1;
  }

  .paginationjs-size-changer {
    float: none !important;
    display: inline-flex !important;
    margin-left: 0 !important;
    order: 2;
  }

  .paginationjs-size-changer select {
    width: auto !important;
    margin-bottom: 0 !important;
    padding: 2px 5px !important;
    height: 30px !important;
  }
}




.title.book-title {
  margin-bottom: 0 !important;
}

.book-card-flex .book-title {
  flex-grow: 0;
  margin-bottom: auto;
  margin-top: 0;
}

.tablet-header-row {
  margin: 0 auto !important;
}

.tablet-header-row h1 {
  width: 430px;
  margin-bottom: 0 !important;
  font-family: Raleway;
  font-weight: 700;
  font-style: Bold;
  font-size: 48px;
  line-height: 52px;
  letter-spacing: 0%;

}

.tablet-header-row .custom-width-460 {
  flex: 0 0 430px;
  max-width: 430px;
}

.tablet-header-row .main-search .input {
  border: none !important;
  box-shadow: none !important;
  outline: none;
}

.tablet-header-row .main-search .button.is-info {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.tablet-header-row .main-search .input {
  border: none !important;
  box-shadow: none !important;
  outline: none;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 21px;
  line-height: 23px;
  letter-spacing: 0;
}



.filter-content .field {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  margin-bottom: 0;
}

.filter-content .field {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  margin-bottom: 0;
}

.filter-button {
  display: none;
}

.section-title {
  display: flex;
  width: 90%;
  justify-content: space-between;
}

.section-title-text {
  font-family: var(--font-tertiary);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.1;
  margin: 0;
}

/*Book card стили*/

.book-main {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-lg);
  width: 100%;
  max-width: 1344px !important;
  margin: 0 auto;
}

.book-pic {
  display: flex;
  align-content: center;
  justify-content: center;
  padding: var(--spacing-xs);
  width: 220px;
  height: 349px;
  flex-shrink: 0;
}

.book-cover {
  position: relative;
  object-fit: cover;
  background: url(image.png);
  border-radius: 24px;
  width: 100%;
  height: 100%;
}

.book-description {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 0 0 28px;
  gap: 23px;
  width: 100%;
  max-width: 1200px;
  flex: 1;
}

.book-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  gap: 10px;
  width: 100%;
  max-width: 593.58px;
}

.book-header-text {
  max-width: 565.66px;
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  margin: 0;
}

.description {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding-bottom: var(--spacing-xxl);
  gap: var(--spacing-sm);
  width: 100%;
}

.description-mobile {
  display: none;
}

.description-text {
  width: 100%;
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-normal);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  text-align: justify;
  color: var(--color-text-secondary);
  margin: 0;
}

.tasks {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: var(--spacing-lg);
  gap: var(--spacing-md);
  width: 100%;
  max-width: 1682px;
  background-color: var(--color-surface-secondary);
  border-radius: var(--border-radius-md);
}

.chapter-button {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--spacing-md);
  color: var(--color-primary);
  width: 100%;
  min-width: 460px;
  max-width: 1420px;
  background: var(--color-surface-primary);
  border-radius: var(--border-radius-md);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
}

.chapter-button:hover {
  background-color: var(--color-surface-hover);
  transform: translateY(-1px);
}

.chapter-button:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.chapter-button-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--spacing-md) 0;
  gap: var(--spacing-sm);
  width: 100%;
  max-width: 1308px;
  flex-grow: 1;
}

.chapter-button-text-header {
  width: 100%;
}

.chapter-button-text-header h2 {
  width: 100%;
  margin: 0;
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
}

.subchapter-button {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--spacing-md);
  width: 100%;
  min-width: 20%;
  max-width: 1420px;
  max-height: 138px;
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius-md);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
}

.subchapter-button:hover {
  background-color: var(--color-surface-hover);
  transform: translateY(-1px);
}

.subchapter-button:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.subchapter-button-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--spacing-md) 0;
  gap: var(--spacing-sm);
  width: 100%;
  max-width: 1308px;
  max-height: 138px;
  flex-grow: 1;
}

.subchapter-button-text-header {
  width: 100%;
}

.subchapter-button-text-header h2 {
  width: 100%;
  margin: 0;
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
}

/* Основной заголовок первого уровня (верхний chapter) */
.chapter>.chapter-button .chapter-button-text-header h2 {
  color: var(--color-primary);
}

/* Вложенные заголовки (у вложенных chapters) */
.chapter .chapter .chapter-button-text-header h2 {
  color: var(--color-text-primary);
}


.chapter-button-text-title {
  width: 1308px;
  height: 38px;


  /* Inside auto layout */
  flex: none;
  order: 1;
  align-self: stretch;
  flex-grow: 0;
}

.chapter-button-text-title h3 {
  width: 235px;
  height: 29px;
  font-family: 'Arial';
  font-weight: 700;
  font-size: 24px;
  line-height: 120%;
  color: #485FC7;
}

.chapter-button-arrow {
  /* Auto layout */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 7px;
  gap: 10px;
  background: none;
  border: none;

  width: 68px;
  height: 138px;

  transform: rotate(-180deg);

  /* Inside auto layout */
  flex: none;
  order: 1;
  flex-grow: 0;
}

.chapter-vector {
  width: 18.67px;
  height: 11.08px;

  /* H3 */
  transform: rotate(-180deg);

  /* Inside auto layout */
  flex: none;
  order: 0;
  flex-grow: 0;
}


.chapter-paragraph-head {
  /* Auto layout */
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0px;
  gap: 10px;

  width: 100%;
  max-width: 1376px;
  height: auto;


  /* Inside auto layout */
  flex: none;
  order: 0;
  align-self: stretch;
  flex-grow: 0;
}

.paragraph {
  width: 100%;
}

.paragraph h3 {
  width: auto;
  min-width: 114px;
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-tight);
  color: var(--color-text-secondary);
  margin: 0;
}

.chapter-paragraph-vector-close {
  width: 34px;
  height: 38px;
  transform: rotate(-180deg);
  transition: transform var(--transition-medium);
}

.chapter-paragraph-vector-close img {
  width: 18.67px;
  height: 11.08px;
  display: block;
}

.chapter-paragraph-tasks {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--spacing-lg);
  width: 100%;
  margin-top: var(--spacing-sm);
}

.btn-task {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  gap: var(--spacing-sm);
  box-sizing: border-box;
  min-width: 62px;
  min-height: 62px;
  background: var(--color-surface-secondary);
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-tight);
  color: var(--color-text-secondary);
  text-decoration: none;
}

.btn-task:hover {
  background-color: var(--color-primary);
  color: var(--color-surface-primary);
  transform: translateY(-2px);
}

.btn-task:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-task a {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chapter {
  margin-bottom: var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  background: var(--color-surface-primary);
  width: 100%;
}

.chapter-button {
  width: 100%;
  min-width: 460px;
  margin-right: 0;
}

.chapter-button:hover {
  background: var(--color-surface-hover);
}

.chapter-button-arrow {
  transition: transform var(--transition-medium);
}

details[open] .chapter-button-arrow {
  transform: rotate(180deg);
}


/* Подсветка текущей задачи */
.highlight {
  background-color: var(--color-warning) !important;
  color: var(--color-text-primary) !important;
}

details.chapter[open]>.chapter-button>.chapter-button-arrow img {
  transform: rotate(0deg);
  transition: transform var(--transition-medium);
}


.input.is-fullwidth {
  border: 1px solid var(--color-primary);
  border-radius: var(--border-radius-xs);
  font-family: var(--font-family-secondary);
  font-weight: var(--font-weight-light);
  font-size: 21px;
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  padding: var(--spacing-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input.is-fullwidth:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(72, 95, 199, 0.2);
}

.input.is-fullwidth::placeholder {
  color: var(--color-text-tertiary);
}

.tasks-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: auto;
  width: 100%;
  max-width: 1920px;
  z-index: 1;
}

.filter-content {
  display: flex;
  flex-direction: column;
  max-width: 1420px;
  width: 432px;
  border-radius: var(--border-radius-md);
  padding: var(--spacing-xl) var(--spacing-lg);
  background-color: var(--color-surface-secondary);
  box-shadow: var(--shadow-sm);
}

.close-filter {
  display: none;
}

.btn-filter {
  display: flex;
}

.filter-header {
  max-width: 1304px;
  width: 100%;
}

.filter-form {
  display: flex;
  flex-direction: column;
}

.section-title-text {
  width: 460px;
}


.filter-button {
  display: none;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--border-radius-sm);
  background-color: var(--color-surface-primary);
  transition: background-color var(--transition-fast);
}

.filter-button:hover {
  background-color: var(--color-surface-hover);
}

.filter-button-header {
  max-width: 228px;
  width: 100%;
}

.filter-button-header h3 {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin: 0;
}

/* ==========================================================================
   Form Components
   ========================================================================== */

.apply-filter {
  width: 100%;
  padding: var(--spacing-sm);
  background: var(--white);
  border: 1px solid #ccc;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}


.apply-filter {
  background: var(--primary-color);
  color: var(--white);
  padding: 15px 22px;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.25;
  text-align: center;
  border: none;
  border-radius: 36px;
  transition: background-color 0.2s ease;
}

.apply-filter:hover {
  background: color-mix(in srgb, var(--primary-color) 90%, black);
}

.input.is-fullwidth {
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-secondary);
  font-weight: 300;
  font-size: 21px;
  line-height: 1.1;
  color: var(--text-dark);
  padding: var(--spacing-sm);
  transition: border-color 0.2s ease;
}

.input.is-fullwidth::placeholder {
  color: var(--text-dark);
  opacity: 0.7;
}

.input.is-fullwidth:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(72, 95, 199, 0.1);
}

/* ==========================================================================
   Page Components & Task System
   ========================================================================== */

.tasks-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: initial;
  margin: auto;
  width: 100%;
  max-width: 1920px;
  z-index: 1;
}

/* ==========================================================================
   Task System Components
   ========================================================================== */

.subchapter {
  display: flex;
  flex-direction: column;
}

.subchapter-tasks {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-sm);
}

.layout {
  display: flex;
  gap: var(--spacing-md);
}

.sidebar {
  padding: var(--spacing-md);
  background-color: var(--color-surface-secondary);
  border-right: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
}

.tasks-header {
  display: flex;
  flex-direction: column;
  width: fit-content;
  max-height: 82px;
  background-color: var(--color-surface-primary);
  margin-top: var(--spacing-md);
  margin-bottom: calc(-1 * var(--spacing-md));
  border-radius: var(--border-radius-sm);
}

/* Chapter & Details Components */
details {
  border-left: none !important;
  box-shadow: none !important;
  margin-left: calc(var(--level, 0) * var(--spacing-sm));
}

summary {
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

.tasks-header-1 {
  background-color: var(--color-surface-secondary);
  border-radius: var(--border-radius-md);
}

.tasks-header-2 {
  padding: 0 var(--spacing-md);
  border-radius: var(--border-radius-md);
}

.tasks-header-text {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.tasks-header-text-1 {
  width: auto;
  min-width: 460px;
  max-height: 82px;
  align-items: center;
  justify-content: flex-start;
  display: flex;
  padding: 0 var(--spacing-sm);
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xxl);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
}

.tasks-header-text-2 {
  width: auto;
  max-height: 82px;
  align-items: center;
  justify-content: flex-start;
  display: flex;
  padding: 0 var(--spacing-sm);
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xxl);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
}

.single-task {
  width: fit-content;
  height: 62px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.is-active {
  background-color: var(--color-primary);
  color: var(--color-surface-primary);
  box-shadow: var(--shadow-sm);
}

.task-list {
  margin-top: var(--spacing-md);
  padding: 0;
}

.numbered li {
  list-style-type: decimal;
  margin-bottom: var(--spacing-xs);
}

.bulleted li {
  list-style-type: disc;
  margin-bottom: var(--spacing-xs);
}

.task-description {
  display: flex;
  flex-direction: column;
  width: 65%;
  margin-top: var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  margin-left: auto;
  margin-right: auto;
}

.taskDescriptionArea {
  padding: var(--spacing-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-secondary);
  border-radius: var(--border-radius-xs);
  min-height: 3rem;
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
  resize: vertical;
}

.placeholder {
  color: var(--color-text-tertiary);
  font-style: italic;
}

.chapter-paragraph-tasks {
  box-sizing: border-box;
  width: 100%;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  margin-left: auto;
  margin-right: auto;
}

.subchapters {
  background-color: var(--color-surface-primary);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-sm);
}


/* ==========================================================================
   Responsive Design - Tablet Layout (886px - 1200px)
   ========================================================================== */

@media (min-width: 769px) and (max-width: 1023px) {
  .tasks-page {
    width: 100%;
    max-width: 100%;
  }

  .tablet-header-row h1 {
    width: 390px;
  }

  .tablet-header-row .custom-width-460 {
    flex: 0 0 390px;
    max-width: 390px;
  }

  .frame-15 {
    width: 100%;
    max-width: 100%;
    top: 160px;
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    padding-bottom: 160px;
  }

  /* Responsive Structure for Tablets */
  .book-main {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-width: 100%;
  }

  /* Header Row: Title and Search */
  .tablet-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
    width: 100%;
    margin-bottom: var(--spacing-md);
  }

  .section-title-text {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
    order: 1;
  }

  .main-search {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-full);
    flex: 1;
    min-width: 300px;
    order: 2;
  }

  /* Filter Row */
  .tablet-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: var(--spacing-md);
    background-color: #F3FBFF;
    border-radius: 16px;
  }

  .books-left-col {
    width: 100%;
  }

  .filter-mini-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
  }

  .filter-button {
    display: block;
    background-color: var(--color-surface-secondary);
  }

  .filter-button h3 {
    color: var(--color-text-primary);
    font-family: var(--font-family-secondary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-md);
    line-height: var(--line-height-normal);
    text-align: center;
    margin: 0;
  }

  .btn-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xs) var(--spacing-md);
    color: var(--color-primary);
    line-height: var(--line-height-tight);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    background-color: transparent;
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
  }

  .btn-filter:hover {
    background-color: var(--color-surface-hover);
  }

  /* Pagination Row */
  .tablet-pagination-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: var(--spacing-md);
  }

  .tablet-pagination-row .pages {
    display: flex;
    justify-content: flex-end;
    order: 4;
    width: 100%;
  }



  .book {
    max-width: 100%;
  }

  .book-main {
    padding: 5px 0;
    max-width: 100%;
    flex-direction: column;
  }

  .book-pic {
    width: 153.46px;
    height: 219px;
  }

  .book-cover {
    border-radius: var(--border-radius-sm);
  }

  .book-description {
    width: auto;
    max-width: 90%;
    padding: 0 var(--spacing-sm);
  }

  .book-header {
    max-width: 100%;
  }

  .book-header-text {
    font-size: var(--font-size-xl);
    width: 90%;
  }


  .description-mobile {
    display: none;
  }

  .description {
    max-width: 90%;
  }

  .description-text {
    font-size: var(--font-size-sm);
    max-width: 100%;
  }

  .tasks {
    width: 100%;
    max-width: 100%;
    padding: 0 var(--spacing-md);
  }

  .chapter {
    display: flex;
    flex-direction: column;
    max-width: 100%;
  }

  .chapter-button {
    width: 370px;
    padding: var(--spacing-sm);
    font-size: var(--font-size-xs);
    gap: var(--spacing-xs);
    margin-right: var(--spacing-sm);
  }

  .chapter-button-text {
    max-width: 250px;
  }

  .chapter-button-text-header h2 {
    font-size: var(--font-size-base);
  }

  .chapter-button-arrow {
    width: 22px;
    height: 22px;
  }

  .chapter-vector {
    max-width: 14px;
    max-height: 14px;
  }



  .subchapters {
    display: flex;
    flex-direction: column;
    width: 95%;
  }

  .chapter-paragraph-head {
    max-width: 60px;
  }

  .paragraph {
    max-width: 60px;
  }

  .paragraph h3 {
    font-size: var(--font-size-xs);
  }

  .chapter-paragraph-vector-close {
    width: 20px;
    height: 20px;
  }

  .btn-task {
    font-size: var(--font-size-base);
    padding: var(--spacing-xs) var(--spacing-sm);
    box-sizing: border-box;
    width: 64px;
    height: 64px;
  }


  .btn-filter {
    display: flex;
    max-height: 48px;
    height: auto;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xs) var(--spacing-md);
    color: var(--color-primary);
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-normal);
    font-size: 18px;
    line-height: var(--line-height-tight);
  }

  .filter-content.active {
    display: flex;
  }

  .close-filter {
    display: flex;
    background: none;
    border: none;
    font-size: var(--font-size-md);
    align-self: flex-end;
    cursor: pointer;
    color: var(--color-text-primary);
  }

  .filter-header {
    max-width: 1304px;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }


  .filter-button {
    display: flex;
    flex-direction: row;
    border-radius: var(--border-radius-md);
    justify-content: space-between;
    align-items: center;
  }

  .filter-button-header {
    max-width: 228px;
    width: 100%;
  }

  .filter-button-header h3 {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-tight);
    color: var(--color-primary);
    margin: 0;
  }

  .apply-filter {
    width: 100%;
    padding: 10px;
    background: white;
    border: 1px solid #ccc;
    cursor: pointer;
  }

  .apply-filter {
    background: #4c7df3;
    color: white;
  }

  .tasks-header {
    display: flex;
    flex-direction: column;
  }

  .tasks-header-text-1 {
    width: auto;
    height: auto;
    min-width: auto;
    max-height: 82px;
    align-items: center;
    justify-content: flex-start;
    display: flex;
    padding: 0 10px;
    margin-right: auto;

    /* H2 */
    font-family: Raleway;
    font-weight: 700;
    font-size: 36px;
    line-height: 42px;
    letter-spacing: 0%;
    color: #485FC7;
  }

  .tasks-header-text-2 {
    margin-right: auto;
  }

  .has-addons {
    margin-left: 50%;
  }

  .tasks-header-text {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    height: auto;
    max-height: 82px;
  }

  .subchapter-body {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
  }

  .is-size-6 {
    white-space: nowrap;
    padding-right: 20px;
  }



  .frame-16 {
    padding: 0px !important;
  }

  .delite {
    font-size: 0 !important;
    padding-left: 20px;
    padding-right: 0;
  }

  .delite::before {
    display: flex;
    padding-right: 0px;
    padding-left: 20px;
    content: "";
    background-image: url('/static/img/books/Bookmark.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 24px;
    height: 24px;
  }

  .favor::before {
    display: flex;
    padding-right: 0px;
    padding-left: 20px;
    content: "";
    background-image: url('/static/img/books/Bookmark.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 24px;
    height: 24px;
  }

  .chapter-paragraph-tasks {
    width: auto;
    max-width: 95%;
  }

  .task-description {
    width: fit-content;
    margin-left: 0;
    margin-right: 0;
  }

  .tasks-list {
    width: 70%;
  }


  .has-addons {
    display: flex;
    flex-direction: row;
    margin-left: 0;
    left: 0;
  }

  /* Стили для модального окна фильтра */
  .filter-content {
    display: none;
    position: fixed;
    top: 50%;
    left: 0%;
    transform: translate(0%, -25%);
    width: 90%;
    max-width: 500px;
    background-color: #F3FBFF;
    border-radius: 20px;
    padding: 30px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    flex-direction: column;
  }

  .filter-content.active {
    display: flex;
    flex-direction: column;
  }

  .close-filter {
    display: flex;
    background: none;
    border: none;
    font-size: 24px;
    align-self: flex-end;
    cursor: pointer;
    color: #485FC7;
    margin-bottom: 10px;
  }

  .filter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .filter-subtitle {
    font-weight: 600;
    color: #485FC7;
    font-size: 16px;
  }

  .apply-filter {
    background: #485FC7;
    color: white;
    padding: 15px 22px;
    font-weight: 600;
    font-size: 18px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    margin-top: 20px;
  }

  .paginationjs {
    justify-content: flex-end !important;
  }

}

/* Стили для таблетов - показываем специальные контейнеры только на таблетах */
.tablet-header-row,
.tablet-filter-row,
.tablet-pagination-row {
  display: none;
}

/* Скрываем мобильные элементы по умолчанию */
.mobile-header,
.mobile-search,
.mobile-filter-row,
.mobile-pagination-row {
  display: none;
}

@media (min-width: 886px) and (max-width: 1200px) {

  /* Показываем специальные контейнеры для таблетов */
  .tablet-header-row,
  .tablet-filter-row,
  .tablet-pagination-row {
    display: flex;
  }
}

.tablet-filter-row {
  padding: 18px 24px;
}

details {
  border-left: none !important;
  /* Убирает левую границу */
  box-shadow: none !important;
  /* Убирает возможную тень */
}

summary {
  list-style: none;
  /* Убирает стандартный маркер */
}

summary::-webkit-details-marker {
  display: none;
  /* Убирает маркер в WebKit (Chrome, Safari) */
}



.tasks-list.expanded .btn-task {
  display: none;
  height: 0px;
}



@media (max-width: 768px) {
  .tasks-page {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: initial;
    gap: 10px;
    width: 393px;
    top: 80px;
  }

  .mobile-nav {
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    padding-bottom: 8px;
  }

  .mobile-nav.active-tab {
    color: #485fc7 !important;
  }

  /* Active tab indicator (underline) */
  .mobile-nav.active-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #485fc7;
    border-radius: 2px;
  }

  /* Ensure content takes full width on mobile */
  .mobile-toc,
  .right-content {
    width: 100% !important;
  }

  /* Hide inactive content on mobile */
  .mobile-toc.hidden,
  .right-content.hidden {
    display: none !important;
  }

  /* Mobile mode switcher */
  .mobile-mode-switcher {
    display: flex !important;
  }

  .books-left-col {
    display: none;
  }

  .mobile-mode-switcher {
    display: none !important;
  }



  .book-content {
    padding: 12px !important;
    background-color: transparent !important;
  }

  .toc-item {
    padding: 0px !important;
  }

  .toc-title {
    padding-left: 0px !important;
    margin-bottom: 0px !important;
  }

  .frame-16 {
    padding: 12px !important;
    margin-top: 100px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .frame-15 {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 16px 160px;
    width: 393px;
    top: 80px;
  }

  #mobile-site-search {
    background-color: transparent;
    font-family: Roboto;
    font-weight: 400;
    font-style: Regular;
    font-size: 14px;
    line-height: 19px;
    letter-spacing: 0%;

  }

  /* Скрываем планшетные элементы на мобильных */
  .tablet-header-row,
  .tablet-filter-row,
  .tablet-pagination-row {
    display: none !important;
  }

  .tablet-header-row .custom-width-460 {
    flex: 0 0 100%;
  }

  .input.is-fullwidth {
    background-color: white;
    font-size: 14px;
  }

  .input.is-fullwidth::placeholder {
    color: #485FC7;
  }


  .mobile-filter-row {
    margin-bottom: 0;
  }

  /* Показываем мобильные элементы */
  .mobile-header,
  .mobile-search,
  .mobile-filter-row,
  .mobile-pagination-row {
    display: block;
    width: 100%;
  }

  .mobile-header {
    margin-bottom: 16px;
  }

  .mobile-header .section-title-text {
    font-family: 'Arial';
    font-weight: 700;
    font-size: 24px;
    line-height: 28px;
    color: #484848;
    margin: 0;
  }

  .mobile-search {
    margin-bottom: 16px;
  }

  .mobile-search .main-search {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 14px 16px;
    gap: 18px;
    background: #F3FBFF;
    border-radius: 30px;
  }

  .mobile-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F3FBFF;
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 16px;
  }

  .mobile-filter-row .filter-mini-title {
    font-size: 16px;
    font-weight: 600;
    color: #484848;
    margin: 0;
  }

  .mobile-filter-row .btn-filter {
    background: #F3FBFF;
    color: #141313;
    border: none;
    border-radius: 8px;
    height: 44px !important;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 12px 16px;
    max-height: none !important;
    width: 157px;
  }

  .column {
    padding-bottom: 0px;
  }

  .book-main {
    padding-top: 0px !important;
  }

  .mobile-pagination-row {
    margin-top: 24px;
    display: flex;
    justify-content: center;
  }

  .main-search {
    /* Auto layout */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 24px;
    gap: 2px;

    height: auto;

    /* Background */
    background: #F3FBFF;
    border-radius: 30px;

    /* Inside auto layout */
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
  }

  .book {
    /* Auto layout */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;

    width: 361px;
    height: auto;


    /* Inside auto layout */
    flex: none;
    order: 1;
    align-self: stretch;
    flex-grow: 0;
  }

  .book-main {
    /* Auto layout */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 0px;

    width: 361px;
    height: 100%;


    /* Inside auto layout */
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 1;
  }

  .book-pic {
    /* Book / Pic */

    width: 98.89px;
    height: 142px;
    padding-top: 10px;


    /* Inside auto layout */
    flex: none;
    order: 0;
    flex-grow: 0;
  }

  .book-cover {
    position: relative;
    left: 0px;
    top: 0px;

    background: url(image.png);
    border-radius: 15.4375px;
  }

  .book-description {
    /* Auto layout */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px 0px 0px 8px;
    gap: 6px;

    width: 294.12px;
    height: auto;


    /* Inside auto layout */
    flex: none;
    order: 1;
    flex-grow: 1;
  }

  .book-header {
    /* Auto layout */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 10px;

    width: 254.11px;
    height: auto;


    /* Inside auto layout */
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
  }

  .book-header-text {
    width: 254.11px;
    height: auto;

    /* H2 */
    font-family: 'Arial';
    font-style: normal;
    font-weight: 700;
    font-size: 20px;
    line-height: 23px;

    color: #485FC7;


    /* Inside auto layout */
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
  }








  .description {
    display: none;
  }

  .description-mobile {
    /* Auto layout */
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 0px 0px 24px;
    gap: 10px;

    max-width: 361px;
    height: auto;


    /* Inside auto layout */
    flex: none;
    order: 2;
    align-self: stretch;
    flex-grow: 0;
  }

  .description-text {
    box-sizing: border-box;
    height: auto;

    /* Mobile/Text */
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 120%;
    /* or 17px */
    text-align: justify;

    /* Text */
    color: #484848;


    /* Inside auto layout */
    flex: none;
    order: 0;
    flex-grow: 1;
  }

  .tasks {
    /* Auto layout */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 12px;

    max-width: 361px;
    height: auto;


    /* Inside auto layout */
    flex: none;
    order: 3;
    align-self: stretch;
    flex-grow: 0;
  }

  .chapter {
    max-width: 100%;
    width: 100%;
  }

  .chapter-button {
    display: flex;
    flex-direction: row-reverse;
    padding: 10px 5px;
    font-size: 16px;
    gap: 10px;
    width: 85%;
    margin-left: 40px;
  }

  .chapter-button-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 8px;

    min-width: 0;
    max-width: 293px;
    height: auto;


    /* Inside auto layout */
    flex: none;
    order: 0;
    flex-grow: 1;
  }

  .chapter-button-text-header {
    max-width: 293px;
    height: auto;


    /* Inside auto layout */
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
  }

  .chapter-button-text-header h2 {
    font-size: 18px;
    /* Заголовки меньше */
  }

  .chapter-button-text-title {
    width: 293px;
    height: 17px;


    /* Inside auto layout */
    flex: none;
    order: 1;
    align-self: stretch;
    flex-grow: 0;
  }

  .chapter-button-text-title h3 {
    position: absolute;
    width: 137px;
    height: 17px;
    left: 0px;
    top: 0px;

    /* Mobile/H3 */
    font-family: 'Arial';
    font-style: normal;
    font-weight: 700;
    font-size: 14px;
    line-height: 120%;
    /* identical to box height, or 17px */

    /* H3 */
    color: #485FC7;
  }

  .chapter-button-arrow {
    width: 20px;
    /* Кнопка меньше */
    height: 20px;
  }

  .chapter-vector {
    max-width: 16px;
    /* Иконка стрелки уменьшается */
    max-height: 16px;
  }

  .tasks {
    width: 100%;
    max-width: 100%;
    padding: 0 10px;
    /* Добавляем боковые отступы */
    background-color: #FFFFFF;
  }

  .chapter-paragraph-head {
    /* Auto layout */
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 0px;

    max-width: 67px;
    height: auto;


    /* Inside auto layout */
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
  }

  .paragraph {
    max-width: 67px;
    height: auto;


    /* Inside auto layout */
    flex: none;
    order: 0;
    flex-grow: 0;
  }

  .paragraph h3 {

    /* H3 */
    font-family: 'Arial';
    font-style: normal;
    font-weight: 700;
    font-size: 14px;
    line-height: 120%;
    /* identical to box height, or 29px */

    /* Text */
    color: #484848;
  }

  .chapter-paragraph-vector-close {
    width: 24px;
    height: 24px;

    /* Inside auto layout */
    flex: none;
    order: 1;
    flex-grow: 0;
  }

  .chapter-paragraph-vector-close img {
    position: absolute;
    left: 81.25%;
    right: -37.5%;
    top: 65%;
    bottom: 5%;
  }

  .chapter-paragraph-tasks {
    /* Auto layout */
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 16px 5px;

    width: auto;
    width: 90%;
    max-width: 100%;
    height: auto;

    /* Background */
    border-radius: 15px;

    /* Inside auto layout */
    flex: none;
    order: 2;
    align-self: stretch;
    flex-grow: 0;
  }

  .btn-task {
    font-size: 12px;
    /* Кнопки компактнее */
    padding: 5px 10px;
    box-sizing: border-box;
    width: 60px;
    /* Ширина кнопок меньше */
    height: 60px;
    /* Высота кнопок меньше */
  }

  .btn-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    max-height: 38px;
    height: auto;
    border-radius: 18px;
    padding: 8px 16px;
    background-color: #FFFFFF;
    color: #485FC7;
    font-family: Roboto, Arial, Helvetica, sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 120%;
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .btn-filter:hover {
    background-color: #F3FBFF;
    border-color: #485FC7;
  }

  .btn-filter .icon {
    display: flex;
    align-items: center;
  }

  .mobile-filter-row {
    display: flex !important;
    padding: 12px 0;
    margin-bottom: 16px;
  }

  .mobile-filter-row .column {
    padding: 0 !important;
  }

  .filter {
    background-color: #F3FBFF !important;
    padding: 20px;
    border-radius: 16px;
    margin-top: 0 !important;
  }

  .mobile_filter_secret {
    display: none;
    margin-top: 16px;
  }

  .mobile_filter_secret.active {
    display: block;
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .column.is-one-quarter {
    width: 100% !important;
    max-width: 100%;
    padding: 0.75rem !important;
  }

  .columns.is-multiline {
    margin: 0 -0.75rem;
  }

  .card {
    height: auto;
  }

  .book-card-flex {
    flex-direction: column;
  }

  .book-card-flex .book-card-image {
    width: 100%;
    max-width: 100%;
  }

  .book-card-flex .book-card-image img {
    width: 100%;
    height: auto;
    min-height: 200px;
  }

  .book-main {
    flex-direction: column;
    padding: 0 16px;
  }

  .books-left-col {
    width: 100% !important;
    order: 1;
  }

  .books-right-col {
    width: 100% !important;
    order: 2;
  }

  .filter_column {
    width: 100% !important;
  }

  .sticky {
    position: static !important;
  }

  .tablet-header-row {
    flex-direction: column;
    gap: 16px;
  }

  .tablet-header-row .custom-width-460 {
    flex: 1;
    max-width: 100%;
    width: 100%;
  }

  .tablet-header-row h1 {
    width: 100%;
    font-size: 32px;
    line-height: 1.2;
  }

  .tablet-header-row .is-expanded {
    width: 100%;
  }

  .frame-15 {
    padding: 1.5rem 1rem;
  }

  .filter h4 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .filter .my-3 {
    margin: 12px 0 !important;
  }

  .filter button[type="submit"] {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }

  .select2-container {
    width: 100% !important;
  }

  .tablet-filter-row {
    display: none;
  }


  .subchapter {
    display: flex;
    flex-direction: column;
  }

  .subchapter-tasks {
    display: flex;
    flex-direction: column;
  }

  .tasks-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 50px;
    height: 47px;
  }

  .tasks-header-1 {
    background-color: #FFFFFF;
  }

  .tasks-header-2 {
    position: relative;
    background-color: #F3FBFF;
    color: Blue;
  }

  .has-addons {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .columns.is-vcentered {
    align-items: flex-start;
  }

  .control {
    width: auto;
  }

  .input {
    width: 100%;
    background-color: #F3FBFF;
  }

  .button.is-light.is-active,
  .button.is-light:active {
    background-color: white !important;
    color: #485FC7 !important;
  }

  .button.is-light {
    background-color: white;
  }

  .tasks-header-text {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    height: auto;
    max-height: 82px;
    margin-bottom: 10px;
  }

  .tasks-header-text-1 {
    min-width: auto;
    font-family: Raleway;
    font-weight: 700;
    font-style: Bold;
    font-size: 22px;
    line-height: 23px;
    letter-spacing: 0%;
  }

  .tasks-header-text-2 {
    font-family: Raleway;
    font-weight: 700;
    font-style: Bold;
    font-size: 22px;
    line-height: 23px;
    letter-spacing: 0%;
  }

  .delite {
    font-size: 0 !important;
    padding-left: 20px;
    padding-right: 0;
  }

  .delite::before {
    display: flex;
    padding-right: 0px;
    padding-left: 20px;
    content: "";
    background-image: url('/static/img/books/Bookmark.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 24px;
    height: 24px;
  }

  .favor::before {
    display: flex;
    padding-right: 0px;
    padding-left: 20px;
    content: "";
    background-image: url('/static/img/books/Bookmark.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 24px;
    height: 24px;
  }

  .section-title-text {
    font-family: Raleway;
    font-weight: 700;
    font-style: Bold;
    font-size: 28px;
    line-height: 34px;
    letter-spacing: 0%;
  }

  .books-favorites-text {
    display: none;
  }

  .tablet-header-row {
    display: flex !important;
    flex-direction: column !important;
  }

  .column {
    width: 100vw;
  }

  .books-favorites-text-mobile {
    display: inline;
    font-family: Raleway;
    font-weight: 400;
    font-style: Regular;
    font-size: 12px;
    line-height: 100%;
    letter-spacing: 0%;
  }

  .books-favorites {
    width: 130px;
    height: 40px;
    opacity: 1;
    padding: 8px 12px;
    gap: 8px;
    border-radius: 8px;
  }

  .tasks-list {
    width: 60%;
  }

  .tasks-list.expanded {
    height: 0px;
  }

  .table-of-contents {
    margin-top: 12px;
    width: 100%;
  }
}


/* Мобильные устройства (до 768px) */
@media (max-width: 885px) {
  .frame-15 {
    top: 15px;
    padding: 0 16px 160px;
    margin: 0 0;
  }

  .paginationjs {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0;
  }

  .mobile-filter-row {
    background-color: transparent;
  }


  .section-title-text {
    font-size: clamp(20px, 6vw, 28px);
  }

  .book-description {
    padding: 0;
  }

  .book-header-text {
    font-size: clamp(16px, 4vw, 24px);
  }

  .book-card-flex .book-card-image {
    flex: 0 0 auto;
    margin-right: var(--spacing-sm);
  }

  .book-card-flex .book-card-image figure.image {
    width: 100px;
    height: 150px;
  }

  .book-card-flex .book-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    min-height: auto;
  }

  .card-content.book-card-flex {
    flex-direction: row;
  }
}

/* На планшетах и выше вернем вертикальную раскладку */
@media (min-width: 885px) {
  .book-card-flex {
    flex-direction: column;
    align-items: stretch;
  }

  .book-card-flex .book-card-image {
    margin-bottom: var(--spacing-sm);
  }

  .mobile-filter-row {
    display: none !important;
  }
}

/* Десктопы */
@media (min-width: 1200px) {
  .pages .paginationjs {
    justify-content: flex-start;
  }

  .pages .paginationjs-pages {
    margin-right: 16px;
  }

  .tablet-header-row {
    z-index: 10;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start;
    gap: 32px;
    width: 100%;
    max-width: 1344px;
    margin-bottom: 52pxg;
    min-height: 80px;
    margin: 0 auto;
  }

  .book-main {
    position: relative;
    padding-top: 24px;
  }

  .section-title-text {
    display: block !important;
    margin: 0;
    width: 460px;
  }

  .main-search {
    display: flex !important;
    align-items: center;
    flex: 1 1 0%;
  }
}


/*Большие экраны*/
@media (min-width: 1600px) {
  .frame-15 {
    padding: 0 64px 160px;
  }

  .book-main {
    max-width: none;
    gap: var(--spacing-xl);
  }

}

/* Очень большие экраны (1920px+) */
@media (min-width: 1920px) {
  .frame-15 {
    padding: 0 128px 160px;
  }
}

/* Улучшение рендеринга */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
  .book-cover {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Оптимизация движения */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Поддержка темного режима */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #6B82FF;
    --background-light: #2A2A2A;
    --text-color: #E5E5E5;
    --text-dark: #FFFFFF;
    --white: #1E1E1E;
  }
}

/* Стили для печати */
@media print {
  .frame-15 {
    top: 0;
    position: static;
  }

  .filter-content,
  .btn-filter,
  .close-filter,
  .pages {
    display: none !important;
  }


  .book {
    break-inside: avoid;
    margin-bottom: 1cm;
  }
}

/* Оптимизация производительности */
.book-cover,
.search-icon img {
  will-change: transform;
}

.filter-content {
  contain: layout style paint;
}



.paginationjs-pages ul li.paginationjs-page {
  width: 35px !important;
  height: 35px !important;
  margin-right: 8px !important;
}

.paginationjs-prev.disabled>a {
  font-size: 24px;
  text-align: center;
  font-weight: 400;
  color: #485FC7;
}

li.paginationjs-prev.J-paginationjs-previous>a {
  font-size: 24px;
  color: var(--color-primary);
  padding: var(--spacing-xs);
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
}

.paginationjs-next.disabled>a {
  font-size: 24px;
  text-align: center;
  color: #485FC7;
  font-weight: 400;
}

li.paginationjs-next.J-paginationjs-next>a {
  font-size: 24px;
  color: var(--color-primary);
  padding: var(--spacing-xs);
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
}

.paginationjs-pages ul {
  align-items: center;
}

.paginationjs-size-changer select {
  margin-left: 12px;
  width: 63px;
  height: 40px;
}


.columns.is-variable>.column {
  padding-right: 0 !important;
}

/* Адаптивный контейнер для видео (YouTube, VK, Rutube и др.) */
.video-wrapper {
  position: relative;
  width: 100%;
  /* Соотношение сторон 16:9 */
  padding-bottom: 56.25%;
  margin: var(--spacing-md) 0;
  overflow: hidden;
}

.video-wrapper iframe,
.video-wrapper embed,
.video-wrapper object {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.preloader_new {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.books-right-col {
  position: relative;
  /* Добавить для корректного позиционирования прелоадера */
}



.book-main {
  display: flex;
  align-items: stretch;
  gap: var(--spacing-lg);
  width: 100%;
  max-width: 1344px !important;
  margin: 0 auto;
}

.books-left-col {
  height: auto !important;
  flex: 0 0 auto;
  width: 33.33333%;
}

.sticky {
  width: 100%;
}

.books-right-col {
  flex: 1;
}

.columns.is-multiline {
  margin-top: 0 !important;
}



.icon-24 {
  width: 24px;
  height: 24px;
}

.favs-button {
  background-color: #F3FBFF;
  border-radius: 16px;
  border: none;
  cursor: pointer;
}

.book-content {
  padding: 50px 50px;
  border-radius: 56px;
  background-color: #F3FBFF;
  margin-top: 44px;
}

/* Стили для интерактивного оглавления */
.table-of-contents {
  max-height: 90vh;
  overflow-y: auto;
  padding-right: 10px;
}

.toc-item {
  background-color: white;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 12px;
}


.toc-item.active {
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 4px;
}

.toc-title {
  display: flex;
  align-items: center;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 16px;
  padding: 12px;
}


.toc-item.active .toc-title {
  color: #3A4DB3;
}

.toc-subtitle {
  font-size: 14px;
  color: #333333;
  margin: 20px 0px;
}

.toc-item.active .toc-subtitle {
  color: #141313;
  font-weight: 500;
}

/* Стили для текста рядом с toc-icon */
/* По умолчанию весь текст черный */
.toc-icon+span {
  color: #141313;
}

/* Синий цвет только для активных иконок */
.toc-icon[src*="tog-active.svg"]+span {
  color: #485FC7 !important;
}

/* Стили для основного уровня (только прямые дети toc-title в активном toc-item) */
.toc-item.active>.toc-title .toc-icon+span {
  color: #485FC7 !important;
}

/* Стили для задач в подтемах */
.subtopic-section .mode-btn {
  margin-right: 8px;
  background-color: transparent !important;
  background: transparent !important;
  box-shadow: none;
}

.subtopic-section .mode-btn.is-active {
  background-color: transparent !important;
  background: transparent !important;
  color: #485FC7;
}

.subtopic-section .homework_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.subtopic-section .homework_text {
  line-height: 1.6;
}

.subtopic-section .secret {
  background-color: #f3fbff;
  padding: 12px;
  border-radius: 4px;
  border-left: 4px solid #485FC7;
}

.subtopic-section .rubricator {
  background-color: #f8fafc;
  padding: 12px;
  border-radius: 4px;
  margin: 12px 0;
}

.toc-chapters {
  padding: 12px;
  display: none;
}

.toc-subtitle img {
  width: 20px;
  height: 20px;
}

.toc-item.expanded .toc-chapters {
  display: block;
}

.toc-subitem {
  margin: 8px 0;
  cursor: pointer;
  transition: all 0.3s ease;
}


.toc-subitem.active {
  background-color: #E3F2FD;
  border-radius: 4px;
  padding: 6px 16px;
  margin: 2px -6px;
}

.toc-subtitle-small {
  font-size: 13px;
  color: #485FC7;
  font-weight: 500;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
}

.toc-subchapter-name {
  font-size: 12px;
  color: #666666;
  margin-bottom: 4px;
}

.toc-subitem.active .toc-subchapter-name {
  color: #141313;
  font-weight: 500;
}

.toc-subsubitem {
  margin: 4px 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toc-subsubitem.active {
  background-color: #EBF3FD;
  border-radius: 4px;
  padding: 4px 20px;
  margin: 0px -4px;
}

.toc-tasks {
  margin: 6px 0;
  margin-left: 20px;
}

.task-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.task-number {
  background-color: #F8FAFC;
  color: #485FC7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid #E2E8F0;
}

.content-section {
  animation: fadeIn 0.3s ease-in;
}

.content-subsection {
  animation: fadeIn 0.3s ease-in;
}

.content-subsubsection {
  margin-left: 40px;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chapter-description {
  background-color: white;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #485FC7;
}

.chapter-description p {
  margin: 0;
  color: #484848;
  line-height: 1.5;
}

.tasks-list {
  background-color: white;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.task-item {
  display: inline-block;
  margin-right: 8px;
}

.task-button {
  background-color: #F3FBFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 6px 12px;
  color: #485FC7;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-button:hover {
  background-color: #E8F4FD;
  border-color: #485FC7;
}

.task-button:active,
.task-button.active {
  background-color: #485FC7;
  color: white;
}

.task-description {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  min-height: 100px;
}

.placeholder {
  color: #999;
  font-style: italic;
}

.placeholder:before {
  content: "Выберите задачу для просмотра";
}

.book-name {
  line-height: 1.5;
}


/* Стили для контейнера выбранной задачи */
.selected-task-container {
  margin-top: 1rem;
}

.selected-task-container .box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

/* Улучшенные стили для режимов отображения */
.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 0.5rem;
  border: none;
}

.mode-btn:hover {
  background: #f5f5f5;
  border-color: #b5b5b5;
}

.mode-btn.is-active {
  color: #485fc7;
}

.numbered-mode {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
  align-items: flex-start;
  justify-items: flex-start;
  width: 100%;
  max-width: 100%;
}

.numbered-mode[style*="display: flex"] {
  display: flex;
}

.list-mode {
  width: 100%;
}

.list-mode[style*="display: block"] {
  display: block;
}

.numbered-mode .task-btn {
  flex: 0 0 auto;
}

.tasks-list {
  min-height: 50px;
}

.tasks-list:empty::after {
  content: "Задачи не найдены";
  color: #999;
  font-style: italic;
}

.task-btn {
  background-color: #F3FBFF;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #484848;
  border: none;
  border-radius: 12px;
  width: 82px;
  height: 82px;
  min-width: 62px;
  min-height: 62px;
  max-width: 82px;
  max-height: 82px;
  font-weight: 600;
  font-size: 24px;
  line-height: 30px;
  letter-spacing: 0%;
  text-align: center;
  vertical-align: middle;
  flex-shrink: 0;
  flex-grow: 0;
  margin: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.task-btn:hover {
  box-shadow: 4px 4px 16px 0px #0B044029;
}

.task-btn:active,
.task-btn.active-state {
  border: 1px solid #485fc7 !important;
  color: #485fc7 !important;
}

.task-btn.is-primary,
.task-btn.is-primary:hover,
.task-btn.is-primary:focus {
  background-color: #F3FBFF !important;
  color: #485fc7 !important;
  border: 1px solid #485fc7 !important;
  box-shadow: 0 4px 12px rgba(72, 95, 199, 0.4) !important;
  transform: translateY(-1px);
}

.selected-task-container {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background-color: #ffffff;
}


.subtopic-section h4 {
  color: #485FC7
}

.delite {
  color: #485FC7
}

.right-content {
  background-color: white;
}

.subtopic-section .buttons p.mr-3 {
  color: #485fc7;
  /* Синий цвет */
}

.favour.delite {
  color: orange !important;
}

.rubricator_toggle {
  color: #485fc7;
  /* Синий цвет */

}

.homework_text {
  width: 100% !important;
}

.toc-title.active span,
.toc-subtitle.active span {
  color: #485fc7 !important;
}

.task-btn:active,
.task-btn.is-active {
  color: #485fc7 !important;
  border: 1px solid #485fc7 !important;
}

.frame-16 {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  padding: 9rem;
  padding-top: 3rem;
  margin: 0 auto;
  width: 100%;
  max-width: 1920px;
  z-index: 1;
}

.mobile-nav {
  background-color: #F3FBFF;
  padding: 12px 16px;
}

/* Mobile Layout */
@media screen and (max-width: 768px) {
  .frame-15 {
    padding: 1rem;
  }

  /* Hide desktop filters on mobile */
  .filter_column {
    display: none !important;
  }

  /* Stack book cards vertically, full width */
  .book-main {
    flex-direction: column !important;
  }

  .books-right-col {
    width: 100% !important;
  }

  .books-right-col .columns {
    margin: 0 !important;
  }

  .books-right-col .column {
    padding: 0.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Pagination visibility control */
@media screen and (min-width: 769px) {
  .mobile-only-pagination {
    display: none !important;
  }
}