html { scroll-behavior: smooth; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@scope (.home-page) {
:scope {
      --blue: #0969e8;
      --blue-dark: #0756bd;
      --ink: #101828;
      --muted: #667085;
      --line: #dce4ee;
      --soft: #f5f9fd;
      --page: #fff;
      --shadow: 0 12px 32px rgba(16, 45, 82, .09);
      --radius: 14px;
      --container: 1320px;
    }

    * { box-sizing: border-box; }
    :scope {
      margin: 0;
      color: var(--ink);
      background: var(--page);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      -webkit-font-smoothing: antialiased;
    }
    a { color: inherit; text-decoration: none; }
    button, input { font: inherit; }
    img { display: block; max-width: 100%; }
    .container { width: min(calc(100% - 64px), var(--container)); margin-inline: auto; }

    .icon {
      width: 22px;
      height: 22px;
      object-fit: contain;
      filter: invert(30%) sepia(97%) saturate(2582%) hue-rotate(205deg) brightness(94%) contrast(101%);
    }

    .site-header {
      position: relative;
      z-index: 10;
      height: 72px;
      background: rgba(255,255,255,.96);
      border-bottom: 1px solid #edf1f6;
      box-shadow: 0 3px 12px rgba(16, 24, 40, .04);
    }
    .header-inner { height: 100%; display: flex; align-items: center; gap: 44px; }
    .logo { display: inline-flex; align-items: center; gap: 10px; font-size: 25px; font-weight: 800; letter-spacing: -.7px; }
    .logo img { width: 34px; height: 34px; filter: invert(30%) sepia(97%) saturate(2582%) hue-rotate(205deg) brightness(94%) contrast(101%); }
    .main-nav { display: flex; align-items: center; gap: 38px; margin-right: auto; font-size: 14px; font-weight: 550; }
    .main-nav a, .all-link { transition: color .2s ease; }
    .main-nav a:hover, .all-link:hover { color: var(--blue); }
    .search { position: relative; width: 218px; }
    .search input { width: 100%; height: 40px; padding: 0 42px 0 16px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: white; }
    .search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(9,105,232,.1); }
    .search img { position: absolute; top: 11px; right: 13px; width: 18px; height: 18px; opacity: .7; }
    .header-actions { display: flex; gap: 10px; }
    .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 22px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; font-size: 14px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
    .btn:hover { transform: translateY(-1px); }
    .btn-primary { color: white; background: linear-gradient(135deg, #0875ef, #075bc9); box-shadow: 0 8px 18px rgba(9,105,232,.22); }
    .btn-primary:hover { box-shadow: 0 10px 22px rgba(9,105,232,.3); }
    .btn-outline { background: rgba(255,255,255,.84); border-color: #afc5df; color: #164a87; }
    .btn-ghost { background: white; border-color: var(--line); }
    .mobile-menu { display: none; position: relative; }
    .mobile-menu summary { display: grid; place-items: center; padding: 6px; cursor: pointer; list-style: none; }
    .mobile-menu summary::-webkit-details-marker { display: none; }
    .mobile-menu summary img { width: 27px; height: 27px; }
    .mobile-nav { position: absolute; top: 45px; right: 0; width: 230px; display: grid; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
    .mobile-nav a { padding: 11px 12px; border-radius: 8px; font-size: 14px; }
    .mobile-nav a:hover { color: var(--blue); background: var(--soft); }

    .hero {
      min-height: 508px;
      background-image: linear-gradient(90deg, #fff 1%, rgba(255,255,255,.97) 24%, rgba(255,255,255,.59) 48%, rgba(255,255,255,0) 72%), url("assets/hero.png");
      background-repeat: no-repeat;
      background-position: center, center;
      background-size: cover;
      border-bottom: 1px solid #eef3f8;
      box-shadow: 0 12px 26px rgba(36, 73, 113, .09);
    }
    .hero-inner { min-height: 508px; display: flex; align-items: center; }
    .hero-copy { width: 530px; padding: 48px 0 34px; }
    .eyebrow { margin: 0 0 20px; color: #0870c9; font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: .2px; }
    h1 { margin: 0; max-width: 520px; font-size: clamp(40px, 4.15vw, 59px); line-height: 1.08; letter-spacing: -2.2px; }
    .hero-text { max-width: 470px; margin: 24px 0 30px; color: #4f5969; font-size: 16px; line-height: 1.75; }
    .hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
    .hero-actions .btn { min-height: 52px; padding-inline: 27px; }
    .hero-actions .icon { width: 17px; height: 17px; filter: brightness(0) invert(1); }
    .hero-benefits { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 40px; color: #536173; font-size: 12px; }
    .mini-benefit { display: flex; align-items: center; gap: 9px; max-width: 115px; line-height: 1.35; }
    .mini-benefit .icon { width: 18px; height: 18px; }

    main { padding: 34px 0 58px; }
    .section { margin-top: 50px; }
    .section:first-child { margin-top: 0; }
    .section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
    h2 { position: relative; margin: 0; padding-left: 15px; font-size: 27px; line-height: 1.2; letter-spacing: -.6px; }
    h2::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 3px; background: var(--blue); }
    .all-link { display: inline-flex; align-items: center; gap: 10px; color: #075cb4; font-size: 13px; white-space: nowrap; }
    .all-link::after { content: "→"; font-size: 18px; }

    .books-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
    .book-card { overflow: hidden; min-width: 0; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 5px 14px rgba(22, 50, 84, .04); transition: transform .22s ease, box-shadow .22s ease; }
    .book-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
    .cover {
      position: relative;
      aspect-ratio: 1 / 1.32;
      background-image: url("design/ChatGPT Image 5 авг. 2026 г., 19_54_39.png");
      background-repeat: no-repeat;
      background-size: 727% auto;
      background-position-y: 44.4%;
    }
    .cover::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 -25px 35px rgba(8,24,44,.08); }
    .book-card:nth-child(1) .cover { background-position-x: 5%; }
    .book-card:nth-child(2) .cover { background-position-x: 23%; }
    .book-card:nth-child(3) .cover { background-position-x: 41%; }
    .book-card:nth-child(4) .cover { background-position-x: 59%; }
    .book-card:nth-child(5) .cover { background-position-x: 77%; }
    .book-card:nth-child(6) .cover { background-position-x: 95%; }
    .book-body { min-height: 136px; display: flex; flex-direction: column; padding: 14px 14px 11px; }
    .book-title { margin: 0; min-height: 39px; font-size: 14px; line-height: 1.35; font-weight: 750; }
    .book-genre { margin: 7px 0 15px; color: #7a8493; font-size: 11px; }
    .book-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid #edf1f5; color: #687587; font-size: 11px; }

    .genres-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
    .genre-card { min-height: 78px; display: flex; align-items: center; gap: 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 11px; background: white; transition: border-color .2s ease, background .2s ease; }
    .genre-card:hover { border-color: #9bc5f5; background: #f8fbff; }
    .genre-card .icon { width: 29px; height: 29px; flex: 0 0 auto; }
    .genre-name { display: block; font-size: 13px; font-weight: 700; }
    .genre-count { display: block; margin-top: 5px; color: #7a8492; font-size: 11px; }

    .features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 46px; padding: 0 12px; }
    .feature-icon { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 50%; background: #f1f7fd; }
    .feature-icon .icon { width: 26px; height: 26px; }
    .feature h3 { margin: 0 0 10px; font-size: 15px; }
    .feature p { margin: 0; color: #5d6878; font-size: 13px; line-height: 1.7; }

    .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 48px; padding: 24px 30px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, #fbfdff, #fff); }
    .stat { display: flex; align-items: center; justify-content: center; gap: 20px; }
    .stat .icon { width: 36px; height: 36px; }
    .stat-value { display: block; color: #07599e; font-size: 24px; font-weight: 750; letter-spacing: .3px; }
    .stat-label { display: block; margin-top: 2px; color: #6e7886; font-size: 12px; }

    .cta { position: relative; overflow: hidden; min-height: 238px; display: flex; align-items: center; margin-top: 46px; border: 1px solid var(--line); border-radius: 20px; background-image: linear-gradient(90deg, #fff 6%, rgba(255,255,255,.97) 34%, rgba(255,255,255,.2) 67%), url("assets/hero.png"); background-position: center, center 63%; background-size: cover; box-shadow: var(--shadow); }
    .cta-content { width: 48%; padding: 35px 44px; }
    .cta h2 { padding: 0; font-size: 31px; line-height: 1.2; }
    .cta h2::before { display: none; }
    .cta p { margin: 16px 0 22px; color: #596474; font-size: 14px; line-height: 1.55; }
    .cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

    .footer { padding: 22px 0 34px; color: #778291; font-size: 12px; text-align: center; }

    @media (max-width: 1120px) {
      .header-inner { gap: 25px; }
      .main-nav { gap: 22px; }
      .search { display: none; }
      .books-grid { grid-template-columns: repeat(3, 1fr); }
      .genres-grid { grid-template-columns: repeat(3, 1fr); }
      .features-grid { gap: 25px; }
    }

    @media (max-width: 780px) {
      .container { width: min(calc(100% - 32px), var(--container)); }
      .site-header { height: 64px; }
      .header-inner { justify-content: space-between; }
      .logo { font-size: 21px; }
      .logo img { width: 30px; height: 30px; }
      .main-nav, .header-actions { display: none; }
      .mobile-menu { display: block; }
      .hero { min-height: 620px; background-image: linear-gradient(180deg, rgba(255,255,255,.94) 0, rgba(255,255,255,.83) 56%, rgba(255,255,255,.16) 100%), url("assets/hero.png"); background-position: center, 63% center; }
      .hero-inner { min-height: 620px; align-items: flex-start; }
      .hero-copy { width: 100%; padding-top: 54px; }
      h1 { max-width: 590px; font-size: clamp(39px, 10vw, 54px); }
      .hero-text { color: #344054; }
      .hero-benefits { gap: 18px; }
      main { padding-top: 30px; }
      .section { margin-top: 43px; }
      h2 { font-size: 23px; }
      .books-grid { grid-template-columns: repeat(2, 1fr); }
      .genres-grid { grid-template-columns: repeat(2, 1fr); }
      .features-grid { grid-template-columns: repeat(2, 1fr); padding: 0; }
      .stats { grid-template-columns: repeat(2, 1fr); }
      .stat { justify-content: flex-start; }
      .cta { background-image: linear-gradient(90deg, rgba(255,255,255,.98), rgba(255,255,255,.77)), url("assets/hero.png"); }
      .cta-content { width: 100%; padding: 34px; }
    }

    @media (max-width: 480px) {
      .hero { min-height: 650px; }
      .hero-inner { min-height: 650px; }
      .hero-copy { padding-top: 40px; }
      .eyebrow { margin-bottom: 14px; }
      h1 { font-size: 38px; letter-spacing: -1.4px; }
      .hero-text { margin-block: 20px 24px; font-size: 15px; line-height: 1.6; }
      .hero-actions .btn { width: 100%; }
      .hero-benefits { margin-top: 28px; gap: 14px; }
      .mini-benefit { width: calc(50% - 8px); max-width: none; }
      .section-head { align-items: flex-end; }
      .section-head .all-link { font-size: 0; gap: 0; }
      .section-head .all-link::after { font-size: 20px; }
      .books-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 75%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 16px; }
      .book-card { scroll-snap-align: start; }
      .genres-grid { grid-template-columns: 1fr; }
      .features-grid { grid-template-columns: 1fr; gap: 30px; }
      .feature { display: grid; grid-template-columns: 52px 1fr; column-gap: 15px; }
      .feature-icon { grid-row: 1 / 3; margin: 0; }
      .feature h3 { align-self: end; }
      .stats { grid-template-columns: 1fr; padding: 24px; }
      .stat { justify-content: flex-start; }
      .cta { min-height: 300px; align-items: flex-start; background-position: center, 62% center; }
      .cta-content { padding: 30px 24px; }
      .cta h2 { font-size: 27px; }
      .cta-actions .btn { width: 100%; }
    }
}

@scope (.detail-page) {
:scope {
      --blue: #0969e8;
      --blue-dark: #0756bd;
      --ink: #101828;
      --muted: #667085;
      --line: #dce4ee;
      --soft: #f5f9fd;
      --page: #f7f9fc;
      --green: #168a50;
      --yellow: #f4b400;
      --shadow: 0 12px 32px rgba(16, 45, 82, .09);
      --radius: 14px;
      --container: 1320px;
    }

    * { box-sizing: border-box; }
    :scope { margin: 0; color: var(--ink); background: var(--page); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
    a { color: inherit; text-decoration: none; }
    button, input, select { font: inherit; }
    img { display: block; max-width: 100%; }
    .container { width: min(calc(100% - 64px), var(--container)); margin-inline: auto; }
    .icon { width: 21px; height: 21px; object-fit: contain; filter: invert(30%) sepia(97%) saturate(2582%) hue-rotate(205deg) brightness(94%) contrast(101%); }

    .site-header { position: relative; z-index: 20; height: 72px; background: rgba(255,255,255,.97); border-bottom: 1px solid #edf1f6; box-shadow: 0 3px 12px rgba(16,24,40,.04); }
    .header-inner { height: 100%; display: flex; align-items: center; gap: 44px; }
    .logo { display: inline-flex; align-items: center; gap: 10px; font-size: 25px; font-weight: 800; letter-spacing: -.7px; }
    .logo img { width: 34px; height: 34px; filter: invert(30%) sepia(97%) saturate(2582%) hue-rotate(205deg) brightness(94%) contrast(101%); }
    .main-nav { display: flex; align-items: center; gap: 38px; margin-right: auto; font-size: 14px; font-weight: 550; }
    .main-nav a { transition: color .2s ease; }
    .main-nav a:hover { color: var(--blue); }
    .search { position: relative; width: 218px; }
    .search input { width: 100%; height: 40px; padding: 0 42px 0 16px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: white; }
    .search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(9,105,232,.1); }
    .search img { position: absolute; top: 11px; right: 13px; width: 18px; height: 18px; opacity: .7; }
    .header-actions { display: flex; gap: 10px; }
    .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 22px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; font-size: 14px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
    .btn:hover { transform: translateY(-1px); }
    .btn-primary { color: white; background: linear-gradient(135deg, #0875ef, #075bc9); box-shadow: 0 8px 18px rgba(9,105,232,.2); }
    .btn-primary:hover { box-shadow: 0 10px 22px rgba(9,105,232,.3); }
    .btn-outline { color: #164a87; background: white; border-color: #afc5df; }
    .btn-ghost { background: white; border-color: var(--line); }
    .mobile-menu { display: none; position: relative; }
    .mobile-menu summary { display: grid; place-items: center; padding: 6px; cursor: pointer; list-style: none; }
    .mobile-menu summary::-webkit-details-marker { display: none; }
    .mobile-menu summary img { width: 27px; height: 27px; }
    .mobile-nav { position: absolute; top: 45px; right: 0; width: 230px; display: grid; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
    .mobile-nav a { padding: 11px 12px; border-radius: 8px; font-size: 14px; }
    .mobile-nav a:hover { color: var(--blue); background: var(--soft); }

    .page { padding: 25px 0 58px; }
    .breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; color: #6c7787; font-size: 13px; }
    .breadcrumbs a:hover { color: var(--blue); }
    .breadcrumbs span { color: #a1aab7; }

    .book-hero { position: relative; overflow: hidden; min-height: 495px; display: grid; grid-template-columns: 240px 1fr; gap: 36px; align-items: end; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background-image: linear-gradient(90deg, rgba(255,255,255,.98) 2%, rgba(255,255,255,.91) 45%, rgba(255,255,255,.45) 73%, rgba(255,255,255,.18)), url("assets/hero.png"); background-size: cover; background-position: center; box-shadow: var(--shadow); }
    .book-cover { width: 240px; aspect-ratio: 213 / 329; align-self: stretch; min-height: 371px; overflow: hidden; border-radius: 12px; background-image: url("design/ChatGPT Image 5 авг. 2026 г., 20_09_51.png"); background-repeat: no-repeat; background-size: 480% auto; background-position: 3% 10.6%; box-shadow: 0 14px 30px rgba(17,38,66,.2); }
    .hero-info { max-width: 760px; padding: 8px 0 3px; }
    .status { display: inline-flex; align-items: center; min-height: 28px; padding: 0 11px; border-radius: 6px; color: #11623b; background: #dff6e9; font-size: 11px; font-weight: 800; text-transform: uppercase; }
    h1 { margin: 16px 0 7px; font-size: clamp(36px, 4vw, 52px); line-height: 1.08; letter-spacing: -1.8px; }
    .original-title { margin: 0 0 18px; color: #5e6878; font-size: 15px; }
    .genre-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; }
    .genre-tags a { padding: 7px 11px; border: 1px solid #cbd7e5; border-radius: 7px; color: #405065; background: rgba(255,255,255,.78); font-size: 12px; }
    .book-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
    .rating-big { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; font-size: 25px; font-weight: 800; }
    .rating-big .star { color: var(--yellow); font-size: 30px; }
    .rating-big small { color: #667085; font-size: 12px; font-weight: 500; }
    .facts { width: min(620px, 100%); display: grid; grid-template-columns: 150px 1fr; gap: 8px 20px; margin: 0; padding: 0; font-size: 13px; }
    .facts dt { color: #697587; }
    .facts dd { margin: 0; font-weight: 550; }

    .content-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(290px, 1fr); gap: 22px; margin-top: 22px; align-items: start; }
    .main-column, .sidebar { display: grid; gap: 18px; }
    .panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 5px 18px rgba(16,45,82,.04); }
    .panel-body { padding: 23px 25px; }
    .panel-head { min-height: 63px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 22px; border-bottom: 1px solid #e7edf4; }
    h2 { margin: 0; font-size: 20px; letter-spacing: -.25px; }
    .description p { margin: 12px 0 17px; color: #4f5b6c; font-size: 14px; line-height: 1.75; }

    .rate-panel h2 { margin-bottom: 13px; }
    .rate-label { color: #697587; font-size: 13px; }
    .stars { display: flex; gap: 9px; margin: 12px 0 17px; }
    .star-button { border: 0; padding: 0; color: #b8c2cf; background: none; font-size: 34px; line-height: 1; cursor: pointer; transition: color .2s, transform .2s; }
    .star-button:hover { color: var(--yellow); transform: scale(1.08); }
    .rate-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
    .rate-footer small { color: #697587; }

    .stats-panel { display: grid; grid-template-columns: repeat(4, 1fr); }
    .stat { min-height: 88px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; border-right: 1px solid #e7edf4; }
    .stat:last-child { border-right: 0; }
    .stat .icon { width: 31px; height: 31px; }
    .stat-value { display: block; font-size: 24px; font-weight: 750; line-height: 1.05; }
    .stat-label { display: block; margin-top: 5px; color: #758091; font-size: 11px; }

    .filters { display: flex; gap: 10px; }
    .select { min-height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 8px; color: #4e5c6f; background: white; font-size: 12px; }
    .chapters { padding: 0 14px 14px; }
    .chapter-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 120px 58px; gap: 12px; align-items: center; min-height: 55px; padding: 0 11px; border-bottom: 1px solid #e9eef4; color: #4d596a; font-size: 13px; transition: background .2s; }
    .chapter-row:hover { background: #f7faff; }
    .chapter-row.current { margin-top: 12px; border: 1px solid #9ac2f3; border-radius: 9px; color: #154e93; background: #eef6ff; }
    .chapter-title { color: var(--ink); font-weight: 600; }
    .new-badge { justify-self: end; padding: 4px 7px; border-radius: 5px; color: #11623b; background: #dff6e9; font-size: 9px; font-weight: 800; }
    .more-row { display: block; width: calc(100% - 22px); min-height: 40px; margin: 12px auto 0; border: 1px solid var(--line); border-radius: 8px; color: #415064; background: white; cursor: pointer; }

    .info-list { display: grid; grid-template-columns: 1fr 1.1fr; gap: 13px 22px; margin: 0; font-size: 13px; }
    .info-list dt { color: #697587; }
    .info-list dd { margin: 0; }
    .share-title { margin: 25px 0 12px; font-size: 14px; font-weight: 750; }
    .share-row { display: flex; gap: 10px; }
    .share { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--blue); font-size: 13px; font-weight: 800; }
    .share:nth-child(2) { background: #17a6dc; }
    .share:nth-child(3) { background: #5b65df; }
    .share:nth-child(4) { color: #475467; background: #edf2f7; }

    .similar-list { display: grid; gap: 13px; }
    .similar-item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; }
    .similar-cover { width: 64px; aspect-ratio: .8; border-radius: 7px; background-image: url("design/ChatGPT Image 5 авг. 2026 г., 19_54_39.png"); background-size: 727% auto; background-repeat: no-repeat; background-position-y: 44.4%; }
    .similar-item:nth-child(1) .similar-cover { background-position-x: 59%; }
    .similar-item:nth-child(2) .similar-cover { background-position-x: 77%; }
    .similar-item:nth-child(3) .similar-cover { background-position-x: 23%; }
    .similar-item:nth-child(4) .similar-cover { background-position-x: 41%; }
    .similar-item:nth-child(5) .similar-cover { background-position-x: 5%; }
    .similar-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
    .similar-rating { display: block; margin-top: 7px; color: #586679; font-size: 12px; }
    .similar-rating b { color: var(--yellow); }
    .similar-more { width: 100%; margin-top: 18px; }

    .comments { display: grid; gap: 23px; }
    .comment { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; }
    .avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #0756bd; background: #e9f3ff; font-weight: 800; }
    .comment-name { font-size: 13px; font-weight: 750; }
    .comment-time { margin-left: 8px; color: #8590a0; font-size: 11px; font-weight: 400; }
    .comment p { margin: 7px 0 6px; color: #4f5b6c; font-size: 13px; }
    .reply { color: #748092; font-size: 11px; }
    .likes { align-self: end; color: #6d798a; font-size: 12px; }
    .footer { padding: 24px 0 34px; color: #778291; font-size: 12px; text-align: center; }

    @media (max-width: 1120px) {
      .header-inner { gap: 25px; }
      .main-nav { gap: 22px; }
      .search { display: none; }
      .book-hero { grid-template-columns: 210px 1fr; }
      .book-cover { width: 210px; min-height: 325px; }
      .content-grid { grid-template-columns: minmax(0, 1.75fr) minmax(275px, 1fr); }
      .chapter-row { grid-template-columns: 90px minmax(0,1fr) 105px 50px; }
      .stat { gap: 9px; }
    }

    @media (max-width: 820px) {
      .container { width: min(calc(100% - 32px), var(--container)); }
      .site-header { height: 64px; }
      .header-inner { justify-content: space-between; }
      .logo { font-size: 21px; }
      .logo img { width: 30px; height: 30px; }
      .main-nav, .header-actions { display: none; }
      .mobile-menu { display: block; }
      .page { padding-top: 18px; }
      .book-hero { min-height: 0; grid-template-columns: 170px 1fr; gap: 24px; padding: 23px; background-image: linear-gradient(90deg, rgba(255,255,255,.97), rgba(255,255,255,.72)), url("assets/hero.png"); }
      .book-cover { width: 170px; min-height: 263px; align-self: start; }
      h1 { font-size: 35px; }
      .facts { grid-template-columns: 130px 1fr; }
      .content-grid { grid-template-columns: 1fr; }
      .sidebar { grid-template-columns: 1fr 1fr; align-items: stretch; }
      .sidebar .rate-panel { grid-column: 1 / -1; }
    }

    @media (max-width: 600px) {
      .breadcrumbs { line-height: 1.5; }
      .book-hero { display: block; padding: 20px; }
      .book-cover { width: min(210px, 70%); min-height: 0; margin: 0 auto 25px; }
      .hero-info { text-align: center; }
      h1 { font-size: 33px; }
      .genre-tags, .book-actions { justify-content: center; }
      .facts { text-align: left; }
      .stats-panel { grid-template-columns: 1fr 1fr; }
      .stat:nth-child(2) { border-right: 0; }
      .stat:nth-child(-n+2) { border-bottom: 1px solid #e7edf4; }
      .panel-head { align-items: flex-start; flex-direction: column; }
      .filters { width: 100%; }
      .select { width: 50%; }
      .chapter-row { grid-template-columns: 76px minmax(0,1fr); gap: 5px 10px; padding-block: 10px; }
      .chapter-row > :nth-child(3) { grid-column: 2; color: #7a8594; font-size: 11px; }
      .chapter-row > :nth-child(4) { grid-row: 1; grid-column: 2; }
      .sidebar { grid-template-columns: 1fr; }
      .sidebar .rate-panel { grid-column: auto; }
      .panel-body { padding: 20px; }
    }

    @media (max-width: 390px) {
      .container { width: min(calc(100% - 22px), var(--container)); }
      .facts { grid-template-columns: 105px 1fr; font-size: 12px; }
      .book-actions .btn { width: 100%; }
      .rating-big { width: 100%; justify-content: center; }
      .stats-panel { grid-template-columns: 1fr; }
      .stat { justify-content: flex-start; padding-left: 30px; border-right: 0; border-bottom: 1px solid #e7edf4; }
    }
    .panel-list { margin-top: 20px; }
}

@scope (.reader-page) {
    :scope {
      --blue: #0969e8;
      --blue-dark: #0756bd;
      --ink: #101828;
      --muted: #667085;
      --line: #dce4ee;
      --soft: #f5f9fd;
      --page: #f4f7fb;
      --shadow: 0 12px 32px rgba(16, 45, 82, .08);
      --container: 1320px;
      --reader-font-size: 18px;
      --reader-line-height: 1.85;
      --reader-text-width: 760px;
      margin: 0;
      color: var(--ink);
      background: var(--page);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      -webkit-font-smoothing: antialiased;
    }
    * { box-sizing: border-box; }
    a { color: inherit; text-decoration: none; }
    button, input, select { font: inherit; }
    img { display: block; max-width: 100%; }
    .container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
    .icon { width: 21px; height: 21px; object-fit: contain; filter: invert(30%) sepia(97%) saturate(2582%) hue-rotate(205deg) brightness(94%) contrast(101%); }

    .site-header { position: relative; z-index: 20; height: 72px; background: rgba(255,255,255,.97); border-bottom: 1px solid #edf1f6; box-shadow: 0 3px 12px rgba(16,24,40,.04); }
    .header-inner { height: 100%; display: flex; align-items: center; gap: 44px; }
    .logo { display: inline-flex; align-items: center; gap: 10px; font-size: 25px; font-weight: 800; letter-spacing: -.7px; }
    .logo img { width: 34px; height: 34px; filter: invert(30%) sepia(97%) saturate(2582%) hue-rotate(205deg) brightness(94%) contrast(101%); }
    .main-nav { display: flex; align-items: center; gap: 38px; margin-right: auto; font-size: 14px; font-weight: 550; }
    .main-nav a { transition: color .2s ease; }
    .main-nav a:hover { color: var(--blue); }
    .search { position: relative; width: 218px; }
    .search input { width: 100%; height: 40px; padding: 0 42px 0 16px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: white; }
    .search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(9,105,232,.1); }
    .search img { position: absolute; top: 11px; right: 13px; width: 18px; height: 18px; opacity: .7; }
    .header-actions { display: flex; gap: 10px; }
    .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 22px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; font-size: 14px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
    .btn:hover { transform: translateY(-1px); }
    .btn-primary { color: white; background: linear-gradient(135deg, #0875ef, #075bc9); box-shadow: 0 8px 18px rgba(9,105,232,.2); }
    .btn-ghost { color: #344054; background: white; border-color: var(--line); }
    .mobile-menu { display: none; position: relative; }
    .mobile-menu summary { display: grid; place-items: center; padding: 6px; cursor: pointer; list-style: none; }
    .mobile-menu summary::-webkit-details-marker { display: none; }
    .mobile-menu summary img { width: 27px; height: 27px; }
    .mobile-nav { position: absolute; top: 45px; right: 0; width: 230px; display: grid; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
    .mobile-nav a { padding: 11px 12px; border-radius: 8px; font-size: 14px; }
    .mobile-nav a:hover { color: var(--blue); background: var(--soft); }

    .reader-shell { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(300px, .95fr); gap: 22px; align-items: start; padding-block: 20px 38px; }
    .reader-card, .reader-panel { border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 5px 18px rgba(16,45,82,.04); }
    .reader-card { overflow: hidden; }
    .reader-toolbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 18px; border-bottom: 1px solid #e6ecf3; background: #fff; }
    .reader-crumbs { min-width: 0; display: flex; align-items: center; gap: 10px; color: #536174; font-size: 13px; }
    .reader-crumbs a:not(.back-link) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .reader-crumbs strong { color: #26364a; white-space: nowrap; }
    .reader-tools { display: flex; gap: 9px; }
    .tool-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
    .tool-icon:hover { border-color: #a9c8eb; background: #f7fbff; }
    .tool-icon img { width: 20px; height: 20px; filter: invert(28%) sepia(17%) saturate(854%) hue-rotate(174deg) brightness(90%); }
    .back-link { margin-right: 3px; border: 0; }

    .chapter { padding: 64px 35px 58px; background: #fff; transition: background .2s; }
    .chapter h1 { max-width: var(--reader-text-width); margin: 0 auto 62px; font-size: 34px; line-height: 1.2; text-align: center; letter-spacing: -.8px; }
    .chapter-text { max-width: var(--reader-text-width); margin-inline: auto; font-family: inherit; font-size: var(--reader-font-size); line-height: var(--reader-line-height); color: #273548; transition: max-width .2s, font-size .2s, line-height .2s; }
    .chapter-text p { margin: 0 0 29px; }
    .chapter-text .divider { margin-block: 45px; text-align: center; letter-spacing: 12px; }
    .fragment-lock { max-width: var(--reader-text-width); margin: 38px auto 0; padding: 30px 20px; border-top: 1px solid #e7edf4; text-align: center; }
    .lock-mark { width: 38px; height: 38px; display: grid; place-items: center; margin: 0 auto 10px; border: 2px solid #728097; border-radius: 12px; color: #59687b; font-size: 24px; }
    .fragment-lock strong { display: block; font-size: 14px; }
    .fragment-lock p { margin: 12px 0 0; color: #6d7889; font-size: 13px; }
    .fragment-lock a { color: var(--blue); }
    .chapter-navigation { max-width: 610px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 18px auto 0; }

    .reader-progress { padding: 18px 22px 16px; border-top: 1px solid #e6ecf3; background: #fbfcfe; }
    .progress-range { display: block; }
    .progress-range input { width: 100%; height: 5px; accent-color: var(--blue); cursor: pointer; }
    .progress-meta { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin-top: 11px; color: #657286; font-size: 12px; }
    .progress-meta > :last-child { text-align: right; }
    .progress-actions { display: flex; gap: 8px; }
    .progress-actions .btn { min-height: 36px; padding-inline: 14px; font-size: 12px; }
    .progress-actions select { min-height: 36px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 8px; color: #405065; background: white; font-size: 12px; }

    .reader-sidebar { display: grid; gap: 16px; }
    .reader-panel { padding: 20px; }
    .reader-panel h2 { margin: 0; font-size: 18px; letter-spacing: -.3px; }
    .book-summary h2 { margin-bottom: 17px; }
    .summary-grid { display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: start; }
    .summary-cover { width: 92px; aspect-ratio: 213 / 329; border-radius: 9px; background-image: url("design/ChatGPT Image 5 авг. 2026 г., 20_09_51.png"); background-repeat: no-repeat; background-size: 480% auto; background-position: 3% 10.6%; box-shadow: 0 8px 18px rgba(16,45,82,.14); }
    .summary-grid p { margin: 2px 0 15px; color: #647184; font-size: 12px; line-height: 1.5; }
    .summary-rating { display: block; margin-bottom: 18px; color: #1e2938; font-size: 15px; }
    .summary-rating::first-letter { color: #f4b400; }
    .summary-rating small { color: #7b8695; font-weight: 500; }
    .summary-grid .btn { min-height: 38px; padding-inline: 14px; font-size: 12px; }
    .panel-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .panel-line > a { color: #5f6c7d; font-size: 12px; }
    .volume-panel p { margin: 18px 0 11px; color: #687588; font-size: 13px; }
    .volume-progress { height: 6px; overflow: hidden; border-radius: 4px; background: #e5ebf2; }
    .volume-progress span { display: block; width: 35%; height: 100%; border-radius: inherit; background: var(--blue); }
    .contents-list { display: grid; gap: 4px; margin: 14px -8px; }
    .contents-list a { min-height: 39px; display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 7px; color: #536174; font-size: 12px; }
    .contents-list a:hover { color: var(--blue); background: #f4f8fd; }
    .contents-list .active { color: #0d56b7; background: #e9f3ff; font-weight: 700; }
    .full-button { width: 100%; min-height: 38px; }

    .settings-panel h2 { margin-bottom: 20px; text-transform: uppercase; font-size: 14px; letter-spacing: .2px; }
    .setting-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #596679; font-size: 12px; }
    .setting-row select { min-height: 37px; min-width: 112px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 8px; color: #344054; background: white; }
    .stepper, .choice-row, .theme-row { display: flex; align-items: center; gap: 7px; }
    .stepper button, .choice-row button { min-width: 34px; height: 34px; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; color: #526073; background: white; cursor: pointer; }
    .stepper output { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--blue); }
    .choice-row button.active { color: #0756bd; border-color: #78aeea; background: #eaf4ff; }
    .theme-row button { width: 25px; height: 25px; padding: 0; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #bdc8d5; cursor: pointer; }
    .theme-row button.active { box-shadow: 0 0 0 2px var(--blue); }
    .theme-light { background: #fff; }
    .theme-sepia { background: #f5ead3; }
    .theme-gray { background: #e6ebf0; }
    .reset-settings { margin-top: 12px; padding: 0; border: 0; color: #697587; background: none; font-size: 12px; cursor: pointer; }
    .reset-settings:hover { color: var(--blue); }

    .saved-panel h2 { text-transform: uppercase; font-size: 14px; letter-spacing: .2px; }
    .saved-item { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: start; margin-top: 18px; }
    .saved-item img { width: 18px; height: 18px; filter: invert(68%) sepia(87%) saturate(874%) hue-rotate(357deg) brightness(102%); }
    .saved-item p, .note { margin: 0; color: #4f5d70; font-size: 12px; line-height: 1.55; }
    .saved-item small, .note small { display: block; margin-top: 5px; color: #8490a0; }
    .note { margin-top: 17px; padding-left: 12px; border-left: 2px solid #ced9e5; }

    .reader-card[data-theme="sepia"] .chapter { background: #f8f0df; }
    .reader-card[data-theme="sepia"] .chapter-text { color: #4c4030; }
    .reader-card[data-theme="gray"] .chapter { background: #edf1f4; }
    .reader-card[data-theme="gray"] .chapter-text { color: #334155; }
    .reader-card[data-width="narrow"] { --reader-text-width: 630px; }
    .reader-card[data-width="wide"] { --reader-text-width: 860px; }

    @media (max-width: 1120px) {
      .header-inner { gap: 25px; }
      .main-nav { gap: 22px; }
      .search { display: none; }
      .reader-shell { grid-template-columns: minmax(0, 1.85fr) minmax(285px, .85fr); }
      .chapter { padding-inline: 28px; }
    }

    @media (max-width: 860px) {
      .container { width: min(calc(100% - 28px), var(--container)); }
      .site-header { height: 64px; }
      .header-inner { justify-content: space-between; }
      .logo { font-size: 21px; }
      .logo img { width: 30px; height: 30px; }
      .main-nav, .header-actions { display: none; }
      .mobile-menu { display: block; }
      .reader-shell { grid-template-columns: 1fr; }
      .reader-sidebar { grid-template-columns: 1fr 1fr; }
      .contents-panel, .settings-panel { grid-row: span 2; }
      .reader-toolbar { position: sticky; top: 0; z-index: 5; }
    }

    @media (max-width: 620px) {
      .reader-shell { width: 100%; padding-top: 0; }
      .reader-card { border-inline: 0; border-radius: 0; }
      .reader-toolbar { padding-inline: 12px; }
      .reader-crumbs a:not(.back-link), .reader-crumbs span { display: none; }
      .reader-tools { gap: 5px; }
      .tool-icon { width: 37px; height: 37px; }
      .chapter { padding: 46px 22px 42px; }
      .chapter h1 { margin-bottom: 44px; font-size: 29px; }
      .chapter-text { font-size: min(var(--reader-font-size), 19px); }
      .chapter-navigation { grid-template-columns: 1fr; }
      .progress-meta { grid-template-columns: 1fr auto; }
      .progress-actions { grid-row: 2; grid-column: 1 / -1; justify-content: center; }
      .progress-meta > :last-child { grid-column: 2; grid-row: 1; }
      .reader-sidebar { grid-template-columns: 1fr; padding-inline: 14px; }
      .contents-panel, .settings-panel { grid-row: auto; }
    }

    @media (max-width: 390px) {
      .reader-tools .tool-icon:nth-child(2) { display: none; }
      .chapter { padding-inline: 17px; }
      .chapter h1 { font-size: 26px; }
      .reader-progress { padding-inline: 14px; }
      .progress-actions .btn { padding-inline: 10px; }
    }
}

@scope (.genres-page) {
    :scope {
      --blue: #0969e8;
      --ink: #101828;
      --muted: #667085;
      --line: #dce4ee;
      --soft: #f5f9fd;
      --page: #f8fafc;
      --shadow: 0 12px 32px rgba(16,45,82,.08);
      --container: 1320px;
      margin: 0;
      color: var(--ink);
      background: var(--page);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      -webkit-font-smoothing: antialiased;
    }
    * { box-sizing: border-box; }
    a { color: inherit; text-decoration: none; }
    button, input, select { font: inherit; }
    img { display: block; max-width: 100%; }
    .container { width: min(calc(100% - 64px), var(--container)); margin-inline: auto; }

    .site-header { position: relative; z-index: 20; height: 72px; background: rgba(255,255,255,.97); border-bottom: 1px solid #edf1f6; box-shadow: 0 3px 12px rgba(16,24,40,.04); }
    .header-inner { height: 100%; display: flex; align-items: center; gap: 44px; }
    .logo { display: inline-flex; align-items: center; gap: 10px; font-size: 25px; font-weight: 800; letter-spacing: -.7px; }
    .logo img { width: 34px; height: 34px; filter: invert(30%) sepia(97%) saturate(2582%) hue-rotate(205deg) brightness(94%) contrast(101%); }
    .main-nav { display: flex; align-items: center; gap: 38px; margin-right: auto; font-size: 14px; font-weight: 550; }
    .main-nav a { transition: color .2s ease; }
    .main-nav a:hover, .main-nav a.active { color: var(--blue); }
    .search { position: relative; width: 218px; }
    .search input { width: 100%; height: 40px; padding: 0 42px 0 16px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: white; }
    .search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(9,105,232,.1); }
    .search img { position: absolute; top: 11px; right: 13px; width: 18px; height: 18px; opacity: .7; }
    .header-actions { display: flex; gap: 10px; }
    .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 22px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; font-size: 14px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
    .btn:hover { transform: translateY(-1px); }
    .btn-primary { color: white; background: linear-gradient(135deg, #0875ef, #075bc9); box-shadow: 0 8px 18px rgba(9,105,232,.2); }
    .btn-ghost { color: #344054; background: white; border-color: var(--line); }
    .mobile-menu { display: none; position: relative; }
    .mobile-menu summary { display: grid; place-items: center; padding: 6px; cursor: pointer; list-style: none; }
    .mobile-menu summary::-webkit-details-marker { display: none; }
    .mobile-menu summary img { width: 27px; height: 27px; }
    .mobile-nav { position: absolute; top: 45px; right: 0; width: 230px; display: grid; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
    .mobile-nav a { padding: 11px 12px; border-radius: 8px; font-size: 14px; }
    .mobile-nav a:hover { color: var(--blue); background: var(--soft); }

    .genres-main { padding-block: 28px 48px; }
    .breadcrumbs { display: flex; align-items: center; gap: 10px; color: #748092; font-size: 13px; }
    .breadcrumbs a:hover { color: var(--blue); }
    .breadcrumbs span:last-child { color: #4b596b; }
    .genres-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 19px 0 28px; }
    .genres-heading h1 { margin: 0 0 9px; font-size: 48px; line-height: 1; letter-spacing: -1.7px; }
    .genres-heading p { margin: 0; color: #647184; font-size: 14px; }
    .sort-control { display: flex; align-items: center; gap: 12px; color: #6b7788; font-size: 12px; }
    .sort-control select { min-width: 178px; height: 42px; padding: 0 36px 0 13px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: #344054; background: white; }
    .sort-control select:focus { border-color: var(--blue); }

    .genre-showcase { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 22px; }
    .genre-tile { position: relative; overflow: hidden; min-height: 324px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 5px 18px rgba(16,45,82,.05); isolation: isolate; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
    .genre-tile:hover { transform: translateY(-5px); border-color: #a8c8eb; box-shadow: var(--shadow); }
    .genre-art { position: absolute; z-index: -2; inset: 0; background-image: url("assets/hero.png"); background-repeat: no-repeat; background-size: auto 100%; filter: saturate(.92); transform: scale(1.02); transition: transform .35s ease; }
    .genre-tile:hover .genre-art { transform: scale(1.07); }
    .genre-tile::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.06) 2%, rgba(255,255,255,.2) 34%, rgba(255,255,255,.94) 64%, #fff 82%); }
    .art-1, .art-7, .art-11 { background-position: 71% center; filter: saturate(.75) hue-rotate(18deg); }
    .art-2, .art-6, .art-14 { background-position: 37% center; }
    .art-3, .art-8, .art-15 { background-position: 91% center; filter: saturate(.72) hue-rotate(330deg); }
    .art-4, .art-9, .art-13 { background-position: 12% center; filter: saturate(.8) hue-rotate(12deg); }
    .art-5, .art-10, .art-16 { background-position: 64% center; filter: saturate(.75) hue-rotate(285deg); }
    .art-12 { background-position: 48% center; filter: saturate(.55) brightness(.72); }
    .genre-content { min-height: 324px; display: flex; flex-direction: column; align-items: flex-start; padding: 22px 20px 20px; }
    .genre-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: auto; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; background: var(--tile-color, #2478d0); box-shadow: 0 7px 18px rgba(16,45,82,.2); }
    .genre-icon img { width: 25px; height: 25px; filter: brightness(0) invert(1); }
    .genre-content strong { margin-top: 52px; font-size: 19px; letter-spacing: -.25px; }
    .genre-description { min-height: 61px; margin-top: 8px; color: #596679; font-size: 13px; line-height: 1.55; }
    .genre-total { margin-top: 11px; color: #0768d8; font-size: 13px; font-weight: 650; }
    .tone-blue { --tile-color: #217ad4; }
    .tone-violet { --tile-color: #7b48d6; }
    .tone-green { --tile-color: #23905b; }
    .tone-gold { --tile-color: #c98a08; }
    .tone-pink { --tile-color: #d44f91; }
    .tone-orange { --tile-color: #dc8b0c; }
    .tone-purple { --tile-color: #8c4ad2; }
    .tone-cyan { --tile-color: #168db5; }
    .tone-red { --tile-color: #cb3d46; }
    .tone-brown { --tile-color: #95703f; }
    .tone-teal { --tile-color: #159b93; }

    .genre-cta { min-height: 222px; display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 30px; margin-top: 28px; padding: 28px 40px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(110deg, #fff 30%, #edf6ff); box-shadow: 0 5px 18px rgba(16,45,82,.04); }
    .genre-cta h2 { margin: 0 0 10px; font-size: 28px; letter-spacing: -.65px; }
    .genre-cta p { margin: 0 0 19px; color: #657285; font-size: 13px; line-height: 1.55; }
    .cta-books { display: flex; justify-content: flex-end; gap: 10px; transform: rotate(1deg); }
    .cta-book { width: 112px; aspect-ratio: .75; border-radius: 8px; background-image: url("design/ChatGPT Image 5 авг. 2026 г., 19_54_39.png"); background-repeat: no-repeat; background-size: 727% auto; background-position-y: 44.4%; box-shadow: 0 9px 18px rgba(16,45,82,.15); }
    .book-a { background-position-x: 23%; }
    .book-b { background-position-x: 77%; }
    .book-c { background-position-x: 41%; }
    .book-d { background-position-x: 5%; }

    .genre-stats { display: grid; grid-template-columns: repeat(4,1fr); margin-top: 20px; padding: 24px 30px; border: 1px solid var(--line); border-radius: 15px; background: white; }
    .genre-stats > div { display: flex; align-items: center; justify-content: center; gap: 18px; }
    .genre-stats img { width: 33px; height: 33px; filter: invert(30%) sepia(97%) saturate(2582%) hue-rotate(205deg) brightness(94%) contrast(101%); }
    .genre-stats strong { display: block; color: #075ebf; font-size: 22px; }
    .genre-stats small { display: block; margin-top: 3px; color: #758193; font-size: 11px; }
    .footer { padding: 8px 0 34px; color: #778291; font-size: 12px; text-align: center; }

    @media (max-width: 1120px) {
      .header-inner { gap: 25px; }
      .main-nav { gap: 22px; }
      .search { display: none; }
      .genre-showcase { grid-template-columns: repeat(3,1fr); }
      .cta-book { width: 95px; }
    }

    @media (max-width: 820px) {
      .container { width: min(calc(100% - 32px), var(--container)); }
      .site-header { height: 64px; }
      .header-inner { justify-content: space-between; }
      .logo { font-size: 21px; }
      .logo img { width: 30px; height: 30px; }
      .main-nav, .header-actions { display: none; }
      .mobile-menu { display: block; }
      .genres-heading { align-items: flex-start; flex-direction: column; }
      .sort-control { align-self: flex-end; }
      .genre-showcase { grid-template-columns: repeat(2,1fr); }
      .genre-cta { grid-template-columns: 1fr; }
      .cta-books { display: none; }
      .genre-stats { grid-template-columns: 1fr 1fr; gap: 25px; }
      .genre-stats > div { justify-content: flex-start; }
    }

    @media (max-width: 520px) {
      .genres-main { padding-top: 20px; }
      .genres-heading h1 { font-size: 39px; }
      .sort-control { width: 100%; align-items: flex-start; flex-direction: column; }
      .sort-control select { width: 100%; }
      .genre-showcase { grid-template-columns: 1fr; }
      .genre-tile, .genre-content { min-height: 305px; }
      .genre-content strong { margin-top: 43px; }
      .genre-cta { padding: 27px 24px; }
      .genre-stats { grid-template-columns: 1fr; padding: 24px; }
    }
}

@scope (.genre-page) {
    :scope {
      --blue: #0969e8;
      --violet: #7750c9;
      --ink: #101828;
      --muted: #667085;
      --line: #dce4ee;
      --soft: #f5f9fd;
      --page: #f7f9fc;
      --shadow: 0 12px 32px rgba(16,45,82,.08);
      --container: 1320px;
      margin: 0;
      color: var(--ink);
      background: var(--page);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      -webkit-font-smoothing: antialiased;
    }
    * { box-sizing: border-box; }
    a { color: inherit; text-decoration: none; }
    button, input, select { font: inherit; }
    img { display: block; max-width: 100%; }
    .container { width: min(calc(100% - 64px), var(--container)); margin-inline: auto; }

    .site-header { position: relative; z-index: 20; height: 72px; background: rgba(255,255,255,.97); border-bottom: 1px solid #edf1f6; box-shadow: 0 3px 12px rgba(16,24,40,.04); }
    .header-inner { height: 100%; display: flex; align-items: center; gap: 44px; }
    .logo { display: inline-flex; align-items: center; gap: 10px; font-size: 25px; font-weight: 800; letter-spacing: -.7px; }
    .logo img { width: 34px; height: 34px; filter: invert(30%) sepia(97%) saturate(2582%) hue-rotate(205deg) brightness(94%) contrast(101%); }
    .main-nav { display: flex; align-items: center; gap: 38px; margin-right: auto; font-size: 14px; font-weight: 550; }
    .main-nav a { transition: color .2s ease; }
    .main-nav a:hover, .main-nav a.active { color: var(--blue); }
    .search { position: relative; width: 218px; }
    .search input { width: 100%; height: 40px; padding: 0 42px 0 16px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: white; }
    .search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(9,105,232,.1); }
    .search img { position: absolute; top: 11px; right: 13px; width: 18px; height: 18px; opacity: .7; }
    .header-actions { display: flex; gap: 10px; }
    .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 22px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; font-size: 14px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
    .btn:hover { transform: translateY(-1px); }
    .btn-primary { color: white; background: linear-gradient(135deg, #0875ef, #075bc9); box-shadow: 0 8px 18px rgba(9,105,232,.2); }
    .btn-ghost { color: #344054; background: white; border-color: var(--line); }
    .mobile-menu { display: none; position: relative; }
    .mobile-menu summary { display: grid; place-items: center; padding: 6px; cursor: pointer; list-style: none; }
    .mobile-menu summary::-webkit-details-marker { display: none; }
    .mobile-menu summary img { width: 27px; height: 27px; }
    .mobile-nav { position: absolute; top: 45px; right: 0; width: 230px; display: grid; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
    .mobile-nav a { padding: 11px 12px; border-radius: 8px; font-size: 14px; }
    .mobile-nav a:hover { color: var(--blue); background: var(--soft); }

    .genre-main { min-height: 100vh; padding-bottom: 48px; }
    .genre-hero { min-height: 280px; border-bottom: 1px solid #e6edf5; background-image: linear-gradient(90deg, #fff 1%, rgba(255,255,255,.97) 36%, rgba(255,255,255,.72) 61%, rgba(255,255,255,.12)), url("assets/hero.png"); background-size: cover; background-position: center; }
    .genre-hero-inner { padding-top: 25px; }
    .breadcrumbs { display: flex; align-items: center; gap: 10px; color: #748092; font-size: 13px; }
    .breadcrumbs a:hover { color: var(--blue); }
    .genre-title-row { display: flex; align-items: center; gap: 20px; margin-top: 26px; }
    .genre-title-icon { width: 74px; height: 74px; display: grid; place-items: center; border: 1px solid #b9a4e7; border-radius: 15px; background: linear-gradient(145deg, #f5efff, #e9defc); box-shadow: 0 8px 22px rgba(101,61,168,.14); }
    .genre-title-icon img { width: 38px; height: 38px; filter: invert(41%) sepia(39%) saturate(2215%) hue-rotate(232deg) brightness(88%); }
    .genre-title-row h1 { margin: 0 0 6px; font-size: 43px; line-height: 1; letter-spacing: -1.4px; }
    .genre-title-row strong { color: #7651c3; font-size: 16px; }
    .genre-hero-inner > p { margin: 20px 0 0; color: #516074; font-size: 14px; line-height: 1.65; }

    .catalog-tabs { min-height: 67px; display: flex; align-items: stretch; justify-content: space-between; gap: 20px; margin-top: -1px; padding: 0 12px; border: 1px solid var(--line); border-radius: 0 0 13px 13px; background: white; box-shadow: 0 6px 18px rgba(16,45,82,.04); }
    .tab-list { display: flex; overflow-x: auto; }
    .tab-list button { position: relative; min-width: max-content; padding: 0 20px; border: 0; color: #657286; background: none; font-size: 13px; cursor: pointer; }
    .tab-list button::after { content: ""; position: absolute; right: 12px; bottom: -1px; left: 12px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
    .tab-list button:hover, .tab-list button.active { color: #6742b0; }
    .tab-list button.active::after { background: #7851c8; }
    .view-switch { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
    .view-switch button { height: 40px; display: flex; align-items: center; gap: 7px; padding: 0 13px; border: 0; border-radius: 8px; color: #667386; background: transparent; cursor: pointer; }
    .view-switch button.active { color: #6742b0; background: #eee8fb; }

    .catalog-layout { display: grid; grid-template-columns: 270px minmax(0,1fr); gap: 22px; align-items: start; margin-top: 22px; }
    .filter-panel { position: sticky; top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 5px 18px rgba(16,45,82,.04); }
    .filter-head { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid #e8edf3; }
    .filter-head h2 { margin: 0; font-size: 17px; }
    .filter-head button { padding: 0; border: 0; color: var(--blue); background: none; font-size: 12px; cursor: pointer; }
    .filter-panel form { padding: 0 18px 19px; }
    .filter-panel fieldset { margin: 0; padding: 20px 0; border: 0; border-bottom: 1px solid #e8edf3; }
    .filter-panel legend { margin-bottom: 13px; color: #3f4d60; font-size: 13px; font-weight: 650; }
    .filter-panel fieldset > label { min-height: 30px; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px; color: #576578; font-size: 12px; }
    .filter-panel input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--violet); }
    .filter-panel small { color: #8290a2; }
    .chapter-range { width: 100%; accent-color: var(--violet); }
    .range-inputs, .year-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
    .range-inputs label { height: 36px; display: flex; align-items: center; gap: 5px; padding-left: 8px; border: 1px solid var(--line); border-radius: 7px; color: #7c8795; font-size: 11px; }
    .range-inputs input { width: 100%; min-width: 0; height: 100%; border: 0; outline: none; color: #4b596b; background: transparent; font-size: 11px; }
    .filter-stars { color: #f4b400; letter-spacing: 1px; }
    .filter-tags { display: flex; flex-wrap: wrap; gap: 7px; }
    .filter-tags button { min-height: 27px; padding: 0 10px; border: 1px solid var(--line); border-radius: 14px; color: #5c697b; background: #fafcff; font-size: 11px; cursor: pointer; }
    .filter-tags button.active { color: #6742b0; border-color: #bba9df; background: #f1ebfc; }
    .show-more-tags { margin-top: 10px; padding: 0; border: 0; color: var(--blue); background: none; font-size: 11px; cursor: pointer; }
    .year-inputs select { height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: #586679; background: white; font-size: 11px; }
    .filter-submit { width: 100%; margin-top: 19px; background: linear-gradient(135deg, #7b55c9, #6540af); box-shadow: 0 7px 16px rgba(100,63,174,.2); }

    .catalog-content { min-width: 0; }
    .results-head { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 10px; color: #687588; font-size: 13px; }
    .pagination { display: flex; align-items: center; gap: 5px; }
    .pagination a, .pagination span { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; }
    .pagination a:hover { color: #6742b0; background: #f0eafa; }
    .pagination a.active { color: #fff; background: #7650c1; }
    .catalog-results { display: grid; gap: 10px; }
    .catalog-book { min-height: 222px; display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 19px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 4px 14px rgba(16,45,82,.035); transition: transform .2s, box-shadow .2s, border-color .2s; }
    .catalog-book:hover { transform: translateY(-2px); border-color: #aac7e8; box-shadow: var(--shadow); }
    .catalog-cover { width: 150px; height: 204px; border-radius: 8px; background-image: url("design/ChatGPT Image 5 авг. 2026 г., 19_54_39.png"); background-repeat: no-repeat; background-size: 727% auto; background-position-y: 44.4%; }
    .cover-1 { background-position-x: 5%; }
    .cover-2 { background-position-x: 59%; }
    .cover-3 { background-position-x: 77%; }
    .cover-4 { background-position-x: 23%; }
    .cover-5 { background-position-x: 41%; }
    .cover-6 { background-position-x: 95%; }
    .catalog-book-info { min-width: 0; display: flex; flex-direction: column; padding: 8px 8px 6px 0; }
    .book-heading { display: grid; grid-template-columns: minmax(0,1fr) auto 30px; gap: 13px; align-items: start; }
    .book-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.25px; }
    .book-heading h2 a:hover { color: var(--blue); }
    .book-heading p { margin: 5px 0 0; color: #7b8797; font-size: 12px; }
    .book-score { display: grid; justify-items: end; gap: 4px; }
    .book-score strong { color: #263345; font-size: 17px; white-space: nowrap; }
    .book-score strong::first-letter { color: #f4b400; }
    .book-score small { color: #8591a1; font-size: 10px; }
    .bookmark-button { width: 30px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
    .bookmark-button img { width: 20px; height: 20px; opacity: .65; }
    .bookmark-button.active img { filter: invert(36%) sepia(84%) saturate(1641%) hue-rotate(210deg); opacity: 1; }
    .status-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
    .status-row span { padding: 5px 8px; border: 1px solid #d7e0ea; border-radius: 6px; color: #6d7889; background: #fafcff; font-size: 10px; }
    .book-summary-text { margin: 11px 0 9px; overflow: hidden; color: #5f6c7d; font-size: 12px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .book-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: auto; color: #667386; font-size: 11px; }
    .book-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-left: auto; }
    .book-tags span { padding: 5px 10px; border: 1px solid #d8e1eb; border-radius: 14px; background: #fafcff; }

    .catalog-results.grid-view { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
    .grid-view .catalog-book { display: block; min-height: 0; padding: 0; overflow: hidden; }
    .grid-view .catalog-cover { width: 100%; height: auto; aspect-ratio: 1 / 1.25; border-radius: 0; background-size: 727% auto; }
    .grid-view .catalog-book-info { padding: 14px; }
    .grid-view .book-heading { grid-template-columns: minmax(0,1fr) auto; }
    .grid-view .book-heading h2 { font-size: 15px; }
    .grid-view .bookmark-button { display: none; }
    .grid-view .book-summary-text { display: none; }
    .grid-view .book-footer { margin-top: 13px; gap: 8px; }
    .grid-view .book-tags { display: none; }
    .footer { padding: 6px 0 34px; color: #778291; font-size: 12px; text-align: center; }

    @media (max-width: 1120px) {
      .header-inner { gap: 25px; }
      .main-nav { gap: 22px; }
      .search { display: none; }
      .catalog-layout { grid-template-columns: 240px minmax(0,1fr); }
      .catalog-book { grid-template-columns: 130px minmax(0,1fr); }
      .catalog-cover { width: 130px; height: 177px; }
      .catalog-book { min-height: 195px; }
      .book-tags { display: none; }
    }

    @media (max-width: 860px) {
      .container { width: min(calc(100% - 32px), var(--container)); }
      .site-header { height: 64px; }
      .header-inner { justify-content: space-between; }
      .logo { font-size: 21px; }
      .logo img { width: 30px; height: 30px; }
      .main-nav, .header-actions { display: none; }
      .mobile-menu { display: block; }
      .catalog-tabs { align-items: center; flex-direction: column; padding: 8px 10px; }
      .tab-list { width: 100%; min-height: 50px; }
      .view-switch { align-self: flex-end; }
      .catalog-layout { grid-template-columns: 1fr; }
      .filter-panel { position: static; }
      .filter-panel form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 25px; }
      .filter-submit { align-self: end; }
    }

    @media (max-width: 620px) {
      .genre-hero { min-height: 310px; background-image: linear-gradient(90deg, rgba(255,255,255,.96), rgba(255,255,255,.72)), url("assets/hero.png"); }
      .genre-title-row h1 { font-size: 36px; }
      .genre-title-icon { width: 62px; height: 62px; }
      .genre-title-icon img { width: 32px; height: 32px; }
      .catalog-tabs { margin-inline: -16px; border-radius: 0; }
      .filter-panel form { grid-template-columns: 1fr; }
      .results-head { align-items: flex-start; flex-direction: column; }
      .pagination { align-self: flex-end; }
      .pagination a:nth-of-type(4), .pagination span { display: none; }
      .catalog-book { grid-template-columns: 105px minmax(0,1fr); gap: 12px; min-height: 164px; padding: 7px; }
      .catalog-cover { width: 105px; height: 143px; }
      .catalog-book-info { padding-top: 4px; }
      .book-heading { grid-template-columns: minmax(0,1fr) auto; }
      .book-heading h2 { font-size: 15px; }
      .bookmark-button { display: none; }
      .book-score small, .book-heading p { display: none; }
      .status-row { margin-top: 8px; }
      .book-summary-text { margin-block: 8px; -webkit-line-clamp: 2; }
      .book-footer { gap: 8px; }
      .catalog-results.grid-view { grid-template-columns: repeat(2,1fr); }
    }

    @media (max-width: 420px) {
      .container { width: min(calc(100% - 22px), var(--container)); }
      .genre-hero-inner > p br { display: none; }
      .view-switch span { display: none; }
      .catalog-book { grid-template-columns: 90px minmax(0,1fr); min-height: 144px; }
      .catalog-cover { width: 90px; height: 123px; }
      .book-summary-text { display: none; }
      .book-footer span:nth-child(2), .book-footer span:nth-child(3) { display: none; }
      .catalog-results.grid-view { grid-template-columns: 1fr; }
    }
}

@scope (.top-page) {
    :scope {
      --blue: #0969e8;
      --violet: #6750d5;
      --ink: #101828;
      --muted: #667085;
      --line: #dce4ee;
      --soft: #f5f9fd;
      --page: #f7f9fc;
      --shadow: 0 12px 32px rgba(16,45,82,.08);
      --container: 1320px;
      margin: 0;
      color: var(--ink);
      background: var(--page);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      -webkit-font-smoothing: antialiased;
    }
    * { box-sizing: border-box; }
    a { color: inherit; text-decoration: none; }
    button, input { font: inherit; }
    img { display: block; max-width: 100%; }
    .container { width: min(calc(100% - 64px), var(--container)); margin-inline: auto; }

    .site-header { position: relative; z-index: 20; height: 72px; background: rgba(255,255,255,.97); border-bottom: 1px solid #edf1f6; box-shadow: 0 3px 12px rgba(16,24,40,.04); }
    .header-inner { height: 100%; display: flex; align-items: center; gap: 44px; }
    .logo { display: inline-flex; align-items: center; gap: 10px; font-size: 25px; font-weight: 800; letter-spacing: -.7px; }
    .logo img { width: 34px; height: 34px; filter: invert(30%) sepia(97%) saturate(2582%) hue-rotate(205deg) brightness(94%) contrast(101%); }
    .main-nav { display: flex; align-items: center; gap: 38px; margin-right: auto; font-size: 14px; font-weight: 550; }
    .main-nav a { position: relative; transition: color .2s ease; }
    .main-nav a:hover, .main-nav a.active { color: var(--blue); }
    .main-nav a.active::after { content: ""; position: absolute; right: 0; bottom: -26px; left: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--violet); }
    .search { position: relative; width: 218px; }
    .search input { width: 100%; height: 40px; padding: 0 42px 0 16px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: white; }
    .search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(9,105,232,.1); }
    .search img { position: absolute; top: 11px; right: 13px; width: 18px; height: 18px; opacity: .7; }
    .header-actions { display: flex; gap: 10px; }
    .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 22px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; font-size: 14px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
    .btn:hover { transform: translateY(-1px); }
    .btn-primary { color: white; background: linear-gradient(135deg, #0875ef, #075bc9); box-shadow: 0 8px 18px rgba(9,105,232,.2); }
    .btn-ghost { color: #344054; background: white; border-color: var(--line); }
    .mobile-menu { display: none; position: relative; }
    .mobile-menu summary { display: grid; place-items: center; padding: 6px; cursor: pointer; list-style: none; }
    .mobile-menu summary::-webkit-details-marker { display: none; }
    .mobile-menu summary img { width: 27px; height: 27px; }
    .mobile-nav { position: absolute; top: 45px; right: 0; width: 230px; display: grid; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
    .mobile-nav a { padding: 11px 12px; border-radius: 8px; font-size: 14px; }
    .mobile-nav a:hover { color: var(--blue); background: var(--soft); }

    .top-main { padding-block: 28px 48px; }
    .top-layout { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(280px, .85fr); gap: 28px; align-items: start; }
    .breadcrumbs { display: flex; align-items: center; gap: 10px; color: #748092; font-size: 13px; }
    .breadcrumbs a:hover { color: var(--blue); }
    .ranking-column h1 { margin: 23px 0 8px; font-size: 38px; line-height: 1; letter-spacing: -1.1px; }
    .top-intro { margin: 0; color: #657286; font-size: 13px; }

    .ranking-tabs { display: flex; margin-top: 27px; overflow-x: auto; border-bottom: 1px solid var(--line); }
    .ranking-tabs button { position: relative; min-width: max-content; height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 22px; border: 0; color: #596679; background: none; font-size: 13px; cursor: pointer; }
    .ranking-tabs button::after { content: ""; position: absolute; right: 12px; bottom: -1px; left: 12px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
    .ranking-tabs button:hover, .ranking-tabs button.active { color: #5941bd; }
    .ranking-tabs button.active::after { background: var(--violet); }
    .ranking-tabs button img { width: 19px; height: 19px; opacity: .7; }
    .ranking-tabs button span { font-size: 21px; }
    .period-tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 15px 0; }
    .period-tabs button { min-height: 39px; padding: 0 18px; border: 1px solid var(--line); color: #657286; background: white; font-size: 12px; cursor: pointer; }
    .period-tabs button:first-child { border-radius: 8px 0 0 8px; }
    .period-tabs button:last-child { border-radius: 0 8px 8px 0; }
    .period-tabs button + button { margin-left: -1px; }
    .period-tabs button.active { position: relative; z-index: 1; color: #fff; border-color: #6b54c5; background: #6b54c5; }

    .ranking-list { display: grid; gap: 7px; }
    .rank-book { min-height: 164px; display: grid; grid-template-columns: 58px 112px minmax(0,1fr); gap: 14px; padding: 8px 10px 8px 8px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 4px 14px rgba(16,45,82,.035); transition: transform .2s, border-color .2s, box-shadow .2s; }
    .rank-book:hover { transform: translateY(-2px); border-color: #aac7e8; box-shadow: var(--shadow); }
    .rank-number { display: grid; place-content: center; justify-items: center; gap: 5px; color: #526175; font-size: 20px; }
    .rank-number span { color: #b9c3cf; font-size: 23px; }
    .rank-gold .rank-number { color: #bd8600; }
    .rank-gold .rank-number span { color: #f0b000; }
    .rank-silver .rank-number span { color: #9ca9b7; }
    .rank-bronze .rank-number { color: #b26823; }
    .rank-bronze .rank-number span { color: #d47b24; }
    .rank-cover { width: 112px; height: 148px; border-radius: 7px; background-image: url("design/ChatGPT Image 5 авг. 2026 г., 19_54_39.png"); background-repeat: no-repeat; background-size: 727% auto; background-position-y: 44.4%; }
    .rank-cover-1, .rank-cover-10 { background-position-x: 5%; }
    .rank-cover-2 { background-position-x: 59%; }
    .rank-cover-3 { background-position-x: 77%; }
    .rank-cover-4 { background-position-x: 23%; }
    .rank-cover-5, .rank-cover-7 { background-position-x: 41%; }
    .rank-cover-6 { background-position-x: 95%; }
    .rank-cover-8 { background-position-x: 23%; }
    .rank-cover-9 { background-position-x: 5%; filter: hue-rotate(15deg); }
    .rank-info { position: relative; min-width: 0; display: flex; flex-direction: column; padding: 7px 3px 4px 0; }
    .rank-title { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
    .rank-title h2 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
    .rank-title h2 a:hover { color: var(--blue); }
    .rank-title p { margin: 5px 0 0; color: #7b8797; font-size: 11px; }
    .rank-rating { display: grid; justify-items: end; gap: 4px; }
    .rank-rating strong { white-space: nowrap; font-size: 17px; }
    .rank-rating strong::first-letter { color: #f4b400; }
    .rank-rating small { color: #8692a2; font-size: 10px; }
    .rank-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
    .rank-tags span { padding: 4px 8px; border: 1px solid #dde5ed; border-radius: 5px; color: #687588; background: #fafcff; font-size: 9px; }
    .rank-description { max-width: calc(100% - 120px); margin: 10px 0 0; overflow: hidden; color: #5f6d7e; font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
    .rank-growth { position: absolute; right: 2px; bottom: 6px; display: grid; justify-items: end; color: #159447; font-size: 14px; font-weight: 700; }
    .rank-growth small { margin-top: 3px; color: #58a472; font-size: 9px; font-weight: 500; }
    .show-more-ranking { width: 100%; min-height: 41px; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; color: #4e5c6f; background: white; cursor: pointer; }

    .top-sidebar { display: grid; gap: 18px; padding-top: 39px; }
    .top-panel { padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 5px 18px rgba(16,45,82,.04); }
    .top-panel h2 { margin: 0 0 19px; font-size: 17px; }
    .top-categories { display: grid; gap: 4px; }
    .top-categories a { min-height: 37px; display: flex; align-items: center; padding: 0 11px; border-radius: 7px; color: #526074; font-size: 12px; }
    .top-categories a:hover { color: #5740b4; background: #f5f1fd; }
    .top-categories a.active { color: #5740b4; background: #eee9fb; font-weight: 700; }
    .show-categories { margin: 12px 0 0 11px; padding: 0; border: 0; color: var(--blue); background: none; font-size: 11px; cursor: pointer; }
    .explainer p, .explainer li, .explainer small { color: #647184; font-size: 12px; line-height: 1.65; }
    .explainer ul { margin: 12px 0; padding-left: 18px; }
    .collection-list { display: grid; gap: 13px; }
    .collection-list a { display: grid; grid-template-columns: 78px 1fr; gap: 12px; align-items: center; }
    .mini-cover { width: 78px; height: 58px; border-radius: 7px; background-image: url("design/ChatGPT Image 5 авг. 2026 г., 19_54_39.png"); background-repeat: no-repeat; background-size: 727% auto; background-position-y: 44.4%; }
    .mini-1 { background-position-x: 5%; }
    .mini-2 { background-position-x: 77%; }
    .mini-3 { background-position-x: 41%; }
    .collection-list strong { font-size: 12px; line-height: 1.45; }
    .panel-button { width: 100%; min-height: 38px; margin-top: 18px; padding-inline: 12px; font-size: 11px; }
    .updates-list { display: grid; gap: 13px; }
    .updates-list a { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; align-items: center; }
    .update-cover { width: 42px; height: 56px; border-radius: 5px; background-image: url("design/ChatGPT Image 5 авг. 2026 г., 19_54_39.png"); background-repeat: no-repeat; background-size: 727% auto; background-position-y: 44.4%; }
    .update-1 { background-position-x: 5%; }
    .update-2 { background-position-x: 59%; }
    .update-3 { background-position-x: 23%; }
    .update-4 { background-position-x: 41%; }
    .updates-list strong { display: block; font-size: 11px; line-height: 1.35; }
    .updates-list small { display: block; margin-top: 5px; color: #7b8796; font-size: 10px; }
    .updates-list em { padding: 4px 6px; border-radius: 5px; color: #15723b; background: #dff5e8; font-size: 8px; font-style: normal; font-weight: 800; }
    .footer { padding: 4px 0 34px; color: #778291; font-size: 12px; text-align: center; }

    @media (max-width: 1120px) {
      .header-inner { gap: 25px; }
      .main-nav { gap: 22px; }
      .search { display: none; }
      .top-layout { grid-template-columns: minmax(0,2fr) minmax(260px,.8fr); gap: 20px; }
      .rank-book { grid-template-columns: 48px 100px minmax(0,1fr); }
      .rank-cover { width: 100px; height: 137px; }
      .rank-book { min-height: 153px; }
    }

    @media (max-width: 860px) {
      .container { width: min(calc(100% - 32px), var(--container)); }
      .site-header { height: 64px; }
      .header-inner { justify-content: space-between; }
      .logo { font-size: 21px; }
      .logo img { width: 30px; height: 30px; }
      .main-nav, .header-actions { display: none; }
      .mobile-menu { display: block; }
      .top-layout { grid-template-columns: 1fr; }
      .top-sidebar { grid-template-columns: 1fr 1fr; padding-top: 0; }
      .category-panel, .explainer { min-height: 100%; }
    }

    @media (max-width: 600px) {
      .ranking-column h1 { font-size: 34px; }
      .period-tabs { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; }
      .period-tabs button { border-radius: 7px !important; }
      .period-tabs button + button { margin-left: 0; }
      .rank-book { grid-template-columns: 36px 82px minmax(0,1fr); gap: 8px; min-height: 126px; padding: 6px; }
      .rank-cover { width: 82px; height: 112px; }
      .rank-title h2 { font-size: 14px; }
      .rank-title p, .rank-description, .rank-tags { display: none; }
      .rank-rating strong { font-size: 14px; }
      .rank-growth { left: 0; right: auto; bottom: 8px; font-size: 11px; }
      .rank-growth small { display: none; }
      .top-sidebar { grid-template-columns: 1fr; }
    }

    @media (max-width: 390px) {
      .container { width: min(calc(100% - 22px), var(--container)); }
      .ranking-tabs button { padding-inline: 15px; }
      .rank-book { grid-template-columns: 31px 72px minmax(0,1fr); }
      .rank-cover { width: 72px; height: 99px; }
      .rank-book { min-height: 113px; }
      .rank-number { font-size: 16px; }
      .rank-rating small { display: none; }
    }
}
