/* rt-book-detail.css — Book Detail + Author/Series modals */

/* ============================================================
   10. BOOK DETAIL — Page-like layout в модала
   ============================================================ */

.rt-clickable-title { cursor: pointer; transition: color 0.15s; }
.rt-clickable-title:hover { color: var(--rt-primary); }

/* ── Fullscreen modal за book detail ── */
#rt-book-detail-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--rt-bg);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    padding: 0;
    overflow-y: auto;
    align-items: stretch;
    justify-content: flex-start;
}

#rt-book-detail-modal > .rt-modal-content {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 28px 60px;
    max-height: none;
    overflow: visible;
}

#rt-book-detail-modal > .rt-modal-content > .rt-modal-close {
    position: fixed;
    top: 16px; right: 20px;
    width: 36px; height: 36px;
    background: var(--rt-surface2);
    border: 1px solid var(--rt-border);
    border-radius: 50%;
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--rt-shadow-sm);
    z-index: 10001;
    color: var(--rt-text-muted);
    cursor: pointer;
    transition: background 0.15s;
}
#rt-book-detail-modal > .rt-modal-content > .rt-modal-close:hover {
    background: var(--rt-surface2);
    color: var(--rt-text);
}

/* ── 3-колонен grid: [корица] | [мета] | [sidebar] ── */
.rt-bd-wrap {
    display: grid;
    grid-template-columns: 180px 1fr 260px;
    gap: 28px;
    align-items: flex-start;
}

/* Лява колона */
.rt-bd-cover-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rt-bd-cover {
    width: 180px;
    border-radius: var(--rt-r2);
    display: block;
    box-shadow: var(--rt-shadow-lg);
}

.rt-bd-cover.rt-bd-cover-zoom {
    cursor: zoom-in;
}

/* Cover lightbox — повърх book detail / preview stack */
.rt-cover-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.rt-cover-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
}

.rt-cover-lightbox-panel {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 560px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.rt-cover-lightbox-img {
    max-width: 100%;
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--rt-r2);
    box-shadow: var(--rt-shadow-lg);
    background: var(--rt-card-bg);
}

.rt-cover-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    background: var(--rt-card-bg);
    border: 1px solid var(--rt-border);
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--rt-text-muted);
    box-shadow: var(--rt-shadow-sm);
}

.rt-cover-lightbox-close:hover {
    color: var(--rt-text);
    background: var(--rt-surface2);
}

.rt-bd-cover-placeholder {
    width: 180px; height: 260px;
    background: color-mix(in oklab, var(--rt-primary) 25%, var(--rt-surface2));
    border-radius: var(--rt-r2);
    display: flex; align-items: center; justify-content: center;
    font-size: 56px;
    box-shadow: var(--rt-shadow-md);
}

.rt-bd-cover-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rt-bd-cover-actions:empty { display: none; }

/* Средна колона */
.rt-bd-info-col { flex: 1; min-width: 0; }

.rt-bd-title {
    font-family: var(--rt-font-display);
    font-size: 32px; font-weight: 700;
    color: var(--rt-text);
    margin: 0 0 6px;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.rt-bd-author { font-size: 16px; color: var(--rt-text-muted); margin-bottom: 4px; font-weight: 500; }
.rt-bd-year   { color: var(--rt-text-light); }
.rt-bd-series { font-size: 13px; color: var(--rt-text-light); margin-bottom: 14px; font-style: italic; }

.rt-bd-meta {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 6px 0; font-size: 13px; color: var(--rt-text-muted);
    margin-bottom: 14px; padding-bottom: 14px;
    border-bottom: 1px solid var(--rt-border);
}
.rt-bd-meta span {
    display: inline-flex; align-items: center; gap: 4px;
    padding-right: 12px; margin-right: 12px;
    border-right: 1px solid var(--rt-border);
}
.rt-bd-meta span:last-child { border-right: none; margin-right: 0; padding-right: 0; }

.rt-bd-avg {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 700; color: var(--rt-text);
    margin-bottom: 16px; padding: 7px 14px;
    background: var(--rt-warning-soft);
    border-radius: var(--rt-r2);
    border: 1px solid color-mix(in oklab, var(--rt-warning) 25%, transparent);
}
#rt-book-detail-modal button.rt-bd-avg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    margin: 0 0 16px;
    padding: 7px 14px;
    appearance: none;
    box-shadow: none;
    border: 1px solid color-mix(in oklab, var(--rt-warning) 25%, transparent);
    border-radius: var(--rt-r2);
    background: var(--rt-warning-soft);
    color: var(--rt-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: inherit;
    text-align: left;
    cursor: pointer;
}
#rt-book-detail-modal button.rt-bd-avg:hover {
    border-color: var(--rt-warning);
}
#rt-book-detail-modal button.rt-bd-avg:focus-visible {
    outline: 2px solid var(--rt-primary);
    outline-offset: 2px;
}
.rt-bd-avg-num {
    font-family: var(--rt-font-display);
    font-size: 16px; letter-spacing: -0.01em;
}
.rt-bd-avg-count { font-size: 12px; font-weight: 500; color: var(--rt-text-muted); }

.rt-bd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.rt-bd-tags .rt-genre-tag {
    background: var(--rt-accent-soft); color: var(--rt-accent);
    border-radius: var(--rt-r1); font-size: 12px; font-weight: 600;
    padding: 4px 10px; cursor: pointer; transition: opacity 0.15s; border: none;
}
.rt-bd-tags .rt-genre-tag:hover { opacity: 0.75; }
.rt-bd-tags .rt-mood-tag {
    background: var(--rt-warning-soft); color: var(--rt-warning);
    border-radius: var(--rt-r1); font-size: 12px; font-weight: 600;
    padding: 4px 10px; cursor: pointer; transition: opacity 0.15s; border: none;
}
.rt-bd-tags .rt-mood-tag:hover { opacity: 0.75; }

.rt-bd-description {
    font-family: var(--rt-font-display);
    font-size: 15px; line-height: 1.75; font-style: italic;
    color: var(--rt-text-muted); margin: 0 0 18px;
    padding: 14px 16px; background: var(--rt-surface2);
    border-radius: var(--rt-r2); border-left: 3px solid var(--rt-primary);
}
.rt-bd-description p {
    margin: 0 0 0.85em;
}
.rt-bd-description p:last-child {
    margin-bottom: 0;
}

.rt-bd-extra {
    display: flex; flex-wrap: wrap; gap: 6px 20px;
    font-size: 12px; color: var(--rt-text-muted); margin-bottom: 14px;
}
.rt-bd-extra span { display: inline-flex; align-items: center; gap: 4px; }

.rt-bd-notes {
    font-size: 13px; color: var(--rt-text-muted); margin-bottom: 14px;
    padding: 10px 12px; background: var(--rt-surface2);
    border-radius: var(--rt-r1); border-left: 2px solid var(--rt-border-strong);
}
.rt-bd-notes p { margin: 4px 0 0; }

.rt-bd-warnings {
    font-size: 13px; color: var(--rt-warning);
    background: var(--rt-warning-soft);
    border: 1px solid color-mix(in oklab, var(--rt-warning) 30%, transparent);
    border-radius: var(--rt-r1); padding: 8px 12px; margin-bottom: 14px;
}

.rt-bd-actions {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 18px; padding-top: 18px;
    border-top: 1px solid var(--rt-border);
}
.rt-bd-count { font-size: 11px; font-weight: 400; opacity: 0.7; margin-left: 2px; }

/* ── Sidebar ── */
.rt-bd-sidebar { display: flex; flex-direction: column; gap: 14px; }

.rt-bd-sidebar-card {
    background: var(--rt-surface2); border: 1px solid var(--rt-border);
    border-radius: var(--rt-r3); padding: 16px; box-shadow: var(--rt-shadow-sm);
}

.rt-bd-sidebar-label {
    font-size: 10px; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--rt-text-light);
    margin-bottom: 12px; display: block;
}

.rt-bd-community-score { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.rt-bd-score-num {
    font-family: var(--rt-font-display); font-size: 42px; font-weight: 700;
    color: var(--rt-text); letter-spacing: -0.03em; line-height: 1;
}
.rt-bd-score-meta { font-size: 12px; color: var(--rt-text-muted); line-height: 1.5; }
.rt-bd-score-stars-wrap { margin-bottom: 3px; }

.rt-bd-rating-bars { display: flex; flex-direction: column; gap: 5px; }
.rt-bd-rating-bar-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--rt-text-muted); }
.rt-bd-rating-bar-num { width: 8px; text-align: right; color: var(--rt-text-muted); }
.rt-bd-rating-bar-star { color: var(--rt-star); font-size: 11px; }
.rt-bd-rating-bar-track { flex: 1; height: 5px; background: var(--rt-surface2); border-radius: 999px; overflow: hidden; }
.rt-bd-rating-bar-fill { height: 100%; background: var(--rt-star); border-radius: 999px; }
.rt-bd-rating-bar-count { min-width: 14px; text-align: right; font-size: 10px; color: var(--rt-text-light); font-weight: 600; }

.rt-bd-author-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.rt-bd-author-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.rt-bd-series-row  { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.rt-bd-series-name { font-weight: 700; font-size: 14px; line-height: 1.3; cursor: pointer; }
.rt-bd-series-name:hover { color: var(--rt-primary); }
.rt-bd-reader-count { font-size: 12px; color: var(--rt-text-muted); }
.rt-bd-readers-text { font-size: 12px; color: var(--rt-text-muted); }
.rt-bd-avatar-border { border: 2px solid var(--rt-card-bg); border-radius: 999px; }
.rt-bd-readers-stack { display: flex; margin-bottom: 10px; }
.rt-bd-readers-stack > * { margin-left: -8px; }
.rt-bd-readers-stack > *:first-child { margin-left: 0; }
.rt-bd-readers-overflow {
    width: 32px; height: 32px; border-radius: 999px;
    background: var(--rt-surface2);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: var(--rt-text-muted);
}

/* Amazon buy button */
.rt-amazon-buy-btn {
    display: block; text-align: center;
    padding: 8px 14px; background: #E47911; color: #111;
    border-radius: var(--rt-r1); text-decoration: none;
    font-size: 13px; font-weight: 600; transition: opacity 0.15s;
    margin-top: 4px;
}
.rt-amazon-buy-btn:hover { opacity: 0.88; }

/* JS-generated atoms — full definitions in JS-GENERATED ELEMENTS section */
.rt-as-in-list { color: var(--rt-success); font-size: 12px; font-weight: 600; }
.rt-as-star    { color: var(--rt-star); }
.rt-as-count   { color: var(--rt-text-light); font-size: 11px; }
.rt-no-results { color: var(--rt-text-light); text-align: center; padding: 30px; }


/* ============================================================
   11. AUTHOR / SERIES / GENRE / MOOD MODALS
   ============================================================ */

.rt-clickable-author,
.rt-clickable-series { cursor: pointer; transition: color 0.15s; }
.rt-clickable-author:hover { color: var(--rt-primary); text-decoration: underline; }
.rt-clickable-series:hover { color: var(--rt-primary); text-decoration: underline; }

.rt-as-title-link { cursor: pointer; transition: color 0.15s; }
.rt-as-title-link:hover { color: var(--rt-primary); text-decoration: underline; }

.rt-as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 10px; }
.rt-as-card { display: flex; gap: 12px; background: var(--rt-surface2); border: 1px solid var(--rt-border); border-radius: var(--rt-r2); padding: 12px; }
.rt-as-cover-wrap   { flex-shrink: 0; }
.rt-as-cover        { width: 60px; height: 88px; object-fit: cover; border-radius: var(--rt-r1); display: block; }
.rt-as-cover-placeholder { width: 60px; height: 88px; background: color-mix(in oklab, var(--rt-primary) 20%, var(--rt-surface2)); border-radius: var(--rt-r1); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.rt-as-info    { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rt-as-title   { font-weight: 700; font-size: 14px; color: var(--rt-text); line-height: 1.3; }
.rt-as-author  { font-size: 12px; color: var(--rt-text-muted); }
.rt-as-series  { font-size: 11px; color: var(--rt-text-light); }
.rt-as-meta    { font-size: 12px; color: var(--rt-text-muted); margin-top: 2px; }
.rt-as-readers { font-size: 12px; color: var(--rt-text-light); }
.rt-as-actions { margin-top: auto; padding-top: 6px; }


/* ============================================================
   12. DISCOVERY
   ============================================================ */

.rt-discovery-section { margin-bottom: 40px; }
.rt-discovery-title   { font-size: 22px; font-weight: 700; color: var(--rt-text); margin: 0 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--rt-border); font-family: var(--rt-font-display); }

.rt-discovery-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.rt-discovery-card { background: var(--rt-card-bg); border: 1px solid var(--rt-border); border-radius: var(--rt-r2); overflow: hidden; cursor: pointer; transition: box-shadow 0.15s; display: flex; flex-direction: column; }
.rt-discovery-card:hover { box-shadow: var(--rt-shadow-hover); }
.rt-discovery-cover-wrap { width: 100%; aspect-ratio: 2 / 3; overflow: hidden; background: color-mix(in oklab, var(--rt-primary) 20%, var(--rt-surface2)); display: flex; align-items: center; justify-content: center; }
.rt-discovery-cover { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.rt-discovery-cover-placeholder { font-size: 36px; }
.rt-discovery-info  { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rt-discovery-book-title  { font-size: 13px; font-weight: 700; color: var(--rt-text); font-family: var(--rt-font-display); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rt-discovery-book-author { font-size: 12px; color: var(--rt-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-discovery-badge { font-size: 12px; font-weight: 600; color: var(--rt-primary); margin-top: auto; padding-top: 6px; }
.rt-discovery-badge span { font-weight: 400; color: var(--rt-text-light); }

.rt-discovery-load-more-wrap { text-align: center; margin-top: 20px; }
.rt-discovery-load-more { padding: 10px 32px; font-size: 14px; font-weight: 600; background: var(--rt-primary); color: var(--rt-primary-fg); border: 1px solid var(--rt-primary); border-radius: var(--rt-r2); cursor: pointer; transition: opacity 0.15s; font-family: var(--rt-font-body); font-weight: 600; }
.rt-discovery-load-more:hover    { opacity: 0.9; }
.rt-discovery-load-more:disabled { opacity: 0.6; cursor: not-allowed; }

.rt-modal-discovery { max-width: 900px; max-height: 85vh; overflow-y: auto; }

/* ============================================================
   USER TAGS — лични тагове в book detail sidebar
   ============================================================ */

.rt-bd-user-tags-list {
    display:       flex;
    flex-wrap:     wrap;
    gap:           6px;
    margin-bottom: 10px;
    min-height:    24px;
}

.rt-bd-user-tags-empty {
    font-size:    12px;
    color:        var(--rt-text-light);
    font-style:   italic;
}

.rt-bd-user-tag {
    display:       inline-flex;
    align-items:   center;
    gap:           4px;
    background:    var(--rt-accent-soft);
    color:         var(--rt-accent);
    border-radius: var(--rt-r1);
    font-size:     12px;
    font-weight:   600;
    padding:       3px 4px 3px 10px;
    line-height:   1.4;
}

.rt-bd-user-tag-remove {
    background:    transparent;
    border:        none;
    color:         var(--rt-accent);
    cursor:        pointer;
    font-size:     16px;
    line-height:   1;
    padding:       0 5px;
    border-radius: 50%;
    opacity:       0.6;
    transition:    opacity 0.15s, background 0.15s;
}
.rt-bd-user-tag-remove:hover:not(:disabled) {
    opacity:    1;
    background: color-mix(in oklab, var(--rt-accent) 20%, transparent);
}
.rt-bd-user-tag-remove:disabled { cursor: not-allowed; opacity: 0.4; }

.rt-bd-user-tags-input-wrap {
    position: relative;
}

.rt-bd-user-tags-input {
    width:          100%;
    padding:        7px 10px;
    border:         1px solid var(--rt-border);
    border-radius:  var(--rt-r1);
    font-size:      12px;
    font-family:    var(--rt-font-body);
    background:     var(--rt-surface2);
    color:          var(--rt-text);
    box-sizing:     border-box;
    transition:     border-color 0.15s, box-shadow 0.15s;
}
.rt-bd-user-tags-input:focus {
    outline:      none;
    border-color: var(--rt-primary);
    box-shadow:   0 0 0 2px var(--rt-primary-soft);
    background:   var(--rt-card-bg);
}
.rt-bd-user-tags-input:disabled { cursor: wait; opacity: 0.7; }
.rt-bd-user-tags-input::placeholder { color: var(--rt-text-light); }

.rt-bd-user-tags-suggestions {
    position:      absolute;
    top:           calc(100% + 4px);
    left:          0; right: 0;
    background:    var(--rt-card-bg);
    border:        1px solid var(--rt-border);
    border-radius: var(--rt-r1);
    box-shadow:    var(--rt-shadow-md);
    max-height:    180px;
    overflow-y:    auto;
    z-index:       10;
    padding:       4px;
}

.rt-bd-user-tags-suggestion {
    display:       block;
    width:         100%;
    text-align:    left;
    padding:       6px 10px;
    background:    transparent;
    border:        none;
    border-radius: var(--rt-r1);
    font-size:     12px;
    color:         var(--rt-text);
    cursor:        pointer;
    transition:    background 0.1s;
    font-family:   var(--rt-font-body);
}
.rt-bd-user-tags-suggestion:hover {
    background: var(--rt-accent-soft);
    color:      var(--rt-accent);
}

/* Saving state — lock UI */
.rt-bd-tags-saving { opacity: 0.75; }

/* ============================================================
   RESPONSIVE — Tablet & Mobile
   ============================================================ */

/* Tablet — 2 колони (без sidebar) */
@media (max-width: 900px) {
    .rt-bd-wrap {
        grid-template-columns: 160px 1fr;
        gap: 20px;
    }
    .rt-bd-cover, .rt-bd-cover-placeholder { width: 160px; }
    .rt-bd-cover-placeholder { height: 230px; }

    /* Sidebar минава под главното съдържание */
    .rt-bd-sidebar {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }
    .rt-bd-sidebar-card { flex: 1 1 240px; min-width: 0; }

    .rt-bd-title { font-size: 26px; }
}

/* Mobile — 1 колона */
@media (max-width: 560px) {
    #rt-book-detail-modal > .rt-modal-content {
        padding: 56px 14px 40px;
    }

    .rt-bd-wrap {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Корица + actions под нея — без fixed/sticky и без хоризонтален layout */
    .rt-bd-cover-col {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .rt-bd-cover,
    .rt-bd-cover-placeholder {
        width: 130px;
    }

    .rt-bd-cover-placeholder {
        height: 190px;
        font-size: 40px;
    }

    .rt-bd-cover-actions {
        position: static;
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 180px;
        align-self: center;
        padding: 0;
        background: transparent;
        border-top: 0;
        box-shadow: none;
    }

    .rt-bd-cover-actions .rt-btn {
        width: 100%;
        min-height: 42px;
        font-size: 13px;
        font-weight: 600;
    }

    .rt-bd-cover-actions .rt-amazon-buy-btn {
        width: 100%;
        min-height: 42px;
        font-size: 12px;
        padding: 7px 10px;
        margin-top: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .rt-bd-cover-actions:empty {
        display: none;
    }

    /* Title и meta */
    .rt-bd-title { font-size: 22px; line-height: 1.2; }
    .rt-bd-author { font-size: 14px; }
    .rt-bd-series { font-size: 12px; }

    .rt-bd-meta {
        font-size: 12px;
        gap: 4px 0;
    }
    .rt-bd-meta span {
        padding-right: 8px;
        margin-right: 8px;
    }

    #rt-book-detail-modal button.rt-bd-avg,
    .rt-bd-avg {
        font-size: 13px;
        padding: 6px 10px;
    }
    .rt-bd-avg-num { font-size: 14px; }

    /* Sidebar — 1 колона на мобилно */
    .rt-bd-sidebar {
        flex-direction: column;
        padding-bottom: 0;
    }
    .rt-bd-sidebar-card { flex: 0 1 auto; }

    /* Description — без italic за по-добра четимост */
    .rt-bd-description {
        font-size: 14px;
        line-height: 1.6;
        padding: 12px;
    }

    /* Author/series modal — пълно покритие */
    .rt-as-grid {
        grid-template-columns: 1fr;
    }

    /* Discovery — 2 колони */
    .rt-discovery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .rt-discovery-title { font-size: 18px; }

    /* Close бутон по-малък */
    #rt-book-detail-modal > .rt-modal-content > .rt-modal-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}
/* ── Издания (Ozone / Amazon бутони) ── */
.rt-bd-editions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.rt-bd-edition-btn {
    font-size: 13px;
    padding: 7px 14px;
    border-radius: var(--rt-r2);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, border-color 0.15s;
}
.rt-bd-edition-btn:hover {
    background: var(--rt-surface2);
    border-color: var(--rt-border-strong);
}
/* Dropdown за статус в book detail */
.rt-bd-status-dropdown {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: var(--rt-r1);
    border: 1px solid var(--rt-border);
    background: var(--rt-surface2) !important;
    color: var(--rt-text) !important;
    min-height: 38px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s;
    appearance: auto;
    -webkit-appearance: auto;
}
.rt-bd-status-dropdown:hover { border-color: var(--rt-border-strong); }
.rt-bd-status-dropdown:focus {
    outline: none;
    border-color: var(--rt-primary);
    box-shadow: 0 0 0 3px rgba(var(--rt-primary-rgb, 124, 58, 237), 0.15);
}

/* Rating popup трябва да е над book detail modal */
#rt-rating-popup { z-index: 10010; }

/* ── Издания в sidebar ── */
.rt-bd-editions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rt-bd-edition-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: var(--rt-r1);
    border: 1px solid var(--rt-border);
    background: var(--rt-surface2);
    color: var(--rt-text);
    font-size: 13px;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
    line-height: 1.3;
}
.rt-bd-edition-item:hover {
    border-color: var(--rt-border-strong);
    background: var(--rt-surface2);
}
.rt-bd-edition-primary {
    border-color: var(--rt-primary);
    font-weight: 600;
}
.rt-bd-edition-primary:hover {
    border-color: var(--rt-primary);
}

/* ── Mini preview (sidebar — author / series) ─────────────────── */
.rt-bd-preview-slot { margin-top: 12px; }

.rt-bd-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.rt-bd-mini-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.15s ease;
    min-width: 0;
}
.rt-bd-mini-item:hover { transform: translateY(-2px); }

.rt-bd-mini-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--rt-r1);
    border: 1px solid var(--rt-border);
    background: var(--rt-surface2);
    display: block;
}

.rt-bd-mini-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--rt-text-light);
}

.rt-bd-mini-title {
    font-size: 11px;
    line-height: 1.25;
    color: var(--rt-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    word-break: break-word;
}

/* "+" бутон (ако има >3 книги) */
.rt-bd-mini-more-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 300;
    color: var(--rt-primary);
    border-style: dashed;
}
.rt-bd-mini-more:hover .rt-bd-mini-more-icon {
    background: var(--rt-surface2);
    border-color: var(--rt-primary);
}

/* Reading date editor — sidebar */
.rt-bd-dates-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rt-bd-dates-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rt-bd-date-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--rt-text-muted);
    line-height: 1.3;
}

.rt-bd-date-input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-r1);
    font-size: 12px;
    font-family: var(--rt-font-body);
    background: var(--rt-surface2);
    color: var(--rt-text);
    min-height: 36px;
    line-height: 1.2;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    color-scheme: light dark;
}

.rt-bd-date-input:hover {
    border-color: var(--rt-border-strong);
}

.rt-bd-date-input:focus {
    outline: none;
    border-color: var(--rt-primary);
    box-shadow: 0 0 0 2px var(--rt-primary-soft);
    background: var(--rt-card-bg);
}

.rt-bd-date-input:disabled {
    opacity: 0.7;
    cursor: wait;
}

.rt-bd-date-input::-webkit-calendar-picker-indicator {
    opacity: 0.55;
    cursor: pointer;
}

.rt-bd-dates-save {
    width: 100%;
    margin-top: 2px;
}

.rt-bd-dates-status {
    font-size: 12px;
    color: var(--rt-success);
    margin: 0;
    line-height: 1.4;
}

.rt-bd-started-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rt-bd-started-value {
    font-size: 14px;
    color: var(--rt-text);
}

.rt-bd-started-edit {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--rt-text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 4px;
}

.rt-bd-started-edit:hover { color: var(--rt-primary); }

.rt-bd-started-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rt-bd-started-form[hidden] { display: none; }

.rt-bd-started-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rt-bd-started-cancel {
    border: 0;
    background: transparent;
    color: var(--rt-text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 2px;
}

/* Формат на изданието (физическо / електронно / аудио) */
.rt-bd-format-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rt-bd-format-current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-r1);
    background: var(--rt-surface2);
    color: var(--rt-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.rt-bd-format-edit {
    width: 100%;
}

/* Reading sessions history */
.rt-bd-reading-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.rt-bd-reading-history-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    line-height: 1.35;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--rt-surface2);
    border: 1px solid var(--rt-border);
}

.rt-bd-reading-history-item strong {
    font-size: 12px;
    color: var(--rt-text-muted);
    font-weight: 600;
}

.rt-bd-read-count-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--rt-primary);
    color: #fff;
    vertical-align: middle;
}
