:root {
    --primary-color: #1a3e72;
    --secondary-color: #2a5ea7;
    --accent-color: #e74c3c;
    --light-gray: #f5f7fa;
    --medium-gray: #e1e5eb;
    --dark-gray: #7f8c8d;
    --text-color: #2c3e50;
    --muted-color: #5f6f80;
    --surface-color: #ffffff;
    --border-color: #dce3eb;
    --shadow-sm: 0 1px 2px rgba(26, 62, 114, 0.06);
    --shadow-md: 0 8px 24px rgba(26, 62, 114, 0.09);
    --shadow-lg: 0 12px 32px rgba(26, 62, 114, 0.14);
    --focus-ring: 0 0 0 0.2rem rgba(42, 94, 167, 0.18);
    --line-height: 1.8;
    --rkts-blue: #0c4da2;
    --rkts-blue-light: #3373c4;
    --rkts-blue-dark: #083a7d;
}

body {
    font-family: 'Noto Sans', Arial, sans-serif;
    line-height: var(--line-height);
    color: var(--text-color);
    background-color: #f6f8fb;
    margin: 0;
    padding: 0;
    font-size: 1rem;
}

.container-fluid {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    width: 100%;
}

h1, h2, h3, h4 {
    font-family: 'Noto Sans', Arial, sans-serif;
    color: var(--primary-color);
    margin: 1.4em 0 0.75em;
    line-height: 1.3;
    font-weight: 700;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 2rem; }
h3 { 
    font-size: 1.6rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--medium-gray);
    padding-bottom: 8px;
    margin-top: 2em;
}

p, li {
    margin-bottom: 1em;
    font-size: 1.03rem;
    color: #444;
    line-height: 1.75;
}

.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.input-group.search-container .input-group-text,
.input-group.search-container .form-control,
.input-group.search-container .btn {
    box-shadow: none;
    border-radius: 0;
}

.input-group.search-container .input-group-text {
    border-radius: 4px 0 0 4px;
}

.input-group.search-container .btn {
    border-radius: 0 4px 4px 0;
}

.search-preview-header {
    padding: 12px 15px;
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--medium-gray);
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.search-result-title {
    font-weight: bold;
    margin-bottom: 3px;
}

.search-result-sigla {
    color: var(--rkts-blue);
    font-size: 0.9em;
    margin-right: 8px;
}

.search-result-category {
    display: inline-block;
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 3px;
    background-color: #eee;
    color: #555;
}

.search-result-highlight {
    background-color: #ffeb3b;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-snippet {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar {
    background-color: white !important;
    border-bottom: 1px solid var(--medium-gray);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 0.7rem 1rem;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1030;
}

[data-navbar] {
    min-height: 82px;
}

.navbar > .container-fluid {
    gap: 0.75rem;
    max-width: 1400px;
    padding: 0 1rem;
    margin: 0 auto;
    flex-wrap: nowrap;
    align-items: center;
}

.navbar-light .navbar-nav .nav-link {
    color: var(--text-color);
    font-weight: 600;
    padding: 0.5rem 0.6rem;
    transition: all 0.2s ease;
    letter-spacing: 0;
    white-space: nowrap;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary-color);
    background-color: var(--light-gray);
    border-radius: 4px;
}

.navbar-collapse {
    justify-content: flex-end;
    position: relative;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.navbar-nav {
    margin: 0;
    position: relative;
    flex-wrap: nowrap;
    white-space: nowrap;
}



.vertical-divider {
    height: 30px;
    width: 1px;
    background-color: var(--medium-gray);
    margin: 0 15px;
    opacity: 0.7;
    align-self: center;
}

.navbar-brand {
    font-weight: bold;
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0.5rem 0;
    text-decoration: none;
}

.navbar-brand img {
    height: 50px; 
    margin-right: 12px;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.1));
    z-index: 2;
    position: relative;
    flex-shrink: 0;
}

.navbar-brand div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.navbar-brand span {
    font-size: 1.05rem; 
    line-height: 1.2;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.navbar-brand small, .navbar-brand:visited small {
    font-size: 1.08rem;
    line-height: 1.25;
    opacity: 0.95;
    color: var(--secondary-color);
    font-family: 'Noto Sans Tibetan', 'Noto Sans', sans-serif;
    white-space: nowrap;
}

.navbar-brand small[lang="bo"],
.navbar-brand:visited small[lang="bo"] {
    font-size: calc(1.08rem + 2px);
}
.navbar-brand,
.navbar-brand:visited {
    color: inherit;
}
.navbar-light .navbar-toggler {
    border-color: var(--border-color);
    border-radius: 6px;
    padding: 0.35rem 0.55rem;
}

.navbar-light .navbar-toggler:focus,
.btn:focus-visible,
.form-control:focus,
.form-select:focus,
a:focus-visible {
    box-shadow: var(--focus-ring);
    outline: none;
}

.navbar-nav .nav-link {
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0.6rem;
    white-space: nowrap;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.btn-outline-primary.active,
.btn-outline-primary:active,
.btn-outline-primary:focus {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}


.btn-primary:active, .btn-primary:focus {
    background-color: var(--rkts-blue-dark);
    border-color: var(--rkts-blue-dark);
}

#map {
    width: 100%;
    min-height: 420px;
    height: clamp(420px, 62vh, 700px) !important;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--medium-gray);
    overflow: hidden;
}

.map-container {
    position: relative;
    margin-bottom: 2rem;
    width: 100%;
}

.map-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 300px;
}

.map-overlay h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
}

.map-legend {
    background-color: white;
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    box-shadow: none;
    margin-top: 20px;
}

.map-legend h6 {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 1rem;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-marker {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    margin-right: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.legend-marker-kanjur {
    background-color: #e41a1c;
}

.legend-marker-tanjur {
    background-color: #377eb8;
}

.legend-marker-tantra {
    background-color: #4daf4a;
}

.legend-marker-collection {
    background-color: #984ea3;
}

.legend-marker-other {
    background-color: #3388ff;
}

.legend-label {
    font-size: 0.9rem;
    color: var(--text-color);
}

.marker-cluster-large {
    background-color: rgba(255, 255, 255, 0.0);
    border-radius: 50%;
    text-align: center;
    font-weight: bold;
    color: #fff;
}

.marker-cluster-large .cluster-icon {
    background-color: rgba(26, 62, 114, 0.8);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
}

.marker-cluster-large:hover .cluster-icon {
    transform: scale(1.05);
    background-color: rgba(42, 94, 167, 0.85);
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.15);
    padding: 10px 10px 0 10px;
    overflow: hidden;
}

.leaflet-popup-content {
    max-width: 300px;
    margin: 0;
    padding: 0;
}

.popup-header {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    margin: 0;
}

.popup-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.popup-body {
    padding: 15px;
}

.popup-body p {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.popup-body .label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
    margin-right: 5px;
}

.popup-footer {
    background-color: var(--light-gray);
    padding: 10px 15px;
    border-top: 1px solid var(--medium-gray);
    text-align: right;
}

.popup-footer a {
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary-color);
    text-decoration: none;
}

.popup-footer a:hover {
    text-decoration: underline;
}

.view-details-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.view-details-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.collection-card {
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.collection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 50rem;
    transition: all 0.2s ease-in-out;
}

.nav-tabs {
    border-bottom: 2px solid var(--medium-gray);
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-color);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--medium-gray);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom: 2px solid var(--primary-color);
}

.note-box {
    background-color: #f8f9fa;
    border-left: 4px solid var(--secondary-color);
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 4px 4px 0;
    font-size: 0.95rem;
    color: #555;
}

.note-box p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.table thead th {
    background-color: var(--light-gray);
    color: var(--primary-color);
    font-weight: 600;
    padding: 12px 15px;
    border-bottom: 2px solid var(--medium-gray);
    text-align: left;
    font-size: 0.95rem;
}

.table tbody tr:nth-child(even) {
    background-color: rgba(0,0,0,0.02);
}

.table tbody tr:hover {
    background-color: rgba(42, 94, 167, 0.05);
}

.table td {
    padding: 12px 15px;
    border-top: 1px solid var(--light-gray);
    vertical-align: middle;
}

.container {
    max-width: 1180px;
    padding: 0 1rem;
    margin: 0 auto;
}

.form-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.form-control {
    font-size: 0.95rem;
}

footer {
    margin-top: 50px;
    padding: 30px 0;
    background-color: #f2f5f8 !important;
    border-top: 1px solid var(--medium-gray);
    text-align: center;
    color: var(--dark-gray);
    font-size: 1rem;
}

.collection-card .card-title {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: bold;
    line-height: 1.35;
}

.collection-card .card-text {
    color: var(--muted-color);
    font-size: 14px;
    line-height: 1.55;
}

.collection-card .badge {
    margin-right: 5px;
    margin-bottom: 5px;
}

#filter-form label {
    font-weight: 500;
}

.disabled-filter-option {
    opacity: 0.6;
    cursor: not-allowed;
}

.disabled-filter-option label {
    color: #adb5bd;
    cursor: not-allowed;
}

.disabled-filter-option .filter-checkbox-count {
    color: #adb5bd;
}

.disabled-filter-option input[type="checkbox"] {
    pointer-events: none;
}

.modal-title {
    font-weight: bold;
}

.modal-body h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
}

.modal-body table {
    margin-bottom: 20px;
}

.constituent-table {
    font-size: 14px;
}

.card-body p {
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    #map {
        height: 500px;
    }
    
    .col-md-3 {
        margin-bottom: 20px;
    }
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #007bff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.navbar-light .navbar-nav .nav-link {
    border-radius: 6px;
    font-size: 0.96rem;
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

@media (min-width: 992px) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

.page-heading {
    margin: 1.75rem 0 1.25rem;
}

.page-heading h1,
.page-heading h2 {
    color: var(--primary-color);
    margin: 0 0 0.35rem;
}

.page-heading h1 {
    font-size: 2.2rem;
}

.page-heading p,
.page-intro {
    color: var(--muted-color);
    font-size: 1.05rem;
    line-height: 1.65;
    margin-bottom: 0;
    max-width: 760px;
}

.page-heading .page-heading-aside {
    font-size: 0.92rem;
    line-height: 1.5;
    margin-top: 0.25rem;
}

.page-kicker {
    color: var(--primary-color);
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.card {
    background: var(--surface-color);
    border: 1px solid rgba(220, 227, 235, 0.9);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    box-shadow: var(--shadow-sm);
    transform: none;
}

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--medium-gray);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    height: auto;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
    margin: 0;
}

.card-header h2 {
    font-size: 1.35rem;
}

.card-header h3,
.card-header h4 {
    border-bottom: 0;
    font-size: 1.2rem;
    padding-bottom: 0;
}

.card-body {
    padding: 1.5rem;
}

.reading-card .card-body {
    padding: 1.35rem 1.5rem 1.5rem;
}

.reading-card .card-header {
    min-height: auto;
    padding: 1rem 1.5rem;
}

.about-blocks {
    display: grid;
    gap: 1rem;
}

.about-block .card-header {
    background: #f8fafc;
    min-height: auto;
    padding: 0.95rem 1.5rem;
}

.about-block .card-header h3 {
    border-bottom: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin: 0;
    padding-bottom: 0;
}

.about-block .card-body {
    padding: 1.25rem 1.5rem;
}

.about-block p:last-child,
.about-block ul:last-child {
    margin-bottom: 0;
}

.btn,
.form-control,
.form-select,
.input-group-text {
    border-radius: 6px;
}

.form-control,
.form-select {
    border-color: var(--border-color);
    min-height: 42px;
}

.input-group .form-control,
.input-group .input-group-text,
.input-group .btn {
    border-color: var(--border-color);
}

.btn {
    font-weight: 600;
}

.btn:hover {
    text-decoration: none;
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: #4e5f70;
}

.btn-outline-secondary:hover {
    background-color: #eef3f8;
    border-color: #cbd6e2;
    color: var(--text-color);
}

.quick-link-grid,
.resource-grid,
.tool-grid {
    display: grid;
    gap: 1rem;
}

.quick-link-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin-top: 1.25rem;
}

.page-home .page-heading {
    margin: 2.4rem 0 1.65rem;
}

.page-home .quick-link-grid {
    gap: 1.25rem;
    margin-bottom: 2rem !important;
}

.page-home .quick-link {
    padding: 1.25rem 1.35rem;
}

.page-home .quick-link strong {
    margin-bottom: 0.4rem;
}

.page-home .card-header {
    padding: 1rem 1.5rem;
}

.page-home .card-body {
    padding: 1.65rem 1.75rem;
}

.page-home .translation-divider {
    margin-top: 1.35rem;
    padding-top: 1.35rem;
}

.resource-grid,
.tool-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quick-link,
.resource-card,
.tool-link {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    display: block;
    height: 100%;
    padding: 1rem;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.quick-link:hover,
.resource-card:hover,
.tool-link:hover,
.collection-card:hover {
    border-color: rgba(42, 94, 167, 0.35);
    box-shadow: var(--shadow-md);
    color: var(--text-color);
    text-decoration: none;
    transform: translateY(-2px);
}

.quick-link strong,
.resource-card strong,
.tool-link strong {
    color: var(--primary-color);
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.quick-link span,
.resource-card span,
.tool-link span {
    color: var(--muted-color);
    display: block;
    font-size: 0.92rem;
    line-height: 1.55;
}

.content-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.4rem;
    margin-top: 1.4rem;
}

.content-section:first-child {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.content-section h4 {
    margin-top: 0;
}

.reading-sections {
    display: grid;
    gap: 0;
    max-width: 100%;
}

.reading-stack {
    max-width: 100%;
}

.reading-flow {
    max-width: 100%;
}

.reading-sections .content-section {
    border-top-color: #e9eef4;
    margin-top: 0;
    padding-top: 1.15rem;
}

.reading-sections .content-section:first-child {
    padding-top: 0;
}

.reading-sections h3 {
    border-bottom: 0;
    color: var(--primary-color);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 0.35rem;
    padding-bottom: 0;
}

.reading-flow .content-section {
    padding-bottom: 1.15rem;
    padding-top: 1.15rem;
}

.reading-flow .content-section:first-child {
    border-top: 0;
    padding-top: 0.15rem;
}

.reading-flow h3 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.reading-sections p,
.reading-sections li {
    color: #3f4a56;
    font-size: 0.98rem;
    line-height: 1.68;
    margin-bottom: 0.7rem;
}

.reading-sections p:last-child,
.reading-sections ul:last-child {
    margin-bottom: 0;
}

.section-list {
    display: grid;
    gap: 0.35rem;
    margin: 0.65rem 0 1rem;
    padding-left: 1.25rem;
}

.section-list li {
    margin-bottom: 0;
}

.tutorial-embed {
    aspect-ratio: 16 / 9;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 0.75rem 0 0.9rem;
    max-width: 720px;
    overflow: hidden;
}

.tutorial-embed iframe {
    border: 0;
    display: block;
    height: 100%;
    width: 100%;
}

.translation-divider {
    border-top: 1px solid var(--border-color);
    margin-top: 1.15rem;
    padding-top: 1.15rem;
}

.tibetan-translation {
    font-size: calc(1.03rem + 2px);
    font-family: 'Noto Sans Tibetan', 'Noto Sans', sans-serif;
    line-height: 1.9;
}

.filter-checkboxes {
    background: #fff;
    border-color: var(--border-color) !important;
    border-radius: 6px !important;
    max-height: none;
    overflow: visible;
    padding: 0.5rem;
}

.filter-checkbox-item {
    align-items: center;
    border-radius: 5px;
    display: flex;
    margin-bottom: 0.25rem;
    padding: 0.2rem 0.25rem;
}

.filter-checkbox-item:last-child {
    margin-bottom: 0;
}

.filter-checkbox-item label {
    cursor: pointer;
    margin-bottom: 0;
    margin-left: 0.5rem;
}

.filter-checkbox-item:hover {
    background: #f6f8fb;
}

.filter-checkbox-count {
    background: #eef3f8;
    border-radius: 999px;
    color: var(--muted-color);
    margin-left: auto;
    min-width: 2rem;
    padding: 0.05rem 0.45rem;
    text-align: center;
}

body.page-collections .card-header h5 {
    color: var(--primary-color);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

body.page-collections .page-heading h1 {
    color: var(--primary-color);
}

body.page-collections .form-label,
body.page-collections .card-body h6,
body.page-collections .map-legend h6 {
    color: var(--text-color);
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.35;
}

body.page-collections .form-label {
    margin-bottom: 0.45rem;
}

body.page-collections .form-check-label,
body.page-collections .filter-checkbox-item label,
body.page-collections .map-legend span,
body.page-collections .stats-line {
    font-size: 0.92rem;
    line-height: 1.45;
}

body.page-collections .filter-checkbox-count {
    font-size: 0.78rem;
    font-weight: 700;
}

body.page-collections .card-header .btn-sm {
    font-size: 0.88rem;
    font-weight: 600;
}

.search-preview-dropdown {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-md);
    display: none;
    left: 0;
    max-height: 340px;
    overflow: auto;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1000;
}

.search-preview-results > div {
    border-bottom: 1px solid #edf1f5;
    padding: 0.75rem 0.9rem;
}

.search-preview-results > div:last-child {
    border-bottom: 0;
}

.chart-container-sm {
    height: 200px;
    position: relative;
}

.stats-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.stats-line span:last-child {
    color: var(--primary-color);
    font-weight: 700;
}

.toolbar-row {
    align-items: end;
    gap: 0.75rem;
}

.bibliography-toolbar-card .card-body {
    padding-top: 1.25rem;
}

.bibliography-toolbar-card .form-label {
    color: var(--text-color);
    font-weight: 700;
}

.bibliography-toolbar-card .btn-group .btn {
    min-height: 42px;
}

.bibliography-toolbar-card .results-meta {
    align-self: center;
}

#filter-badge,
#load-more-btn {
    display: none;
}

.results-meta {
    color: var(--muted-color);
    font-size: 0.95rem;
}

.search-box-wrap .input-group input[type="text"] {
    border: 2px solid var(--medium-gray);
    border-radius: 6px 0 0 6px;
    border-right: 0;
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
}

.search-box-wrap .input-group input[type="text"]:focus {
    border-color: var(--secondary-color);
    box-shadow: none;
}

.btn-search {
    background-color: var(--primary-color);
    border: 0;
    border-radius: 0 6px 6px 0;
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    transition: background-color 0.2s;
}

.btn-search:hover {
    background-color: var(--secondary-color);
    color: #fff;
}

.search-type-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.2rem;
}

.search-type-bar .form-check {
    margin: 0;
}

.search-type-bar .form-check-input {
    display: none;
}

.search-type-bar .form-check-label {
    background: #fff;
    border: 2px solid var(--medium-gray);
    border-radius: 20px;
    color: var(--text-color);
    cursor: pointer;
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    transition: all 0.15s;
    user-select: none;
}

.search-type-bar .form-check-input:checked + .form-check-label {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.search-type-bar .form-check-label:hover {
    border-color: var(--secondary-color);
}

.search-type-bar .form-check-input:checked + .form-check-label:hover {
    color: #fff;
}

.sub-options {
    background: var(--light-gray);
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    display: none;
    margin-top: 1.2rem;
    padding: 1rem 1.2rem;
}

.canon-options-label {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.info-icon {
    align-items: center;
    background: var(--secondary-color);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.7rem;
    font-weight: 700;
    height: 18px;
    justify-content: center;
    margin-left: 4px;
    position: relative;
    vertical-align: middle;
    width: 18px;
}

.info-tip {
    background: #333;
    border-radius: 4px;
    bottom: 130%;
    color: #fff;
    display: none;
    font-size: 0.8rem;
    left: 50%;
    padding: 0.4rem 0.7rem;
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 999;
}

.info-icon:hover .info-tip {
    display: block;
}

.search-mode-guide {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1.2rem;
}

.search-mode-guide div {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.9rem;
}

.search-mode-guide strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
}

.search-mode-guide span {
    color: var(--muted-color);
    display: block;
    font-size: 0.92rem;
    line-height: 1.55;
}

.btn-search:focus-visible {
    box-shadow: var(--focus-ring);
    outline: none;
}

.publication-card .card-title,
#recent-publications .card-title {
    color: var(--primary-color);
    line-height: 1.35;
}

.list-group-item {
    border-color: var(--border-color);
}

footer .container {
    max-width: 860px;
}

@media (min-width: 992px) {
    .filters-column {
        align-self: flex-start;
    }
}

@media (max-width: 991.98px) {
    .navbar > .container-fluid {
        flex-wrap: wrap;
    }

    .navbar-collapse {
        flex-basis: 100%;
    }

    .navbar-nav {
        padding-top: 0.75rem;
        white-space: normal;
    }

    .navbar-brand span {
        font-size: 1rem;
        white-space: normal;
    }

    .navbar-brand small {
        font-size: 0.95rem;
        white-space: normal;
    }

    .navbar-brand small[lang="bo"] {
        font-size: calc(0.95rem + 2px);
    }

    .card-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 0.96rem;
    }

    p,
    li {
        font-size: 0.98rem;
    }

    .navbar {
        padding: 0.55rem 0.75rem;
    }

    .navbar-brand img {
        height: 38px;
    }

    .navbar-brand span {
        font-size: 0.88rem;
    }

    .navbar-brand small {
        font-size: 0.78rem;
    }

    .navbar-brand small[lang="bo"] {
        font-size: calc(0.78rem + 2px);
    }

    .card-body {
        padding: 1rem;
    }

    .page-heading {
        margin-top: 1.25rem;
    }

    .page-heading h1 {
        font-size: 1.85rem;
    }

    .input-group.search-container {
        max-width: none;
    }

    .search-box-wrap .input-group {
        display: grid;
        grid-template-columns: 1fr;
    }

    .search-box-wrap .input-group input[type=text],
    .search-box-wrap .input-group .btn-search {
        border-radius: 6px;
        width: 100%;
    }

    .search-box-wrap .input-group .btn-search {
        margin-top: 0.6rem;
    }

    .search-mode-guide {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-wrap: wrap;
    }
}

        /* ── highlight marks ──────────────────────────────────── */
        mark.rkts-hl {
            background-color: rgba(231,76,60,.15);
            color: var(--accent-color);
            border: 1px solid rgba(231,76,60,.35);
            border-radius: 3px;
            padding: 0 2px;
            font-weight: 600;
        }

        /* ── canon tab bar ────────────────────────────────────── */
        .canon-tab-bar { display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:1.5rem; }
        .canon-tab-bar .btn {
            border: 2px solid var(--primary-color);
            color: var(--primary-color);
            background: white;
            border-radius: 8px;
            font-weight: 600;
            padding: .4rem 1.1rem;
            line-height: 1.3;
            transition: all .15s;
        }
        .canon-tab-bar .btn .tib {
            font-family: 'Noto Sans Tibetan','Noto Sans',sans-serif;
            font-size: 1.25rem;
            display: block;
        }
        .canon-tab-bar .btn.active,
        .canon-tab-bar .btn:hover { background-color: var(--primary-color); color: white; }
        .canon-tab-bar .badge-cnt {
            display: inline-block;
            color: white;
            border-radius: 10px; padding:.05rem .4rem;
            font-size:.75rem; margin-left:.15rem;
            vertical-align: middle;
        }
        .canon-tab-bar .badge-cnt.badge-exact  { background: var(--primary-color); }
        .canon-tab-bar .badge-cnt.badge-approx { background: var(--accent-color); }
        .canon-tab-bar .btn.active .badge-cnt.badge-exact,
        .canon-tab-bar .btn:hover  .badge-cnt.badge-exact  { background: rgba(255,255,255,.35); }
        .canon-tab-bar .btn.active .badge-cnt.badge-approx,
        .canon-tab-bar .btn:hover  .badge-cnt.badge-approx { background: rgba(255,255,255,.6); color: var(--accent-color); }

        /* ── section headings ─────────────────────────────────── */
        .result-section-heading {
            font-size:.95rem; font-weight:700; color:white;
            background-color: var(--primary-color);
            padding:.4rem 1rem; border-radius:5px;
            margin: 1.1rem 0 .6rem;
            display:flex; align-items:center; gap:.5rem;
        }
        .result-section-heading.approx { background-color: var(--secondary-color); }
        .result-section-heading .cnt {
            background: rgba(255,255,255,.25);
            border-radius:4px; padding:.05rem .45rem; font-size:.78rem;
        }

        /* ── result items ─────────────────────────────────────── */
        .rkts-result {
            border-left: 3px solid #dee2e6;
            padding-left: 1rem;
            margin-bottom: 1.1rem;
        }
        .rkts-result-header { font-size:.95rem; margin-bottom:.15rem; }
        .rkts-result-header a.rkts-id {
            font-weight:700; color: var(--primary-color);
            text-decoration:none; margin-right:.4rem;
        }
        .rkts-result-header a.rkts-id:hover { text-decoration:underline; }
        .rkts-result-title { font-size:.9rem; line-height:1.7; color:#333; }
        .rkts-result-title a { text-decoration:none; color:inherit; }
        .rkts-result-title a:hover { text-decoration:underline; }
        .script-text.tib {
            font-family: 'Noto Sans Tibetan','Noto Sans',sans-serif;
            font-size:1.35rem; line-height:1.8;
        }

        .no-results { color: var(--dark-gray); padding:.6rem 0; font-style:italic; font-size:.9rem; }

        /* ── Tibetan toggle button ────────────────────────────── */
        .tib-toggle-btn {
            font-size:0.7rem; padding:1px 6px; line-height:1.4;
            opacity:0.65; transition:opacity 0.15s;
        }
        .tib-toggle-btn:hover { opacity:1; }
        .tib-toggle-btn .toggle-label { font-weight:600; letter-spacing:0.02em; }

        /* ── loading / error states ───────────────────────────── */
        #loading-indicator { display:none; }
        #loading-indicator.active { display:block; }

        .tib {
            font-size: 1.6rem;
            line-height: 2;
        }
        .ref-badge {
            font-family: monospace;
            font-size: 0.85rem;
            background: #f0f4f8;
            border: 1px solid #c8d6e5;
            border-radius: 4px;
            padding: 2px 7px;
            color: #2c4a6e;
            white-space: nowrap;
        }
        .item-card {
            border-left: 3px solid #c8d6e5;
            transition: border-color 0.15s;
        }
        .item-card:hover {
            border-left-color: #2c4a6e;
            cursor: pointer;
        }
        .modal-label {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #6c757d;
            font-weight: 600;
        }
        .location-block {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 6px;
            padding: 0.6rem 0.8rem;
            font-size: 0.9rem;
        }
        #loading-indicator {
            min-height: 200px;
        }
        .collection-id-badge {
            font-size: 1.1rem;
            letter-spacing: 0.05em;
        }
        mark.tib-diff {
            background: #fff3cd;
            color: inherit;
            border-radius: 2px;
            padding: 0 1px;
        }
        .tib-toggle-btn {
            font-size: 0.7rem;
            padding: 1px 6px;
            line-height: 1.4;
            vertical-align: middle;
            margin-left: 6px;
            opacity: 0.65;
            transition: opacity 0.15s;
        }
        .tib-toggle-btn:hover { opacity: 1; }
        .tib-toggle-btn .toggle-label { font-weight: 600; letter-spacing: 0.02em; }

        /* ── Section nav sidebar ── */
        .section-nav-inner {
            position: sticky;
            top: 70px;
            z-index: 80;
            padding-top: 0.25rem;
        }
        .section-nav-inner .nav-sidebar-label {
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #6c757d;
            font-weight: 700;
            padding: 0 0.5rem 0.4rem;
            border-bottom: 1px solid #dee2e6;
            margin-bottom: 0.5rem;
        }
        #section-nav-pills .nav-link {
            font-size: 0.73rem;
            padding: 0.28rem 0.6rem;
            color: #2c4a6e;
            border-radius: 6px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        #section-nav-pills .nav-link:hover { background: #e8eef5; }
        #section-nav-pills .nav-link.active { background: #2c4a6e; color: #fff; }
        #coll-filter {
            font-size: 0.8rem;
            border-radius: 6px;
            width: 100%;
        }
        /* ── Section scroll anchors ── */
        .coll-section          { scroll-margin-top: 70px; }
        #section-more          { scroll-margin-top: 70px; }
        #section-collections   { scroll-margin-top: 70px; }
        #standard-titles       { scroll-margin-top: 70px; }
        #title-variants-section{ scroll-margin-top: 70px; }

        /* ── Collection group headers ── */
        .coll-section-header {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.09em;
            color: #2c4a6e;
            font-weight: 700;
            border-bottom: 2px solid #c8d6e5;
            padding-bottom: 0.35rem;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .coll-info-btn {
            margin-left: auto;
            flex-shrink: 0;
            font-size: 1.0rem;
            color: #000;
            cursor: pointer;
            line-height: 1;
            user-select: none;
        }
        .coll-info-btn:hover { color: #333; }
        .coll-section-header .coll-count {
            font-size: 0.7rem;
            color: #6c757d;
            font-weight: 400;
            text-transform: none;
            letter-spacing: 0;
        }
        /* ── Reference edition badge ── */
        .ref-edition-badge {
            font-size: 0.65rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            background: #f59e0b;
            color: #fff;
            border-radius: 4px;
            padding: 2px 7px;
            vertical-align: middle;
            margin-left: 4px;
        }
        /* ── Derge highlight ── */
        .coll-section[data-sigla="d"] .coll-section-header {
            background: #fff8e1;
            border-bottom-color: #f59e0b;
            color: #92400e;
            border-radius: 4px 4px 0 0;
            padding: 0.45rem 0.6rem;
            margin-bottom: 1rem;
        }
        .coll-section[data-sigla="d"] .coll-section-header .coll-count { color: #b45309; }
        .coll-section[data-sigla="d"] {
            border-left: 4px solid #f59e0b;
            padding-left: 0.75rem;
        }
        .tib {
            font-size: 1.6rem;
            line-height: 2;
        }
        .ref-badge {
            font-family: monospace;
            font-size: 0.85rem;
            background: #f0f4f8;
            border: 1px solid #c8d6e5;
            border-radius: 4px;
            padding: 2px 7px;
            color: #2c4a6e;
            white-space: nowrap;
        }
        .item-card {
            border-left: 3px solid #c8d6e5;
            transition: border-color 0.15s;
        }
        .item-card:hover {
            border-left-color: #2c4a6e;
            cursor: pointer;
        }
        .modal-label {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #6c757d;
            font-weight: 600;
        }
        .location-block {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 6px;
            padding: 0.6rem 0.8rem;
            font-size: 0.9rem;
        }
        #loading-indicator {
            min-height: 200px;
        }
        .collection-id-badge {
            font-size: 1.1rem;
            letter-spacing: 0.05em;
        }
        mark.tib-diff {
            background: #fff3cd;
            color: inherit;
            border-radius: 2px;
            padding: 0 1px;
        }
        .tib-toggle-btn {
            font-size: 0.7rem;
            padding: 1px 6px;
            line-height: 1.4;
            vertical-align: middle;
            margin-left: 6px;
            opacity: 0.65;
            transition: opacity 0.15s;
        }
        .tib-toggle-btn:hover { opacity: 1; }
        .tib-toggle-btn .toggle-label { font-weight: 600; letter-spacing: 0.02em; }

        /* ── Section nav sidebar ── */
        .section-nav-inner {
            position: sticky;
            top: 70px;
            z-index: 80;
            padding-top: 0.25rem;
        }
        .section-nav-inner .nav-sidebar-label {
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #6c757d;
            font-weight: 700;
            padding: 0 0.5rem 0.4rem;
            border-bottom: 1px solid #dee2e6;
            margin-bottom: 0.5rem;
        }
        #section-nav-pills .nav-link {
            font-size: 0.73rem;
            padding: 0.28rem 0.6rem;
            color: #2c4a6e;
            border-radius: 6px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        #section-nav-pills .nav-link:hover { background: #e8eef5; }
        #section-nav-pills .nav-link.active { background: #2c4a6e; color: #fff; }
        #coll-filter {
            font-size: 0.8rem;
            border-radius: 6px;
            width: 100%;
        }
        /* ── Section scroll anchors ── */
        .coll-section          { scroll-margin-top: 70px; }
        #section-more          { scroll-margin-top: 70px; }
        #section-collections   { scroll-margin-top: 70px; }
        #standard-titles       { scroll-margin-top: 70px; }
        #title-variants-section{ scroll-margin-top: 70px; }

        /* ── Collection group headers ── */
        .coll-section-header {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.09em;
            color: #2c4a6e;
            font-weight: 700;
            border-bottom: 2px solid #c8d6e5;
            padding-bottom: 0.35rem;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .coll-info-btn {
            margin-left: auto;
            flex-shrink: 0;
            font-size: 1.0rem;
            color: #000;
            cursor: pointer;
            line-height: 1;
            user-select: none;
        }
        .coll-info-btn:hover { color: #333; }
        .coll-section-header .coll-count {
            font-size: 0.7rem;
            color: #6c757d;
            font-weight: 400;
            text-transform: none;
            letter-spacing: 0;
        }
        /* ── Reference edition badge ── */
        .ref-edition-badge {
            font-size: 0.65rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            background: #f59e0b;
            color: #fff;
            border-radius: 4px;
            padding: 2px 7px;
            vertical-align: middle;
            margin-left: 4px;
        }
        /* ── Derge highlight ── */
        .coll-section[data-sigla="d"] .coll-section-header {
            background: #fff8e1;
            border-bottom-color: #f59e0b;
            color: #92400e;
            border-radius: 4px 4px 0 0;
            padding: 0.45rem 0.6rem;
            margin-bottom: 1rem;
        }
        .coll-section[data-sigla="d"] .coll-section-header .coll-count { color: #b45309; }
        .coll-section[data-sigla="d"] {
            border-left: 4px solid #f59e0b;
            padding-left: 0.75rem;
        }
        /* ── Gpb (Paltsek Nyingyü) highlight ── */
        .coll-section[data-sigla="gpb"] .coll-section-header {
            background: #fff8e1;
            border-bottom-color: #f59e0b;
            color: #92400e;
            border-radius: 4px 4px 0 0;
            padding: 0.45rem 0.6rem;
            margin-bottom: 1rem;
        }
        .coll-section[data-sigla="gpb"] .coll-section-header .coll-count { color: #b45309; }
        .coll-section[data-sigla="gpb"] {
            border-left: 4px solid #f59e0b;
            padding-left: 0.75rem;
        }