.guide-shell { width: min(1420px, calc(100% - 48px)); margin: 34px auto 70px; }
.guide-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin: 0 0 24px; padding: 0 6px; }
.guide-heading span, .guide-article > header > span { color: #c57cf2; font-size: 11px; font-weight: 700; letter-spacing: .15em; }
.guide-heading h1, .guide-article h1 { margin: 5px 0 0; color: #f1edf5; font-size: clamp(28px, 3vw, 42px); }
.guide-heading p { max-width: 560px; margin: 0; color: #aaa4b2; line-height: 1.65; }
.guide-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 26px; align-items: start; }
.guide-navigation, .guide-article, .guide-book, .guide-empty, .guide-children a { border-color: rgba(196, 93, 240, .24); }
.guide-navigation { position: sticky; top: 92px; padding: 16px 12px; }
.guide-navigation-title, .guide-navigation-home { display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; color: #d492f7; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.guide-title-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid rgba(200, 110, 243, .3); border-radius: 7px; background: rgba(184, 82, 226, .08); font-size: 14px; }
.guide-navigation ul { margin: 0; padding: 0; list-style: none; }
.guide-navigation ul ul { margin: 3px 0 7px; padding-left: 12px; border-left: 1px solid rgba(194, 111, 238, .18); }
.guide-navigation li > a { display: block; padding: 8px 10px; border-radius: 8px; color: #aaa5b0; font-size: 13px; line-height: 1.35; text-decoration: none; }
.guide-navigation li > a:hover, .guide-navigation li.is-active > a { color: #f0d9ff; background: rgba(184, 92, 232, .13); }
.guide-tree-kind-book > a { color: #d6cbdc !important; font-weight: 700; }
.guide-library { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.guide-book { display: flex; min-height: 238px; flex-direction: column; padding: 19px 20px 16px; color: inherit; text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
.guide-book:hover { transform: translateY(-3px); border-color: rgba(211, 121, 250, .52); }
.guide-book-heading { display: flex; align-items: center; gap: 11px; }
.guide-book-heading small { color: #bd70e4; font-size: 10px; letter-spacing: .13em; }
.guide-book-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid rgba(202, 117, 244, .3); border-radius: 9px; background: rgba(180, 82, 225, .09) center / cover; }
.guide-book-icon i { color: #d07df9; font-size: 19px; font-style: normal; }
.guide-book-icon.has-cover i { display: none; }
.guide-book-copy { display: flex; flex: 1; flex-direction: column; padding: 22px 1px 18px; }
.guide-book-copy strong { color: #e9e3ed; font-size: 18px; line-height: 1.3; }
.guide-book-copy em { display: -webkit-box; margin-top: 10px; overflow: hidden; color: #97919d; font-size: 13px; font-style: normal; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.guide-book-footer { display: flex; justify-content: space-between; padding-top: 13px; border-top: 1px solid rgba(196, 119, 235, .15); color: #77717d; font-size: 11px; }
.guide-book-footer i { color: #c271e9; font-size: 17px; font-style: normal; }
.guide-empty { grid-column: 1 / -1; padding: 44px; color: #aaa4b2; text-align: center; }
.guide-empty strong { display: block; color: #e4dce9; font-size: 22px; }
.guide-layout--article { grid-template-columns: 260px minmax(0, 1fr); justify-content: stretch; }
.guide-article { padding: clamp(28px, 5vw, 64px); overflow: hidden; }
.guide-breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; color: #706b76; font-size: 12px; }
.guide-breadcrumbs a { color: #a974c4; text-decoration: none; }
.guide-cover { width: calc(100% + 2 * clamp(28px, 5vw, 64px)); max-width: none; margin: 0 calc(-1 * clamp(28px, 5vw, 64px)) 36px; aspect-ratio: 16 / 7; object-fit: cover; }
.guide-article > header { padding-bottom: 28px; border-bottom: 1px solid rgba(196, 119, 235, .18); }
.guide-article > header p { max-width: 700px; color: #aaa4b2; line-height: 1.65; }
.guide-content { padding-top: 22px; color: #c8c2cc; font-size: 16px; line-height: 1.78; }
.guide-content:empty { display: none; }
.guide-content h2, .guide-content h3 { margin: 1.8em 0 .65em; color: #eee8f2; }
.guide-content code { padding: .15em .42em; border: 1px solid rgba(196, 119, 235, .25); border-radius: 6px; background: #14111a; color: #d7a2f2; }
.guide-content pre { padding: 17px; overflow: auto; border: 1px solid rgba(196, 119, 235, .24); border-radius: 10px; background: #100d16; }
.guide-content pre code { padding: 0; border: 0; background: none; }
.guide-content img { max-width: 100%; height: auto; border-radius: 12px; box-shadow: 0 18px 42px rgba(4, 2, 9, .38); }
.guide-children { margin-top: 34px; padding-top: 24px; border-top: 1px solid rgba(196, 119, 235, .18); }
.guide-children h2 { color: #d9d1dd; font-size: 18px; }
.guide-children a { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin-top: 10px; padding: 14px 16px; text-decoration: none; }
.guide-children a:hover { border-color: rgba(211, 121, 250, .42); }
.guide-children span { color: #d8d1dc; }
.guide-children small { grid-column: 1; color: #817b86; }
.guide-children i { grid-column: 2; grid-row: 1 / 3; align-self: center; color: #c177e7; font-style: normal; }
@media (max-width: 1120px) { .guide-library { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .guide-shell { width: min(100% - 24px, 720px); } .guide-heading { display: block; } .guide-heading p { margin-top: 12px; } .guide-layout, .guide-layout--article { grid-template-columns: 1fr; } .guide-navigation { position: relative; top: auto; } }
@media (max-width: 600px) { .guide-library { grid-template-columns: 1fr; } .guide-article { padding: 22px; } }

/* V33.3 — единый каркас и компактное оглавление */
.guide-heading {
    min-height: 88px;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 2px 18px;
    border-bottom: 1px solid rgba(190, 105, 231, .16);
}

.guide-heading-title {
    width: min(58%, 760px);
}

.guide-heading h1 {
    max-width: 760px;
    font-size: clamp(27px, 2.6vw, 40px);
    line-height: 1.13;
}

.guide-heading > p {
    width: min(38%, 520px);
    font-size: 13px;
}

.guide-layout--article {
    grid-template-columns: 260px minmax(0, 1fr);
    justify-content: stretch;
}

.guide-navigation {
    max-height: calc(100vh - 116px);
    padding: 12px 9px 11px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(190, 104, 230, .35) transparent;
}

.guide-navigation-title,
.guide-navigation-home {
    gap: 8px;
    padding: 0 5px 9px;
    font-size: 10px;
}

.guide-title-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
}

.guide-navigation ul ul {
    margin: 1px 0 3px 7px;
    padding-left: 7px;
}

.guide-tree-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px;
    align-items: center;
    gap: 1px;
}

.guide-tree-row > a {
    min-width: 0;
    padding: 5px 6px;
    border-radius: 6px;
    color: #9f99a5;
    font-size: 11.5px;
    line-height: 1.28;
    text-decoration: none;
}

.guide-tree-row > a:hover,
.guide-navigation li.is-active > .guide-tree-row > a {
    color: #f0d9ff;
    background: rgba(184, 92, 232, .13);
}

.guide-tree-row > button {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #756d7b;
    cursor: pointer;
}

.guide-tree-row > button:hover {
    background: rgba(184, 92, 232, .1);
    color: #cf82f5;
}

.guide-tree-row > button span {
    display: block;
    transform: rotate(-90deg);
    transition: transform .18s ease;
}

.guide-navigation li.is-open > .guide-tree-row > button span {
    transform: rotate(0);
}

.guide-navigation li > a {
    padding: 5px 6px;
    font-size: 11.5px;
}

.guide-tree-kind-book > .guide-tree-row > a,
.guide-tree-kind-chapter > .guide-tree-row > a {
    color: #c9bfce;
    font-weight: 650;
}

.guide-tree-branch[hidden] {
    display: none;
}

.guide-main {
    display: grid;
    gap: 22px;
    min-width: 0;
}

.guide-article {
    padding: clamp(26px, 4vw, 50px);
}

.guide-cover {
    width: calc(100% + 2 * clamp(26px, 4vw, 50px));
    margin: calc(-1 * clamp(26px, 4vw, 50px)) calc(-1 * clamp(26px, 4vw, 50px)) 30px;
}

.guide-content {
    padding-top: 0;
}

.guide-children {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.guide-children h2 {
    margin: 0 0 12px 2px;
    color: #bcb5c1;
    font-size: 12px;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.guide-children-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.guide-children a {
    min-height: 124px;
    margin-top: 0;
    padding: 17px 18px;
}

.guide-children a > span {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.guide-children a small {
    color: #ba6dde;
    font-size: 9px;
    letter-spacing: .12em;
}

.guide-children a strong {
    margin-top: 7px;
    color: #ded7e2;
    font-size: 14px;
    line-height: 1.35;
}

.guide-children a em {
    display: -webkit-box;
    margin-top: 7px;
    overflow: hidden;
    color: #817b86;
    font-size: 11px;
    font-style: normal;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.guide-children a > i {
    align-self: end;
}

@media (max-width: 900px) {
    .guide-heading { align-items: start; }
    .guide-heading-title,
    .guide-heading > p { width: auto; }
    .guide-navigation { max-height: 46vh; }
}

/* V33.7 — поиск и инструменты оглавления */
.guide-tree-tools {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    gap: 6px;
    margin: 7px 2px 10px;
}

.guide-tree-search {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid rgba(196, 119, 235, .18);
    border-radius: 8px;
    background: rgba(7, 6, 11, .22);
    color: #8d8492;
}

.guide-tree-search:focus-within { border-color: rgba(207, 113, 248, .46); }
.guide-tree-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #d9d1dd; font: inherit; font-size: 11px; }
.guide-tree-search input::placeholder { color: #77717d; }
.guide-tree-tools details { position: relative; }
.guide-tree-tools summary { display: grid; height: 32px; place-items: center; border: 1px solid rgba(196, 119, 235, .18); border-radius: 8px; color: #a99faf; cursor: pointer; list-style: none; }
.guide-tree-tools summary::-webkit-details-marker { display: none; }
.guide-tree-tools details[open] summary { border-color: rgba(207, 113, 248, .46); color: #ca78ed; }
.guide-tree-tools details > div { position: absolute; z-index: 8; top: calc(100% + 6px); right: 0; display: grid; width: 142px; gap: 3px; padding: 5px; border: 1px solid rgba(196, 119, 235, .25); border-radius: 9px; background: rgba(24, 21, 30, .97); box-shadow: 0 12px 28px rgba(0,0,0,.35); }
.guide-tree-tools details button { border: 0; border-radius: 6px; padding: 8px 9px; background: transparent; color: #bdb5c1; font: inherit; font-size: 11px; text-align: left; cursor: pointer; }
.guide-tree-tools details button:hover { background: rgba(186, 94, 227, .12); color: #d899f3; }
.guide-tree-empty { margin: 7px 3px 10px; color: #77717d; font-size: 11px; text-align: center; }
.guide-navigation li.is-search-match > .guide-tree-row > a { color: #dd91fa; }

@media (max-width: 600px) {
    .guide-children-grid { grid-template-columns: 1fr; }
}

/* V33.5 — плиточная иерархия и читательская страница */
.guide-library,
.guide-children-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.guide-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.guide-card-cover {
    position: relative;
    z-index: 2;
    display: block;
    width: calc(100% - 18px);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(199, 109, 240, .3);
    border-radius: 12px;
    aspect-ratio: 16 / 9;
    background: #15121c;
    box-shadow: 0 14px 30px rgba(3, 2, 8, .36);
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

.guide-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: var(--custom-tile-media-opacity, 1);
    transition: opacity .46s ease, transform .28s ease;
}

.guide-card-cover.is-placeholder img {
    opacity: var(--custom-tile-media-opacity, 1);
    filter: brightness(.78) saturate(.82);
}

.guide-card-panel {
    z-index: 1;
    display: flex;
    min-height: 192px;
    flex: 1;
    flex-direction: column;
    margin-top: -24px;
    padding: 39px 17px 13px;
}

.guide-card-panel > small {
    color: #bb6ee1;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .13em;
}

.guide-card-panel > strong {
    display: -webkit-box;
    margin-top: 7px;
    overflow: hidden;
    color: #e3dde7;
    font-size: 15px;
    line-height: 1.32;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.guide-card-panel > em {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    color: #918b96;
    font-size: 11px;
    font-style: normal;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}

.guide-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 11px;
    border-top: 1px solid rgba(196, 119, 235, .14);
    color: #77717d;
    font-size: 10px;
}

.guide-card-footer i {
    color: #c271e9;
    font-size: 16px;
    font-style: normal;
}

.guide-card:hover .guide-card-cover {
    border-color: rgba(216, 126, 255, .58);
    box-shadow: 0 18px 38px rgba(3, 2, 8, .46), 0 0 24px rgba(183, 81, 231, .12);
    transform: translateY(-2px);
}

.guide-card:hover .guide-card-cover img {
    transform: scale(1.018);
}

.guide-card:hover .guide-card-panel {
    border-color: rgba(211, 121, 250, .46);
}

/* V33.6 — универсальная иерархия и одинаковые плитки на всех уровнях */
.guide-heading-title {
    width: auto;
    max-width: min(72%, 820px);
}

.guide-heading > .guide-heading-kind {
    margin-left: auto;
    padding-bottom: 7px;
    color: #b96cdd;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .15em;
    text-align: right;
    text-transform: uppercase;
}

.guide-children a.guide-card {
    display: flex;
    min-height: 0;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.guide-children a.guide-card > .guide-card-cover {
    display: block;
    width: calc(100% - 18px);
    min-width: 0;
    flex: none;
}

.guide-card-panel,
.guide-children a.guide-card > .guide-card-panel {
    display: flex;
    min-height: 186px;
    flex: 1;
    flex-direction: column;
    margin-top: -14%;
    padding: calc(14% + 14px) 17px 13px;
}

.guide-children .guide-card-panel > small { color: #bb6ee1; font-size: 9px; letter-spacing: .13em; }
.guide-children .guide-card-panel > strong { margin-top: 7px; color: #e3dde7; font-size: 15px; line-height: 1.32; }
.guide-children .guide-card-panel > em { margin-top: 8px; color: #918b96; font-size: 11px; line-height: 1.45; }

@media (max-width: 900px) {
    .guide-heading-title { max-width: none; }
    .guide-heading > .guide-heading-kind { margin: 10px 0 0; text-align: left; }
}

.guide-article {
    padding: clamp(30px, 4.5vw, 58px);
}

.guide-article-inner {
    width: min(100%, 880px);
    margin: 0 auto;
}

.guide-article .guide-cover {
    width: 100%;
    max-width: 100%;
    margin: 0 0 32px;
    border-radius: 12px;
    aspect-ratio: 16 / 9;
    box-shadow: 0 18px 42px rgba(4, 2, 9, .38);
    object-fit: cover;
}

.guide-content img {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 26px 0;
    object-fit: contain;
}

.guide-content table {
    width: 100%;
    margin: 24px 0;
    border-collapse: collapse;
    font-size: 14px;
}

.guide-content th,
.guide-content td {
    padding: 10px 12px;
    border: 1px solid rgba(196, 119, 235, .18);
    text-align: left;
    vertical-align: top;
}

.guide-content th {
    background: rgba(180, 82, 225, .08);
    color: #ddd4e2;
}

.guide-content blockquote {
    margin: 24px 0;
    padding: 12px 16px;
    border-left: 3px solid rgba(199, 109, 240, .55);
    background: rgba(180, 82, 225, .07);
    color: #aaa3af;
}

@media (max-width: 1180px) {
    .guide-library,
    .guide-children-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .guide-library,
    .guide-children-grid { grid-template-columns: 1fr; }
}
