.tr-main {
    flex: 1 0 auto;
    padding-bottom: 8px;
    font-family: 'Helvetica Neue', Arial, system-ui, sans-serif;
}

/* ===== HERO ===== */
.tr-hero {
    display: block;
    padding: 4px 0 22px;
    border-bottom: 1px solid var(--home-card-border);
}

@media (min-width: 768px) {
    .tr-hero {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 28px;
        align-items: stretch;
        padding: 8px 0 28px;
    }
}

.tr-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--home-cover-shadow);
    background: var(--home-bar-track);
}

@media (min-width: 768px) {
    .tr-cover {
        width: auto;
        height: 100%;
        max-height: 280px;
        aspect-ratio: 1 / 1;
        border-radius: 12px;
    }

    .tr-cover-empty .tr-cover-img {
        position: absolute;
        inset: 0;
    }
}

.tf-cover-click {
    cursor: zoom-in;
}

.tr-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .tf-cover-click:hover .tr-cover-img {
        transform: scale(1.03);
    }
}

.tr-hero-body {
    min-width: 0;
    padding-top: 16px;
    text-align: left;
}

@media (min-width: 768px) {
    .tr-hero-body {
        padding-top: 2px;
    }
}

.tr-eyebrow {
    font-size: 12px;
    font-weight: 700;
    color: var(--home-accent);
    margin-bottom: 6px;
}

@media (min-width: 768px) {
    .tr-eyebrow {
        font-size: 13px;
        margin-bottom: 8px;
    }
}

.tr-title {
    margin: 6px 0 10px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--home-text-primary);
    text-wrap: balance;
}

@media (min-width: 768px) {
    .tr-title {
        margin: 0 0 12px;
        font-size: 32px;
        line-height: 1.15;
    }
}

.tr-meta-row {
    margin: 4px 0;
    font-size: 13.5px;
    color: var(--home-text-secondary);
}

@media (min-width: 768px) {
    .tr-meta-row {
        font-size: 14px;
    }
}

.tr-meta-row a {
    color: var(--home-accent);
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .tr-meta-row a:hover {
        text-decoration: underline;
    }
}

.tr-desc {
    margin: 12px 0 0;
    max-width: 620px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--home-text-secondary);
}

@media (min-width: 768px) {
    .tr-desc {
        margin-top: 14px;
        font-size: 14px;
    }
}

/* ===== ДЕЙСТВИЯ ===== */
.tr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

@media (min-width: 768px) {
    .tr-actions {
        margin-top: 18px;
    }
}

.tr-meta-compact {
    display: none;
}

.tr-continue-sub {
    display: none;
}

@media (max-width: 767px) {
    .tr-hero {
        display: grid;
        grid-template-columns: 120px minmax(0, 1fr);
        grid-template-areas:
            "cover head"
            "actions actions"
            "desc desc"
            "resume resume";
        column-gap: 14px;
        align-items: start;
    }

    .tr-hero-body {
        display: contents;
    }

    .tr-cover {
        grid-area: cover;
        width: 120px;
        height: 120px;
        aspect-ratio: auto;
        border-radius: 12px;
    }

    .tr-cover .home-tale-time {
        display: none;
    }

    .tr-hero-head {
        grid-area: head;
        min-width: 0;
        padding-top: 2px;
    }

    .tr-actions {
        grid-area: actions;
        flex-wrap: nowrap;
    }

    .tr-desc {
        grid-area: desc;
    }

    .tf-resume {
        grid-area: resume;
        display: none;
    }

    .tr-eyebrow {
        margin-bottom: 8px;
    }

    .tr-title {
        font-size: 20px;
        margin: 5px 0 8px;
        line-height: 1.18;
    }

    .tr-meta-row {
        font-size: 13px;
    }

    .tr-meta-row a.tr-authorlink {
        color: var(--home-author-link);
    }

    .tr-meta-full {
        display: none;
    }

    .tr-meta-compact {
        display: block;
    }

    .tr-action-continue {
        flex: 1 1 auto;
        min-width: 0;
        height: auto;
        gap: 12px;
        padding: 10px 16px;
        border-radius: 16px;
        justify-content: flex-start;
    }

    .tr-continue-txt {
        display: flex;
        flex-direction: column;
        min-width: 0;
        text-align: left;
    }

    .tr-continue-main {
        font-size: 15px;
    }

    .tr-continue-sub {
        display: block;
        font-size: 12px;
        opacity: 0.85;
        margin-top: 1px;
    }

    .tr-action-fav {
        flex: 0 0 auto;
        width: 40px;
        padding: 0;
    }

    .tr-fav-label {
        display: none;
    }

    .tr-action-continue[hidden] + .tr-action-fav {
        flex: 1 1 auto;
        width: auto;
        padding: 0 16px;
    }

    .tr-action-continue[hidden] + .tr-action-fav .tr-fav-label {
        display: inline;
    }
}

.tr-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: 100px;
    background: var(--home-card-bg);
    border: 1px solid var(--home-card-border);
    font: inherit;
    font-size: 13px;
    color: var(--home-text-primary);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

.tr-action[hidden] {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .tr-action:hover {
        border-color: var(--home-accent);
        transform: translateY(-1px);
    }
}

.tr-action-icononly {
    width: 40px;
    padding: 0;
}

.tr-action-continue {
    background: var(--home-accent);
    border-color: var(--home-accent);
    color: #FFFFFF;
}

@media (hover: hover) and (pointer: fine) {
    .tr-action-continue:hover {
        border-color: var(--home-accent);
        filter: brightness(1.08);
    }
}

@media (hover: hover) and (pointer: fine) {
    .tr-action-fav:hover {
        border-color: var(--tr-fav);
        color: var(--tr-fav);
    }
}

.tr-action-fav.is-fav {
    border-color: var(--tr-fav);
    color: var(--tr-fav);
    background: var(--tr-fav-bg);
}

.tr-fav-icon {
    display: inline-flex;
}

.tr-fav-filled {
    display: none;
}

.tr-action-fav.is-fav .tr-fav-outline {
    display: none;
}

.tr-action-fav.is-fav .tr-fav-filled {
    display: inline-block;
}

.tf-resume {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--home-text-tertiary);
}

.tf-resume a {
    color: var(--home-accent);
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .tf-resume a:hover {
        text-decoration: underline;
    }
}

/* ===== КОЛОНКА ТЕКСТА ===== */
.tf-column {
    display: flow-root;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

/* ===== СОДЕРЖАНИЕ (TOC) ===== */
.tr-toc {
    margin-top: 22px;
    background: var(--home-card-bg);
    border: 1px solid var(--home-card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}

.tr-toc.is-open {
    box-shadow: var(--home-card-hover-shadow);
}

.tr-toc-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .tr-toc-head:hover {
        background: var(--home-section-tinted);
    }
}

.tr-toc-head-l {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tr-toc-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: var(--home-section-tinted);
    color: var(--home-accent);
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.tr-toc-head-text {
    min-width: 0;
}

.tr-toc-title {
    display: block;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--home-text-primary);
}

.tr-toc-sub {
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--home-text-secondary);
}

.tr-dot {
    color: var(--home-dot-separator);
}

.tr-toc-cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 100px;
    background: var(--home-tab-active-bg);
    color: var(--home-tab-active-color);
    font-size: 13px;
    font-weight: 600;
}

.tr-toc-cta-label {
    display: none;
}

@media (min-width: 480px) {
    .tr-toc-cta-label {
        display: inline;
    }
}

.tr-toc-caret {
    display: inline-flex;
    transition: transform 0.2s ease;
}

.tr-toc.is-open .tr-toc-caret {
    transform: rotate(180deg);
}

.tr-toc-list {
    list-style: none;
    margin: 0;
    padding: 4px 8px 10px;
    border-top: 1px solid var(--home-card-border);
}

.tr-toc:not(.is-open) .tr-toc-list {
    display: none;
}

.tr-toc-link {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .tr-toc-link:hover {
        background: var(--home-section-tinted);
    }
}

.tr-toc-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 11.5px;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--home-card-bg);
    border: 1px solid var(--home-card-border);
    color: var(--home-text-tertiary);
}

.tr-toc-marker-check {
    display: none;
}

.tr-toc-item-read .tr-toc-marker {
    background: var(--home-accent);
    border-color: var(--home-accent);
    color: #FFFFFF;
}

.tr-toc-item-read .tr-toc-marker-num {
    display: none;
}

.tr-toc-item-read .tr-toc-marker-check {
    display: inline-flex;
}

.tr-toc-item-current .tr-toc-marker {
    background: var(--home-tab-active-bg);
    border-color: var(--home-tab-active-bg);
    color: var(--home-tab-active-color);
}

.tr-toc-text {
    min-width: 0;
}

.tr-toc-text-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--home-text-tertiary);
    margin-bottom: 2px;
}

.tr-toc-item-current .tr-toc-text-label {
    color: var(--home-accent);
}

.tr-toc-text-main {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--home-text-primary);
}

.tr-toc-item-read .tr-toc-text-main {
    color: var(--home-text-secondary);
}

.tr-toc-item-current .tr-toc-text-main {
    font-weight: 700;
}

/* ===== ТЕКСТ ПРОИЗВЕДЕНИЯ ===== */
.tr-reading {
    margin-top: 20px;
    font-size: 17px;
    line-height: 1.65;
    color: var(--home-text-primary);
}

.tr-reading h2,
.tr-reading .tr-ch-title {
    margin: 36px 0 14px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--home-text-primary);
    scroll-margin-top: 24px;
    text-wrap: balance;
}

@media (min-width: 768px) {
    .tr-reading h2,
    .tr-reading .tr-ch-title {
        font-size: 24px;
    }
}

.tr-reading h2:first-child,
.tr-reading .tr-ch-title:first-child {
    margin-top: 8px;
}

.tr-reading h3 {
    margin: 1.8em 0 0.5em;
    font-size: 17px;
    font-weight: 800;
    color: var(--home-text-primary);
}

.tr-reading p {
    margin: 0 0 1.05em;
    text-wrap: pretty;
}

.tr-reading p:last-child {
    margin-bottom: 0;
}

.tr-reading > p:first-of-type::first-letter {
    float: left;
    font-size: 3.1em;
    line-height: 0.82;
    font-weight: 800;
    padding: 0.02em 0.09em 0 0;
    color: var(--home-accent);
}

/* Иллюстрации в тексте — кликабельные */
.tr-reading .tale-image-block {
    text-align: center;
    margin: 24px 0;
}

.tr-reading img.responsive-image {
    display: block;
    margin: 22px 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    cursor: zoom-in;
    box-shadow: var(--home-cover-shadow);
    transition: transform 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .tr-reading img.responsive-image:hover {
        transform: scale(1.015);
    }
}

/* Десктоп — иллюстрация справа, текст обтекает слева */
@media (min-width: 768px) {
    .tr-reading .tale-image-block {
        float: right;
        clear: right;
        width: 300px;
        margin: 6px 0 16px 28px;
        text-align: right;
    }

    .tr-reading .tale-image-block img.responsive-image {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .tr-reading .tr-ch-title {
        clear: both;
    }
}

/* ===== ОБ АВТОРЕ + ДРУГИЕ ПРОИЗВЕДЕНИЯ ===== */
.tr-author-col {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

@media (min-width: 768px) {
    .tr-author-col {
        gap: 36px;
    }
}

.tr-author {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--home-card-bg);
    border: 1px solid var(--home-card-border);
    border-radius: 12px;
    padding: 18px;
}

@media (min-width: 768px) {
    .tr-author {
        gap: 20px;
        padding: 24px;
    }
}

.tr-author-avatar {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 20px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: 0.02em;
}

@media (min-width: 768px) {
    .tr-author-avatar {
        width: 64px;
        height: 64px;
        font-size: 22px;
    }
}

/* Реальное фото автора вместо инициал-аватара (размер/скругление берутся у .tr-author-avatar) */
img.tr-author-photo {
    object-fit: cover;
    display: block;
}

.tr-author-body {
    min-width: 0;
    flex: 1;
}

.tr-author-eyebrow {
    font-size: 12px;
    font-weight: 700;
    color: var(--home-accent);
    margin-bottom: 4px;
}

.tr-author-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--home-text-primary);
}

@media (min-width: 768px) {
    .tr-author-name {
        font-size: 19px;
    }
}

.tr-author-name a {
    color: inherit;
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .tr-author-name a:hover {
        color: var(--home-accent);
    }
}

.tr-author-years {
    font-size: 13px;
    color: var(--home-text-secondary);
    margin-top: 2px;
}

.tr-author-bio {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--home-text-secondary);
    max-width: 720px;
    text-wrap: pretty;
}

/* Плитки других произведений */
.tr-tales {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (min-width: 768px) {
    .tr-tales {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

@media (min-width: 1200px) {
    .tr-tales {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }
}

.tr-tale {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .tr-tale:hover {
        transform: translateY(-2px);
    }

    .tr-tale:hover .home-tale-cover-wrap {
        box-shadow: var(--home-cover-shadow-hover);
    }
}

.tr-tale-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 1 / 1;
}

.tr-tale-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--home-text-primary);
}

@media (min-width: 768px) {
    .tr-tale-name {
        font-size: 14px;
    }
}

/* ===== ВХОДИТ В ПОДБОРКИ ===== */
.tf-typerow {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

@media (min-width: 768px) {
    .tf-typerow {
        gap: 14px;
    }
}

.tf-typecard {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    flex: 1 1 150px;
    min-width: 0;
    min-height: 118px;
    border-radius: 12px;
    padding: 14px 14px 13px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    color: var(--tr-decor-text);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

@media (min-width: 768px) {
    .tf-typecard {
        min-height: 128px;
    }
}

.tf-typecard > * {
    position: relative;
    z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
    .tf-typecard:hover {
        transform: translateY(-2px);
        box-shadow: var(--home-card-hover-shadow-strong);
    }
}

.tf-typecard-stack {
    width: 54px;
    height: 50px;
}

.tf-typecard .home-collection-card {
    width: 32px;
    height: 42px;
    border-radius: 3px;
}

.tf-typecard .home-collection-card-1 { top: 3px; left: 12px; }
.tf-typecard .home-collection-card-2 { top: 1px; left: 2px; }
.tf-typecard .home-collection-card-3 { top: 5px; left: 22px; }

.tf-typecard-name {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark-theme .tf-typecard::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--home-decor-overlay);
    transition: background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .dark-theme .tf-typecard:hover::before {
        background: var(--home-decor-overlay-hover);
    }
}

/* ===== ПЛАВАЮЩАЯ ПАНЕЛЬ ЧТЕНИЯ ===== */
.tr-rp {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

@media (min-width: 768px) {
    .tr-rp {
        right: 24px;
        bottom: 24px;
    }
}

.tr-rp-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tr-rp-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--he-header-grad);
    color: #FFFFFF;
    border: none;
    display: grid;
    place-items: center;
    position: relative;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 46, 81, 0.28), 0 2px 6px rgba(15, 46, 81, 0.16);
    transition: transform 0.15s ease;
}

.tr-rp-fab[hidden] {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .tr-rp-fab:hover {
        transform: scale(1.06);
    }
}

.tr-rp-fab-ring {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.tr-rp-fab-pct {
    position: relative;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tr-rp-fab-up {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--home-card-border);
    background: var(--home-card-bg);
    color: var(--home-text-primary);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--home-card-hover-shadow);
    transition: transform 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .tr-rp-fab-up:hover {
        transform: scale(1.06);
        border-color: var(--home-accent);
    }
}

.tr-rp-fab-up[hidden] {
    display: none;
}

.tr-rp-card {
    width: min(330px, calc(100vw - 32px));
    background: var(--home-card-bg);
    border: 1px solid var(--home-card-border);
    border-radius: 14px;
    box-shadow: var(--home-card-hover-shadow-strong);
    padding: 18px;
    transform-origin: bottom right;
    animation: tr-rp-in 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tr-rp-card[hidden] {
    display: none;
}

@keyframes tr-rp-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.tr-rp-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.tr-rp-eb {
    font-size: 12px;
    font-weight: 700;
    color: var(--home-accent);
    margin-bottom: 4px;
}

.tr-rp-h {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--home-text-primary);
}

.tr-rp-close {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--home-text-tertiary);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .tr-rp-close:hover {
        background: var(--home-section-tinted);
        color: var(--home-text-primary);
    }
}

.tr-rp-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--home-text-tertiary);
    margin-bottom: 6px;
}

.tr-rp-chapter {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--home-text-primary);
    margin-bottom: 10px;
    text-wrap: balance;
}

.tr-rp-bar {
    height: 4px;
    background: var(--home-bar-track);
    border-radius: 4px;
    overflow: hidden;
}

.tr-rp-bar-fill {
    height: 100%;
    width: 0;
    background: var(--home-accent);
    border-radius: 4px;
    transition: width 0.15s ease;
}

.tr-rp-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.tr-rp-pct {
    font-size: 12.5px;
    color: var(--home-text-secondary);
}

.tr-rp-divider {
    height: 1px;
    background: var(--home-card-border);
    margin: 14px 0;
}

.tr-rp-font {
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    gap: 12px;
    align-items: center;
}

.tr-rp-font-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--home-card-border);
    background: var(--home-card-bg);
    color: var(--home-text-secondary);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .tr-rp-font-btn:hover {
        border-color: var(--home-accent);
        color: var(--home-text-primary);
    }
}

.tr-rp-font-track {
    position: relative;
    height: 32px;
    display: flex;
    align-items: center;
}

.tr-rp-font-line {
    width: 100%;
    height: 4px;
    background: var(--home-bar-track);
    border-radius: 4px;
}

.tr-rp-font-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
    background: var(--home-accent);
    color: #FFFFFF;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    transition: left 0.15s ease;
}

.tr-rp-preview {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--home-section-tinted);
    border-radius: 8px;
    color: var(--home-text-primary);
    line-height: 1.55;
    font-size: 17px;
}

/* ===== ЛАЙТБОКС ===== */
.tr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: var(--tr-lightbox-overlay);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    cursor: zoom-out;
    padding: 40px;
}

.tr-lightbox[hidden] {
    display: none;
}

.tr-lightbox img {
    max-width: min(900px, 92%);
    max-height: 76%;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    background: var(--home-card-bg);
}

.tr-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.tr-lightbox-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
}

@media print {
    .he-root,
    .mhs,
    .tr-rp,
    .ft,
    .tr-lightbox {
        display: none !important;
    }

    .tr-main > section ~ section {
        display: none !important;
    }

    .tr-actions,
    .tf-resume,
    .home-tale-time,
    .tr-toc-cta {
        display: none !important;
    }

    .tr-toc-list {
        display: block !important;
    }

    .tr-toc-head {
        cursor: auto;
    }

    body {
        background: var(--bg-color);
        color: var(--text-color);
    }

    .home-section {
        padding: 0 !important;
        background: none !important;
    }

    .home-container {
        max-width: none !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .tr-hero,
    .tf-column {
        box-shadow: none !important;
        background: none !important;
    }

    .tf-column {
        max-width: none !important;
        width: auto !important;
        margin: 0 !important;
    }

    .tr-cover-img,
    .tr-prose img {
        max-width: 100% !important;
        height: auto !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .tr-prose img,
    .tr-toc {
        break-inside: avoid;
    }

    .tr-prose h1,
    .tr-prose h2,
    .tr-prose h3 {
        break-after: avoid;
    }
}
