/* ILMS — base stylesheet (white-label).
   Every brand colour comes from CSS variables. Defaults below are the "Royal purple & gold" theme;
   /theme.css (generated from Branding & appearance settings) overrides them, and adds dark-mode values.
   Colour pairs are checked against WCAG 2.2 AA (≥ 4.5:1 for text) by App\Services\Theme. */
:root, [data-bs-theme=light] {
  --brand: #4a1d7a; --brand-dark: #33115a; --brand-mid: #6c3fa3; --brand-light: #f3eefa; --brand-soft: #faf9fc;
  --brand-border: #e6e0ee; --brand-heading: #33115a; --brand-text: #4a1d7a; --brand-sub: #e5daf3;
  --gold: #c9a227; --gold-hover: #b8921c; --gold-soft: #f7efd3; --on-gold: #33115a;
  --surface: #ffffff; --page-bg: #faf9fc; --card-radius: .6rem; --brand-dark-rgb: 51, 17, 90;
  --header-bg: linear-gradient(90deg, var(--brand-dark), var(--brand));
  --bs-primary: #4a1d7a; --bs-primary-rgb: 74, 29, 122;
  --bs-link-color: #4a1d7a; --bs-link-color-rgb: 74, 29, 122; --bs-link-hover-color: #33115a; --bs-link-hover-color-rgb: 51, 17, 90;
  --bs-font-sans-serif: "Segoe UI", "Source Sans 3", "Noto Sans", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --muted-strong: #4f4860;
}
[data-bs-theme=light] { --bs-body-color: #1e1b24; }
[data-bs-theme=dark] { --muted-strong: #c8c3d0; --brand-sub: #e5e1ea; }
body { background: var(--page-bg); font-family: var(--bs-font-sans-serif); }
h1, h2, h3, .h1, .h2, .h3 { color: var(--brand-heading); font-weight: 650; letter-spacing: -.01em; }
h1, .h1 { font-size: 1.6rem; }
a { text-underline-offset: .15em; }
:focus-visible { outline: 3px solid var(--gold) !important; outline-offset: 2px; }
.skip-link { position: absolute; left: .5rem; top: .5rem; z-index: 2000; background: var(--surface); color: var(--brand-text); padding: .5rem 1rem; border-radius: .25rem; }

.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); --bs-btn-disabled-bg: var(--brand-mid); --bs-btn-disabled-border-color: var(--brand-mid); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; }
.btn-outline-primary { --bs-btn-color: var(--brand-text); --bs-btn-border-color: var(--brand-text); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-color: #fff; }
.btn-gold { background: var(--gold); color: var(--on-gold); border: 1px solid var(--gold); font-weight: 600; }
.btn-gold:hover, .btn-gold:focus { background: var(--gold-hover); border-color: var(--gold-hover); color: var(--on-gold); }
.text-brand { color: var(--brand-text) !important; }
.bg-brand-light { background: var(--brand-light) !important; }
.badge.bg-primary, .text-bg-primary { background-color: var(--brand) !important; color: #fff !important; }
.form-control:focus, .form-select:focus { border-color: var(--brand-mid); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 22%, transparent); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-label { font-weight: 600; font-size: .9rem; }
.required::after { content: " *"; color: #b02a37; }
[data-bs-theme=dark] .required::after { color: #f1aeb5; }
.page-link { color: var(--brand-text); }
.active > .page-link, .page-link.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.nav-tabs .nav-link.active, .nav-pills .nav-link.active { --bs-nav-pills-link-active-bg: var(--brand); }
.dropdown-item.active, .dropdown-item:active { background: var(--brand); }

/* Header */
.brand-bar { background: var(--header-bg); border-bottom: 3px solid var(--gold); }
.brand-bar .navbar-brand { color: #fff; font-weight: 600; }
.brand-sub { color: var(--brand-sub); font-size: .75rem; }
.brand-bar .nav-link { color: #fff; opacity: .95; }
.brand-bar .nav-link:hover, .brand-bar .nav-link:focus { color: #fff; opacity: 1; text-decoration: underline; }
.logo-tile { background: #fff; border-radius: .35rem; padding: 2px; }
.brand-logo { object-fit: contain; }
.appearance-menu .dropdown-item[aria-pressed=true] { font-weight: 700; }
.appearance-menu .dropdown-item[aria-pressed=true]::after { content: " ✓"; }

/* Staff sidebar */
.sidebar { background: var(--surface); border-right: 1px solid var(--brand-border); min-height: calc(100vh - 56px); }
@media (min-width: 768px) { .sidebar { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; } }
.sidebar .nav-link { color: var(--bs-body-color); border-left: 3px solid transparent; padding: .5rem 1rem; font-size: .93rem; }
.sidebar .nav-link .bi { width: 1.4rem; display: inline-block; color: var(--brand-mid); }
.sidebar .nav-link:hover { background: var(--brand-light); }
.sidebar .nav-link.active { background: var(--brand-light); color: var(--brand-heading); font-weight: 600; border-left-color: var(--gold); }

/* Cards & stats */
.card { border-color: var(--brand-border); border-radius: var(--card-radius); --bs-card-bg: var(--surface); }
.card-header { background: var(--surface); border-bottom-color: var(--brand-border); font-weight: 600; color: var(--brand-heading); }
.stat-card { border-left: 4px solid var(--brand); }
.stat-card.warn { border-left-color: #b45309; }
.stat-card.danger { border-left-color: #b02a37; }
.stat-card.gold { border-left-color: var(--gold); }
.stat-card .value { font-size: 1.65rem; font-weight: 700; color: var(--brand-heading); line-height: 1.1; }
.stat-card .label { font-size: .8rem; color: var(--muted-strong); text-transform: uppercase; letter-spacing: .04em; }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 360px; }

/* Tables */
.table { --bs-table-bg: transparent; }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted-strong); background: var(--brand-light); white-space: nowrap; }
.table-hover tbody tr:hover { --bs-table-hover-bg: var(--brand-light); }
.table td { vertical-align: middle; }

/* Public site */
.hero { background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%); color: #fff; padding: 3.5rem 0 3rem; position: relative; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--gold); }
.hero h1 { color: #fff; font-size: 2rem; }
.hero p, .hero .lead { color: #fff; }
.hero .form-control { min-height: 3rem; }
.site-footer { background: var(--brand-dark); color: #fff; }
.site-footer a { color: #fff; display: inline-block; min-height: 24px; line-height: 24px; }
.site-footer .social a { font-size: 1.2rem; margin-right: .6rem; }
.cover { width: 100%; max-width: 160px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: .35rem; background: var(--brand-light); border: 1px solid var(--brand-border); }
.cover-sm { width: 56px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: .25rem; background: var(--brand-light); border: 1px solid var(--brand-border); }
.cover-placeholder { display: flex; align-items: center; justify-content: center; color: var(--brand-mid); font-size: 1.8rem; }
.result-item { border-bottom: 1px solid var(--brand-border); padding: 1rem 0; }
.avail-yes { color: #146c43; font-weight: 600; }
.avail-no { color: #9a3412; font-weight: 600; }
[data-bs-theme=dark] .avail-yes { color: #75d6a3; }
[data-bs-theme=dark] .avail-no { color: #fdba8c; }
.facet h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-strong); }

/* Circulation desk */
.scan-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.15rem; letter-spacing: .05em; }
.member-panel { background: var(--surface); border: 1px solid var(--brand-border); border-left: 5px solid var(--brand); border-radius: .5rem; }
.member-photo { width: 84px; height: 105px; object-fit: cover; border-radius: .35rem; border: 1px solid var(--brand-border); background: var(--brand-light); }

/* Branding page */
.theme-option { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border: 2px solid var(--brand-border); border-radius: .5rem; cursor: pointer; font-size: .9rem; background: var(--surface); }
.btn-check:checked + .theme-option { border-color: var(--brand-text); box-shadow: 0 0 0 2px var(--gold); font-weight: 600; }
.btn-check:focus-visible + .theme-option { outline: 3px solid var(--gold); outline-offset: 2px; }
.swatch { width: 2.2rem; height: 2.2rem; border-radius: .4rem; flex: none; border: 1px solid rgba(0, 0, 0, .15); }
.brand-preview { padding: .6rem; border-radius: .5rem; }
.brand-preview img { object-fit: contain; }

/* Membership card (CR80: 85.6 × 54 mm) — always printed light */
.member-card { width: 85.6mm; height: 54mm; border-radius: 3mm; overflow: hidden; border: 1px solid #ccc; background: #fff; color: #1e1b24; display: flex; flex-direction: column; font-size: 7.5pt; page-break-inside: avoid; }
.member-card .mc-head { background: var(--brand); color: #fff; padding: 1.8mm 3mm; border-bottom: 1mm solid var(--gold); display: flex; align-items: center; gap: 2mm; }
.member-card .mc-head img { width: 7mm; height: 7mm; object-fit: contain; }
.member-card .mc-body { display: flex; gap: 2.5mm; padding: 2mm 3mm; flex: 1; }
.member-card .mc-photo { width: 17mm; height: 21mm; object-fit: cover; border: 1px solid #ccc; background: #f4f4f6; }
.member-card .mc-qr svg { width: 16mm; height: 16mm; }
.member-card .mc-bar { padding: 0 3mm 2mm; text-align: center; }
.member-card .mc-bar svg { height: 8mm; width: 100%; }
/* Spine / barcode labels: 3 per row on A4 */
.label-sheet { display: grid; grid-template-columns: repeat(3, 63.5mm); gap: 2mm 3mm; padding: 8mm; }
.spine-label { width: 63.5mm; height: 33.9mm; border: 1px dashed #bbb; padding: 1.5mm; text-align: center; font-size: 7pt; overflow: hidden; page-break-inside: avoid; }
.spine-label svg { max-width: 100%; height: 15mm; }
.receipt { max-width: 80mm; margin: 0 auto; font-family: ui-monospace, Menlo, monospace; font-size: 9pt; }
.print-page { background: #fff; color: #1e1b24; }
@media print {
  .sidebar, .brand-bar, .site-footer, .d-print-none, .btn, form.no-print { display: none !important; }
  main { width: 100% !important; margin: 0 !important; }
  body { background: #fff; color: #000; }
  .spine-label { border-color: transparent; }
  @page { margin: 8mm; }
}
.w-auto-xs { width: auto; }
.mw-30 { max-width: 30rem; }
.mw-40 { max-width: 40rem; }
.min-w-0 { min-width: 0; }
.prewrap { white-space: pre-wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.progress-bar { background-color: var(--brand); }
.pdf-frame { width: 100%; height: 78vh; border: 1px solid var(--brand-border); border-radius: .35rem; }
.audit-json { font-size: .75rem; max-width: 34rem; white-space: pre-wrap; word-break: break-word; }
.chat-q { background: var(--brand-light); border-radius: 1rem 1rem .25rem 1rem; padding: .6rem 1rem; display: inline-block; }
/* Accessibility adjustments from axe-core audit (WCAG 2.2 AA) */
[data-bs-theme=light] .btn-outline-secondary { --bs-btn-color: #50565c; --bs-btn-border-color: #6c757d; --bs-btn-hover-bg: #50565c; --bs-btn-hover-border-color: #50565c; }
[data-bs-theme=light] .btn-outline-danger { --bs-btn-color: #a51d2d; --bs-btn-border-color: #a51d2d; --bs-btn-hover-bg: #a51d2d; --bs-btn-hover-border-color: #a51d2d; }
[data-bs-theme=light] .btn-outline-success { --bs-btn-color: #11663b; --bs-btn-border-color: #11663b; }
[data-bs-theme=dark] .btn-outline-secondary { --bs-btn-color: #ced4da; --bs-btn-border-color: #adb5bd; }
[data-bs-theme=dark] .btn-outline-danger { --bs-btn-color: #f1aeb5; --bs-btn-border-color: #f1aeb5; }
[data-bs-theme=dark] .btn-outline-success { --bs-btn-color: #a3cfbb; --bs-btn-border-color: #a3cfbb; }
code { color: #a01d55; }
[data-bs-theme=dark] code { color: #f7a8c8; }
.page-link { min-width: 2rem; min-height: 2rem; text-align: center; }
.swatch-xs { width: 1rem; height: 1rem; border-radius: .2rem; }
main > .hero { margin-top: -1.5rem; } /* flush under the header (Bootstrap ships without negative margins) */
/* QR codes are drawn as scalable SVG: give the box a real size (otherwise it collapses inside flex rows). */
.qr-box { width: 13.5rem; max-width: 100%; flex: none; }
[data-qr] svg { display: block; width: 100%; height: auto; }
.member-card .mc-qr svg { width: 16mm; height: 16mm; }
/* Translation hover hints */
.i18n-h { text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
.btn .i18n-h, .nav-link .i18n-h, .dropdown-item .i18n-h, .navbar-brand .i18n-h, .badge .i18n-h, .tile .i18n-h, .hero-x .i18n-h, h1 .i18n-h, .h1 .i18n-h, .hero-stats .i18n-h { text-decoration: none; }
.i18n-tip { position: absolute; z-index: 2000; max-width: min(22rem, 90vw); padding: .45rem .7rem; border-radius: .5rem; background: #1e1b24; color: #fff; font-size: .875rem; line-height: 1.35; box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .45); pointer-events: auto; border-left: 3px solid var(--gold); }
.i18n-tip::before { content: attr(lang) " · "; text-transform: uppercase; font-weight: 700; font-size: .75em; opacity: .85; }
[data-bs-theme=dark] .i18n-tip { background: #f8f9fa; color: #1e1b24; }
.language-menu .dropdown-item[aria-pressed=true] { font-weight: 700; }
.language-menu .dropdown-item[aria-pressed=true]::after { content: " ✓"; }
.w-25 { width: 25%; } .progress .w-0 { width: 0; } .progress .w-25 { width: 25%; } .progress .w-50 { width: 50%; } .progress .w-75 { width: 75%; } .progress .w-100 { width: 100%; }

/* ---------------------------------------------------------------- Google-style search (1.7) */
.gsearch { position: relative; max-width: 46rem; width: 100%; }
.gsearch-box { display: flex; align-items: center; gap: .15rem; min-height: 3rem; padding: 0 .35rem 0 1.1rem; background: var(--surface); color: var(--bs-body-color);
  border: 1px solid var(--brand-border); border-radius: 999px; transition: box-shadow .15s ease, border-color .15s ease; }
.gsearch-box:hover { box-shadow: 0 1px 6px rgba(32, 33, 36, .22); border-color: transparent; }
.gsearch-box:focus-within { box-shadow: 0 1px 8px rgba(32, 33, 36, .28); border-color: var(--brand-mid); outline: 2px solid var(--brand); outline-offset: 2px; }
.gsearch.open .gsearch-box { border-radius: 1.5rem 1.5rem 0 0; border-bottom-color: transparent; box-shadow: 0 1px 6px rgba(32, 33, 36, .28); outline: 0; }
.gsearch-icon { color: var(--muted-strong, #6c757d); font-size: 1.05rem; }
.gsearch-input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: inherit; font-size: 1.02rem; padding: .65rem .6rem; }
.gsearch-input:focus { outline: none; }
.gsearch-input::-webkit-search-cancel-button { display: none; }
.gsearch-input::placeholder { color: var(--muted-strong, #6c757d); opacity: 1; }
.gsearch-clear, .gsearch-voice { border: 0; background: transparent; color: var(--muted-strong, #5f6368); width: 2.4rem; height: 2.4rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.gsearch-clear:hover, .gsearch-voice:hover { background: var(--brand-light); color: var(--brand-text); }
.gsearch-voice { color: var(--brand-text); }
.gsearch-voice.listening { color: #fff; background: #c5221f; animation: gs-pulse 1s infinite; }
@keyframes gs-pulse { 50% { box-shadow: 0 0 0 .5rem rgba(197, 34, 31, .18); } }
.gsearch-clear + .gsearch-voice, .gsearch-clear:not([hidden]) { border-right: 1px solid transparent; }
.gsearch-submit { border: 0; border-radius: 999px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.05rem; margin-left: .15rem; font-weight: 600; flex: 0 0 auto; }
.gsearch-submit:hover { background: var(--brand-dark); }
.gsearch-submit:focus-visible { outline: 3px solid var(--gold, #c9a227); outline-offset: 2px; }
.gsearch-extra { border: 0; border-left: 1px solid var(--brand-border); background: transparent; color: inherit; padding: .5rem 1.8rem .5rem .7rem; max-width: 11rem; appearance: auto; }
.gsearch-lg .gsearch-box { min-height: 3.6rem; padding-left: 1.35rem; }
.gsearch-lg .gsearch-input { font-size: 1.15rem; }
.gsearch-lg .gsearch-submit { padding: .75rem 1.5rem; font-size: 1.02rem; }
.gsearch-glass .gsearch-box { background: var(--glass-bg-strong, var(--surface)); box-shadow: var(--depth-3, 0 6px 20px rgba(0, 0, 0, .18)); border-color: transparent; }
.gsearch-list { position: absolute; z-index: 1060; left: 0; right: 0; top: 100%; margin: 0; padding: .35rem 0 .7rem; list-style: none; text-align: start;
  background: var(--surface); color: var(--bs-body-color); border: 1px solid var(--brand-mid); border-top: 1px solid var(--brand-border); border-radius: 0 0 1.5rem 1.5rem; box-shadow: 0 8px 14px rgba(32, 33, 36, .22); }
.gsearch-opt { display: flex; align-items: center; gap: .85rem; padding: .45rem 1.3rem; cursor: pointer; line-height: 1.3; }
.gsearch-opt.active, .gsearch-opt:hover { background: var(--brand-light); }
.gsearch-opt-icon { color: var(--muted-strong, #6c757d); width: 1rem; flex: 0 0 auto; }
.gsearch-opt-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch-opt-text b { font-weight: 700; }
.gsearch-opt-sub { font-size: .8rem; color: var(--muted-strong, #6c757d); white-space: nowrap; }
@media (max-width: 575.98px) {
  .gsearch-submit-text { display: none; }
  .gsearch-submit { padding: .6rem .8rem; }
  .gsearch-extra { max-width: 7rem; padding-right: 1.2rem; }
}

/* Google-like tabs under the search box */
.gtabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--brand-border); margin: .75rem 0 .5rem; scrollbar-width: none; }
.gtabs a { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .8rem; color: var(--muted-strong, #5f6368); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-size: .95rem; }
.gtabs a:hover { color: var(--brand-text); }
.gtabs a[aria-current="page"] { color: var(--brand-text); border-bottom-color: var(--brand); font-weight: 600; }
.gstats { font-size: .85rem; color: var(--muted-strong, #6c757d); margin: .25rem 0 1rem; }

/* Filter chips (Google Books / Images style) */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 1rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .9rem; border-radius: 999px; border: 1px solid var(--brand-border); background: var(--surface); color: var(--bs-body-color); text-decoration: none; font-size: .9rem; line-height: 1.35; }
.chip:hover { background: var(--brand-light); color: var(--brand-text); }
.chip[aria-current="page"], .chip.on { background: var(--brand-light); border-color: var(--brand-mid); color: var(--brand-text); font-weight: 600; }
.chip .n { color: var(--muted-strong, #6c757d); font-weight: 400; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-check input:focus-visible + .chip { outline: 2px solid var(--brand); outline-offset: 2px; }
.chip-check input:checked + .chip { background: var(--brand-light); border-color: var(--brand-mid); color: var(--brand-text); font-weight: 600; }
.chip-check input:checked + .chip::before { content: "\2713"; font-weight: 700; }

/* Web-search style result list */
.gresult { padding: .9rem 0; border-bottom: 1px solid var(--brand-border); display: flex; gap: 1rem; }
.gresult:last-child { border-bottom: 0; }
.gresult-crumb { font-size: .82rem; color: var(--muted-strong, #4d5156); margin-bottom: .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gresult h2, .gresult h3 { font-size: 1.15rem; font-weight: 500; margin: 0 0 .2rem; line-height: 1.3; }
.gresult h2 a, .gresult h3 a { color: var(--brand-text); text-decoration: none; }
.gresult h2 a:hover, .gresult h3 a:hover { text-decoration: underline; }
.gresult-snippet { font-size: .9rem; color: var(--bs-body-color); }
.gresult-meta { font-size: .85rem; color: var(--muted-strong, #6c757d); }
.gresult-cover { flex: 0 0 auto; width: 4.2rem; }
.gresult-cover img, .gresult-cover .cover-gen { width: 4.2rem; height: 6.1rem; object-fit: cover; border-radius: .25rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); display: block; }
.side-panel { border: 1px solid var(--brand-border); border-radius: .9rem; padding: 1rem 1.1rem; background: var(--surface); }
.side-panel h2 { font-size: 1.05rem; }

/* Cover grid (digital library, e-book discovery, copy cataloguing) */
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 1.1rem; }
.cover-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--brand-border); border-radius: .8rem; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.cover-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, .12); }
.cover-card.picked { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.cover-card .cc-img { aspect-ratio: 2 / 3; width: 100%; object-fit: cover; display: block; }
.cover-card img.cc-img { background: var(--brand-light); }
.cover-card .cc-img.cover-gen { height: auto; }
.cover-card .cc-body { padding: .6rem .7rem .75rem; display: flex; flex-direction: column; gap: .15rem; flex: 1 1 auto; min-width: 0; }
.cover-card .cc-title { font-weight: 600; font-size: .92rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cover-card .cc-title a { color: inherit; text-decoration: none; }
.cover-card .cc-title a::after { content: ""; position: absolute; inset: 0; }
.cover-card .cc-sub { font-size: .8rem; color: var(--muted-strong, #6c757d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-card .cc-badges { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: auto; padding-top: .35rem; }
.cover-card .cc-badges .badge { font-weight: 500; }
.cover-card .cc-pick { position: absolute; top: .45rem; left: .45rem; z-index: 2; background: var(--surface); border-radius: .35rem; padding: .15rem .3rem; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.cover-card .cc-pick .form-check-input { margin: 0; width: 1.25rem; height: 1.25rem; cursor: pointer; }
.cover-card .cc-have { position: absolute; top: .45rem; right: .45rem; z-index: 2; }
.bulk-bar { position: sticky; bottom: 0; z-index: 20; margin-top: 1rem; background: var(--surface); border: 1px solid var(--brand-border); border-radius: 1rem; box-shadow: 0 -4px 18px rgba(0, 0, 0, .1); padding: .75rem 1rem; }
.cover-thumb { width: 3.4rem; height: 5rem; flex: 0 0 auto; object-fit: cover; border-radius: .25rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
img.cover-thumb { background: var(--brand-light); }
.cover-detail { width: 100%; max-width: 15rem; aspect-ratio: 2 / 3; object-fit: cover; border-radius: .5rem; box-shadow: 0 10px 24px rgba(0, 0, 0, .2); }

/* Account self-activation steps */
.act-steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; font-size: .85rem; color: var(--muted-strong, #6c757d); }
.act-steps li { display: flex; align-items: center; gap: .35rem; flex: 1 1 0; }
.act-steps li .act-n { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--brand-border); font-weight: 700; }
.act-steps li.on { color: var(--brand-text); font-weight: 600; }
.act-steps li.on .act-n { border-color: var(--brand); background: var(--brand); color: #fff; }
.act-steps li.done .act-n { border-color: var(--brand-mid); color: var(--brand-text); }
.act-code { letter-spacing: .5em; font-size: 1.6rem; }

/* Generated placeholder covers (shared by staff and public pages) */
.cover-gen { display: flex !important; flex-direction: column; justify-content: space-between; padding: .7rem .6rem .6rem .9rem; color: #fff; text-align: start; font-family: Georgia, "Times New Roman", serif; }
.cover-gen .cg-title { font-weight: 700; font-size: .95rem; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.cover-gen .cg-author { font-size: .72rem; opacity: .95; border-top: 1px solid rgba(255, 255, 255, .5); padding-top: .3rem; font-family: var(--bs-font-sans-serif); }
.cover-sm.cover-gen { padding: .25rem; } .cover-sm.cover-gen .cg-title { font-size: .5rem; -webkit-line-clamp: 5; }
.cg-0 { background: linear-gradient(160deg, #2b4c7e, #12223d); } .cg-1 { background: linear-gradient(160deg, #7a2742, #3d1121); }
.cg-2 { background: linear-gradient(160deg, #1f6b52, #0d3328); } .cg-3 { background: linear-gradient(160deg, #6b4a1f, #33230d); }
.cg-4 { background: linear-gradient(160deg, #4a1d7a, #22093d); } .cg-5 { background: linear-gradient(160deg, #0f5e6b, #062a30); }
.cg-6 { background: linear-gradient(160deg, #8a3b12, #401a06); } .cg-7 { background: linear-gradient(160deg, #37474f, #151d21); }
.gsearch .gsearch-input:focus, .gsearch .gsearch-input:focus-visible { outline: none !important; box-shadow: none !important; border: 0 !important; }
@media (max-width: 575.98px) {
  .cover-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .cover-card .cc-body { padding: .5rem .55rem .6rem; }
  .bulk-bar { padding: .6rem .7rem; }
}

/* ---------------------------------------------------------------- A4 label sheets (1.7.1) */
.sheet { width: 210mm; height: 297mm; box-sizing: border-box; display: grid; overflow: hidden; background: #fff; margin: 0 auto 6mm; box-shadow: 0 2px 10px rgba(0,0,0,.15); page-break-after: always; break-after: page; }
.sheet:last-child { page-break-after: auto; break-after: auto; }
.sheet .lbl { box-sizing: border-box; overflow: hidden; border: 1px dashed #c9c9d1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #111; line-height: 1.15; padding: 1mm 1.5mm; }
.sheet .lbl.blank { border-style: dotted; border-color: #eee; }
.sheet .lbl svg { display: block; max-width: 100%; }
.sheet .lbl .l-lib { font-weight: 700; font-size: 6.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sheet .lbl .l-call { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: 9pt; }
.sheet .lbl .l-title { font-size: 6.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sheet .lbl .l-acc { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 7pt; }
.sheet .lbl.spine .l-call { font-size: 13pt; line-height: 1.05; white-space: pre-line; }
.sheet.sz-l .lbl svg { height: 13mm; } .sheet.sz-m .lbl svg { height: 10mm; } .sheet.sz-s .lbl svg { height: 8mm; } .sheet.sz-xs .lbl svg { height: 7.5mm; }
.sheet.sz-s .lbl .l-lib, .sheet.sz-s .lbl .l-title { font-size: 5.5pt; } .sheet.sz-s .lbl .l-call { font-size: 7.5pt; } .sheet.sz-s .lbl.spine .l-call { font-size: 10pt; }
.sheet.sz-xs .lbl { padding: .3mm 1mm; } .sheet.sz-xs .lbl .l-acc { font-size: 5.5pt; }
.sheet.sz-card .lbl { padding: 0; border: 0; } .sheet.sz-card .member-card { border: 1px dashed #bbb; }
.sheet .lbl.tag { align-items: stretch; text-align: start; padding: 1.5mm 2mm; gap: .4mm; font-size: 7pt; }
.sheet .lbl.tag .t-head { font-weight: 700; font-size: 6.5pt; color: #fff; background: var(--brand); margin: -1.5mm -2mm .5mm; padding: .8mm 2mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .lbl.tag .t-name { font-weight: 700; font-size: 8pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .lbl.tag svg { height: 9mm; margin: 0 auto; }
.sheet-tools { position: sticky; top: 0; z-index: 5; }
@media print {
  .sheet { margin: 0; box-shadow: none; }
  .sheet .lbl, .sheet .lbl.blank { border-color: transparent; }
  .sheet.sz-card .member-card { border: 1px dashed #ccc; }
  .print-page.sheets { padding: 0; }
}
@page labelsheet { size: A4 portrait; margin: 0; }
.sheet { page: labelsheet; }
.sheet.l-a4-21 { padding: 15.15mm 0 0 7.2mm; grid-template-columns: repeat(3, 63.5mm); grid-template-rows: repeat(7, 38.1mm); column-gap: 2.5mm; row-gap: 0mm; }
.sheet.l-a4-24 { padding: 12.9mm 0 0 6.5mm; grid-template-columns: repeat(3, 63.5mm); grid-template-rows: repeat(8, 33.9mm); column-gap: 2.5mm; row-gap: 0mm; }
.sheet.l-a4-30 { padding: 0mm 0 0 0mm; grid-template-columns: repeat(3, 70mm); grid-template-rows: repeat(10, 29.7mm); column-gap: 0mm; row-gap: 0mm; }
.sheet.l-a4-40 { padding: 21.5mm 0 0 9.7mm; grid-template-columns: repeat(4, 45.7mm); grid-template-rows: repeat(10, 25.4mm); column-gap: 2.6mm; row-gap: 0mm; }
.sheet.l-a4-65 { padding: 10.7mm 0 0 4.7mm; grid-template-columns: repeat(5, 38.1mm); grid-template-rows: repeat(13, 21.2mm); column-gap: 2.5mm; row-gap: 0mm; }
.sheet.l-a4-84 { padding: 6mm 0 0 6mm; grid-template-columns: repeat(4, 46mm); grid-template-rows: repeat(21, 11.1mm); column-gap: 5mm; row-gap: 2.8mm; }
.sheet.l-cards-10 { padding: 13.5mm 0 0 15mm; grid-template-columns: repeat(2, 85.6mm); grid-template-rows: repeat(5, 54mm); column-gap: 8mm; row-gap: 0mm; }
@media print { body.sheets { margin: 0; } } 

/* Live online search progress (1.7.2) */
.world-progress .world-bar { height: .9rem; background: rgba(0,0,0,.08); }
.world-progress .world-bar .progress-bar { background-color: var(--brand); transition: width .35s ease; }
.world-progress.alert-success .world-bar .progress-bar { background-color: #198754; }
.world-progress.done .progress-bar-animated { animation: none; }
