/* === CSC DDC Sidebar Accordion === */
.csc-ddc-sidebar-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.csc-ddc-header {
    background: #ca9b1e;
    color: #1e293b;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    padding: 11px 14px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.csc-ddc-tree-wrap {
    padding: 4px 0;
}

.csc-ddc-accordion-list,
.csc-ddc-sublist {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.csc-ddc-sublist {
    display: none;
    background: #f8fafc;
    border-top: 1px dashed #e2e8f0;
}

.csc-ddc-item.is-open>.csc-ddc-sublist {
    display: block;
}

.csc-ddc-item {
    border-bottom: 1px solid #f1f5f9;
}

.csc-ddc-item:last-child {
    border-bottom: none;
}

.csc-ddc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 6px;
}

.csc-ddc-item.is-active>.csc-ddc-row {
    background: #f1f5f9;
}

.csc-ddc-link {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 9px 10px 9px 0px;
    font-size: 13px;
    color: #334155;
    text-decoration: none;
    line-height: 1.35;
}

.csc-ddc-item.level-1>.csc-ddc-row>.csc-ddc-link {
    padding-left: 24px;
    font-size: 12.5px;
}

.csc-ddc-item.level-2>.csc-ddc-row>.csc-ddc-link {
    padding-left: 36px;
    font-size: 12px;
}

.csc-ddc-link:hover,
.csc-ddc-link.active {
    color: #b48511;
    font-weight: 600;
}

.csc-ddc-icon {
    color: #ca9b1e;
    display: inline-flex;
    flex-shrink: 0;
}

.csc-ddc-name {
    flex: 1;
}

.csc-ddc-count {
    font-size: 11px;
    color: #64748b;
    background: #e2e8f0;
    border-radius: 999px;
    padding: 1px 7px;
    font-weight: 600;
}

.csc-ddc-toggle {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 6px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.csc-ddc-item.is-open>.csc-ddc-row>.csc-ddc-toggle {
    transform: rotate(180deg);
    color: #0f172a;
}

/* === Book Card DDC Badge === */
.csc-card-ddc-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    color: #854d0e;
    background: #fef9c3;
    border: 1px solid #fde047;
    border-radius: 4px;
    padding: 1px 6px;
    margin-bottom: 4px;
    letter-spacing: 0.2px;
}

/* === Archive DDC Breadcrumb === */
.csc-ddc-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.csc-ddc-breadcrumb a {
    color: #334155;
    text-decoration: none;
    font-weight: 500;
}

.csc-ddc-breadcrumb a:hover {
    color: #b48511;
}

/* === Single Book Bibliographic Record & Citation === */
.csc-bib-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 18px;
}

.csc-bib-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 18px;
}

.csc-bib-header-icon {
    color: #0f172a;
    display: inline-flex;
    align-items: center;
}

.csc-bib-title {
    font-size: 14.5px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.csc-bib-body {
    padding: 18px;
}

.csc-bib-top-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    background: #f8fafc;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.csc-bib-entry-title {
    font-size: 20px;
    line-height: 1.35;
    color: #0f172a;
    letter-spacing: -0.3px;
    margin: 0 !important;
    flex: 1 1 260px;
    min-width: 0;
}

.csc-bib-top-row .csc-bib-mediums {
    margin: 0;
    flex-shrink: 0;
}

.csc-bib-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 28px;
}

.csc-bib-row {
    display: grid;
    grid-template-columns: 20px 100px minmax(0, 1fr);
    gap: 8px;
    align-items: baseline;
    padding: 9px 12px;
    font-size: 13.5px;
    border-radius: 4px;
}

.csc-bib-row:nth-child(odd) {
    background: #f8fafc;
}

.csc-bib-row:nth-child(even) {
    background: #ffffff;
}

.csc-bib-row-icon {
    color: #64748b;
    display: inline-flex;
    align-items: center;
    transform: translateY(2px);
}

.csc-bib-row-label {
    color: inherit;
    font-weight: 400;
}

.csc-bib-row-val {
    color: inherit;
    font-weight: 400;
    word-break: break-word;
}

.csc-bib-link {
    color: inherit;
    text-decoration: none;
    font-weight: 400;
}

.csc-bib-link:hover {
    text-decoration: underline;
}

.csc-bib-tag-link {
    display: inline-block;
    color: inherit;
    font-weight: 400;
    text-decoration: none;
    margin-right: 6px;
}

.csc-bib-tag-link:hover {
    text-decoration: underline;
}

.csc-citation-box-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.csc-citation-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}

.csc-citation-quote-icon {
    font-size: 20px;
    line-height: 1;
    color: #64748b;
    font-family: Georgia, serif;
}

.csc-citation-quote-card {
    flex: 1 1 auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.csc-cite-copy-btn {
    flex-shrink: 0;
    background: var(--primary-color, #7f1d1d) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 5px !important;
    padding: 9px 18px !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.4 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
    transition: opacity 0.2s;
}

.csc-cite-copy-btn:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .csc-bib-columns {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .csc-citation-box-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .csc-citation-quote-card {
        flex: 1 1 100%;
    }
}

/* === Multi-Branch Badges & Holdings Table === */
.csc-card-branch-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #1e40af;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 1px 6px;
    margin-bottom: 4px;
    margin-left: 2px;
}

.csc-branch-holdings-wrap {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
}

.csc-branch-holdings-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.csc-branch-holdings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.csc-branch-holdings-table th,
.csc-branch-holdings-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: top;
}

.csc-branch-holdings-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    font-size: 11.5px;
}

.csc-branch-name-link {
    color: #1e293b;
    text-decoration: none;
}

.csc-branch-name-link:hover {
    color: #b48511;
}

.csc-branch-sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* === 3D Book Mockup & Library Bookshelf Layout === */
#csc-books-container.csc-grid-view .csc-book-shelf-item,
.csc-related-books-section .csc-book-shelf-item,
.csc-author-books-section .csc-book-shelf-item,
.csc-upcoming-slider-section .csc-book-shelf-item,
.csc-embedded-books-section .csc-book-shelf-item {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    transform: none !important;
}

#csc-books-container.csc-grid-view .csc-book-shelf-item:hover,
.csc-related-books-section .csc-book-shelf-item:hover,
.csc-author-books-section .csc-book-shelf-item:hover,
.csc-upcoming-slider-section .csc-book-shelf-item:hover,
.csc-embedded-books-section .csc-book-shelf-item:hover {
    transform: none !important;
    box-shadow: none !important;
}

.csc-book-3d-stage {
    position: relative;
    padding: 6px 8px 0 4px;
    perspective: 1000px;
}

.csc-book-3d-wrap {
    position: relative;
    width: 100%;
    margin: 0 auto;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), filter 0.28s ease;
    transform-origin: left center;
    z-index: 2;
}

/* Mép trang giấy 3D bên phải cuốn sách */
.csc-book-3d-wrap::after {
    content: "";
    position: absolute;
    top: 3px;
    right: -6px;
    bottom: 2px;
    width: 7px;
    background: repeating-linear-gradient(to right,
            #fdfbf7 0px,
            #fdfbf7 1px,
            #e5e0d8 1px,
            #e5e0d8 2px);
    border-top: 1px solid #d6d0c4;
    border-right: 1px solid #cbbfa8;
    border-bottom: 1px solid #c2b69e;
    border-radius: 0 3px 3px 0;
    transform: skewY(-6deg);
    transform-origin: top left;
    z-index: 1;
    pointer-events: none;
}

.csc-book-3d-item-hover,
.csc-book-shelf-item:hover .csc-book-3d-wrap {
    transform: translateY(-6px) rotateY(-7deg);
}

.csc-book-shelf-item .csc-book-3d-cover {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 2 / 3 !important;
    padding-top: 0 !important;
    height: auto !important;
    border-radius: 2px 6px 6px 2px !important;
    overflow: hidden !important;
    background: #1e293b;
    box-shadow:
        -2px 2px 5px rgba(15, 23, 42, 0.14),
        4px 8px 14px -4px rgba(15, 23, 42, 0.28) !important;
    z-index: 2;
}

/* Nếp gập gáy sách bên trái */
.csc-book-spine-crease {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 18px;
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.28) 0%,
            rgba(255, 255, 255, 0.22) 22%,
            rgba(0, 0, 0, 0.14) 45%,
            rgba(255, 255, 255, 0.08) 65%,
            transparent 100%);
    pointer-events: none;
    z-index: 2;
}

/* Bìa mặc định khi chưa có ảnh bìa */
.csc-book-fallback-cover {
    position: absolute;
    inset: 0;
    padding: 18px 14px 18px 22px;
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: #f8fafc;
}

.csc-fallback-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #fef3c7;
}

/* Đổ bóng tiếp xúc mềm dưới chân cuốn sách */
.csc-book-3d-stage::after {
    content: "";
    display: block;
    width: 88%;
    height: 10px;
    margin: 4px auto 0;
    background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.24) 0%, rgba(15, 23, 42, 0.08) 55%, transparent 75%);
    filter: blur(2px);
    transition: transform 0.28s ease, opacity 0.28s ease;
    pointer-events: none;
}

.csc-book-shelf-item:hover .csc-book-3d-stage::after {
    transform: scaleX(0.92);
    opacity: 0.65;
}

/* Nhãn thông tin thư mục bên dưới thanh kệ */
#csc-books-container.csc-grid-view .csc-book-shelf-meta {
    padding: 10px 6px 4px !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.csc-shelf-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.csc-shelf-author {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.csc-shelf-stats {
    margin-top: 2px;
}

/* Hỗ trợ List View (Phiếu Thư Mục OPAC) giữ dáng cuốn sách 3D nhỏ bên trái */
#csc-books-container.csc-list-view .csc-book-shelf-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    align-items: center !important;
}

#csc-books-container.csc-list-view .csc-book-3d-stage {
    width: 120px;
    min-width: 120px;
    padding: 12px 10px 12px 14px;
    flex-shrink: 0;
}

#csc-books-container.csc-list-view .csc-book-3d-wrap {
    width: 100%;
}

#csc-books-container.csc-list-view .csc-book-3d-cover {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    aspect-ratio: 2 / 3 !important;
    padding-top: 0 !important;
    height: auto !important;
    border-radius: 2px 5px 5px 2px !important;
}

#csc-books-container.csc-list-view .csc-book-3d-stage::after {
    display: none;
}

#csc-books-container.csc-list-view .csc-book-shelf-meta {
    padding: 12px 18px !important;
}

@media (max-width: 550px) {
    #csc-books-container.csc-list-view .csc-book-3d-stage {
        width: 92px;
        min-width: 92px;
        padding: 10px 8px 10px 10px;
    }

    #csc-books-container.csc-list-view .csc-book-shelf-meta {
        padding: 10px 12px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .csc-book-3d-wrap {
        transition: none;
    }

    .csc-book-shelf-item:hover .csc-book-3d-wrap {
        transform: none;
    }
}

/* Tương thích 3D Book cho Slider Sách mới & Sắp ra mắt */
.csc-upcoming-3d-stage {
    padding: 6px 10px 0;
}

.csc-upcoming-cover-frame.csc-book-3d-cover {
    position: relative !important;
    width: 100% !important;
    padding-top: 145% !important;
    height: 0 !important;
    border-radius: 2px 6px 6px 2px !important;
    overflow: hidden !important;
    background: #1e293b;
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.55), 0 4px 10px -2px rgba(0, 0, 0, 0.35) !important;
}

.csc-upcoming-3d-stage::after {
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.16) 55%, transparent 75%);
}

/* === Bibliographic Card 2-Column Layout & QR Code === */
.csc-bib-layout {
    display: grid;
    grid-template-columns: 1fr 132px;
    gap: 16px;
    align-items: start;
}

.csc-bib-qr-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.csc-qr-box {
    width: 108px;
    height: 108px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csc-qr-box svg {
    display: block;
    width: 100%;
    height: 100%;
}

.csc-qr-caption {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    word-break: break-word;
}

.csc-qr-download-btn {
    margin-top: 6px;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 5px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    font-weight: 600;
}

.csc-qr-download-btn:hover {
    border-color: #ca9b1e;
    color: #854d0e;
}

@media (max-width: 640px) {
    .csc-bib-layout {
        grid-template-columns: 1fr;
    }

    .csc-bib-qr-col {
        flex-direction: row;
        gap: 12px;
        text-align: left;
    }
}

/* === Medium Icon Chips inside Bibliographic Card === */
.csc-bib-mediums {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.csc-bib-medium-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 400;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ffffff;
    color: inherit;
}

.csc-bib-medium-chip.is-paper svg {
    color: #16a34a;
}

.csc-bib-medium-chip.is-ebook svg {
    color: #ef4444;
}

.csc-bib-medium-chip.is-audio svg {
    color: #f59e0b;
}

.csc-bib-layout.csc-bib-no-qr {
    grid-template-columns: 1fr;
}

/* === Minimalist 3-Line Book Meta (UI/UX Pro Max) === */
.csc-shelf-title {
    margin: 0 0 3px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    line-height: 1.38 !important;
}

.csc-shelf-title a {
    color: #0f172a !important;
    text-decoration: none;
}

.csc-shelf-title a:hover {
    color: #b48511 !important;
}

.csc-shelf-author {
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
    line-height: 1.35;
}

.csc-shelf-meta-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
    margin-top: 6px;
    font-size: 11.5px;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.3;
}

.csc-shelf-dl {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.csc-meta-dot {
    opacity: 0.7;
}

/* === Archive Header Filter Icon & Minimalist Panel === */
.csc-filter-icon-btn {
    position: relative;
}

.csc-filter-icon-btn.has-active-filter {
    border-color: #ca9b1e !important;
    color: #b48511 !important;
}

.csc-filter-active-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ca9b1e;
}

.csc-archive-filter-panel {
    display: block;
    margin-top: 16px;
    margin-bottom: 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 5px 6px 5px 18px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.csc-inline-filter-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}

.csc-filter-search-wrap {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.csc-filter-search-icon {
    color: #94a3b8;
    flex-shrink: 0;
}

.csc-filter-branch-wrap {
    flex: 0 0 auto;
    min-width: 150px;
    max-width: 240px;
    border-left: 1px solid #e2e8f0;
    padding-left: 12px;
}

.csc-inline-filter-field input,
.csc-inline-filter-field select {
    width: 100%;
    height: 38px;
    margin: 0 !important;
    font-size: 14px;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 6px !important;
    color: #1e293b;
}

.csc-inline-filter-field input:focus,
.csc-inline-filter-field select:focus {
    outline: none !important;
    box-shadow: none !important;
}

.csc-filter-branch-wrap select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 12px 12px !important;
    padding-right: 26px !important;
    cursor: pointer;
}

.csc-inline-filter-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.csc-filter-submit-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px !important;
    line-height: 38px !important;
    padding: 0 20px !important;
    border-radius: 999px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin: 0 !important;
}

.csc-filter-reset-link {
    font-size: 18px;
    line-height: 1;
    color: #94a3b8;
    text-decoration: none;
    padding: 0 6px;
    flex-shrink: 0;
}

.csc-filter-reset-link:hover {
    color: #ef4444;
}

@media (max-width: 640px) {
    .csc-archive-filter-panel {
        border-radius: 14px;
        padding: 10px 12px;
    }

    .csc-inline-filter-grid {
        flex-wrap: wrap;
    }

    .csc-filter-search-wrap {
        flex: 1 1 100%;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 6px;
    }

    .csc-filter-branch-wrap {
        flex: 1 1 auto;
        border-left: none;
        padding-left: 0;
        max-width: none;
    }
}

/* Giữ .csc-archive-header-box luôn trên 1 hàng, không xuống dòng trên Mobile */
.csc-archive-header-box {
    flex-wrap: nowrap !important;
}

.csc-archive-actions {
    flex-wrap: nowrap !important;
    flex-shrink: 0;
}

.csc-archive-counter-text {
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .csc-archive-header-box {
        padding: 8px 10px !important;
        gap: 6px !important;
    }

    .csc-archive-counter-text span {
        font-size: 12px !important;
    }

    .csc-archive-actions {
        gap: 6px !important;
    }

    #csc-sort-select {
        max-width: 110px;
        height: 34px !important;
        line-height: 34px !important;
        font-size: 12px !important;
        padding: 0 6px !important;
    }

    .csc-archive-actions .csc-toggle-btn {
        width: 34px !important;
        height: 34px !important;
        padding: 0 !important;
    }
}

/* === Subject Tags inside Bibliographic Card === */
.csc-bib-tags-row {
    margin-top: 10px;
}

.csc-bib-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.csc-bib-tag-pill {
    display: inline-block;
    font-size: 11.5px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    text-decoration: none;
}

.csc-bib-tag-pill:hover {
    border-color: #ca9b1e;
    color: #854d0e;
}

/* === 1-Row Icon Specs Track inside Bibliographic Card === */
.csc-bib-specs-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    overflow-x: auto;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
}

.csc-bib-specs-track .csc-spec-col {
    flex: 1 0 auto;
    min-width: 82px;
    text-align: center;
    padding: 4px 8px;
}

.csc-bib-specs-track .csc-spec-title {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
    white-space: nowrap;
}

.csc-bib-specs-track .csc-spec-icon-wrap {
    color: #475569;
    margin-bottom: 3px;
    display: flex;
    justify-content: center;
}

.csc-bib-specs-track .csc-spec-value {
    display: block;
    font-size: 12px;
    color: #0f172a;
    white-space: nowrap;
}

/* === Mobile Responsive Fixes for Bibliographic Card (<= 640px) === */
.csc-bib-card,
.csc-bib-layout,
.csc-bib-main,
.csc-bib-specs-track,
.csc-branch-holdings-wrap {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.csc-branch-holdings-wrap {
    overflow-x: auto;
}

.csc-qr-download-btn {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .csc-single-main-card {
        padding: 12px 10px !important;
    }

    .csc-bib-card {
        padding: 12px 10px !important;
    }

    .csc-bib-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 10px;
    }

    .csc-bib-qr-col {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        padding: 10px;
        text-align: left;
    }

    .csc-qr-box {
        width: 82px;
        height: 82px;
        flex-shrink: 0;
    }

    .csc-bib-qr-col .csc-qr-caption {
        margin-top: 0;
        flex: 1;
    }

    .csc-bib-qr-col .csc-qr-download-btn {
        margin-top: 0;
        flex-shrink: 0;
    }

    /* Dải icon thông số: wrap gọn trên mobile, không tràn khung */
    .csc-bib-specs-track {
        flex-wrap: wrap !important;
        overflow-x: visible !important;
        gap: 8px 4px;
    }

    .csc-bib-specs-track .csc-spec-col {
        flex: 1 1 30%;
        min-width: 80px;
        padding: 4px;
    }

    .csc-bib-specs-track .csc-spec-value {
        white-space: normal;
        word-break: break-word;
    }

    /* Bảng chi nhánh chuyển sang dạng thẻ gọn trên mobile, không bóp cột */
    .csc-branch-holdings-table,
    .csc-branch-holdings-table tbody,
    .csc-branch-holdings-table tr,
    .csc-branch-holdings-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .csc-branch-holdings-table thead {
        display: none;
    }

    .csc-branch-holdings-table tr {
        padding: 10px;
        border-bottom: 1px solid #e2e8f0;
    }

    .csc-branch-holdings-table tr:last-child {
        border-bottom: none;
    }

    .csc-branch-holdings-table td {
        padding: 2px 0;
        border: none;
    }

    .csc-branch-holdings-table td:nth-child(2)::before {
        content: "Vị trí kệ: ";
        color: #64748b;
        font-weight: 500;
    }

    .csc-branch-holdings-table td:nth-child(3)::before {
        content: "Tình trạng: ";
        color: #64748b;
        font-weight: 500;
    }

    .csc-branch-holdings-table td:nth-child(4):empty {
        display: none;
    }
}