/* Shared navigation and focused circulation flows. */
[hidden] { display: none !important; }
.brand-type { display: flex; align-items: center; }
.admin-sidebar > nav { margin-top: 32px; }
.mobile-brand { display: none; }
.breadcrumbs { display: flex; align-items: center; gap: 14px; min-width: 0; }
.breadcrumbs > .icon { width: 12px; height: 12px; flex-shrink: 0; color: #8c9db6; }
.member-shell .public-main { width: 100%; max-width: 1500px; min-width: 0; min-height: calc(100dvh - 170px); padding: 34px; }
.member-shell .public-footer { width: 100%; padding: 24px 34px; margin-top: auto; }
.member-shell .catalog-grid:not(.list-view) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.member-shell .catalog-card { min-width: 0; }
.catalog-card:hover { transform: translateY(-2px); border-color: #b8cbe5; box-shadow: 0 6px 20px #1f488c09; }
.catalog-card:hover .book-cover { transform: none; }
.pagination-controls .icon, .photo-viewer-controls .icon { display: block; width: 18px; height: 18px; flex-shrink: 0; }
.pagination-controls .icon-btn, .photo-viewer-controls .icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 8px; }

/* Fixed table layout divides available width equally across the actual columns. */
.table-scroll table { table-layout: fixed; width: 100%; }
.table-scroll th, .table-scroll td { width: auto; padding-left: 20px; padding-right: 20px; overflow-wrap: anywhere; white-space: normal; }
.table-scroll .table-book, .table-scroll .member-cell { min-width: 0; align-items: center; }
.table-scroll .table-book > div, .table-scroll .member-cell > div { min-width: 0; }
.table-scroll .table-book strong, .table-scroll .table-book span, .table-scroll .member-cell span { white-space: normal; overflow-wrap: anywhere; }
.table-scroll .book-cover, .table-scroll .avatar { flex-shrink: 0; }
.table-scroll .stock { white-space: normal; flex-wrap: wrap; gap: 5px; }
.table-scroll .stock strong { white-space: normal; }
.table-scroll .badge { white-space: normal; line-height: 1.45; }
.record-actions { flex-wrap: wrap; }
.record-actions > .btn { white-space: normal; }
.borrow-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9fd; }
.borrow-facts dt { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.borrow-facts dd { margin: 0; font-size: 14px; font-weight: 600; }
.borrow-note { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0; }

/* Photographs: visible previews, an explicit cover and optional supporting images. */
.modal-panel.drawer:has(#book-form) { width: 520px; }
.photo-editor { padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.photo-section-heading { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.photo-section-heading h3 { font-size: 15px; margin: 0; }
.photo-section-heading > span { color: var(--muted); font-size: 11px; }
.cover-editor { display: flex; gap: 22px; align-items: center; }
.cover-preview { width: 112px; height: 156px; flex-shrink: 0; border: 1px solid var(--line); background: #f3f6fc; border-radius: 9px; padding: 7px; display: flex; align-items: center; justify-content: center; }
.cover-preview > img, .cover-preview .book-cover { width: 100%; height: 100%; object-fit: contain; box-shadow: none; border-radius: 4px; }
.photo-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--brand-secondary); font-size: 11px; }
.photo-placeholder .icon { width: 32px; height: 32px; }
.photo-buttons { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.photo-buttons > strong { font-size: 12px; margin-bottom: 2px; }
.photo-buttons .btn { min-height: 38px; font-size: 12px; padding: 8px 12px; }
.photo-buttons .btn .icon { width: 16px; height: 16px; }
.photo-remove { color: var(--red); font-size: 11px; }
.gallery-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.gallery-editor-heading h4 { margin: 0; font-size: 12px; font-weight: 600; }
.gallery-editor-heading h4 span { color: var(--muted); font-size: 10px; font-weight: 400; margin-left: 5px; }
.gallery-editor-heading > div { display: flex; align-items: center; gap: 8px; }
.gallery-editor-heading .text-button { font-size: 12px; }
.gallery-editor-heading .icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; }
.photo-empty { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 6px 0 0; }
.photo-editor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.photo-editor-grid figure { margin: 0; padding: 7px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 0; }
.photo-editor-grid img { width: 100%; height: 94px; object-fit: contain; background: #f4f7fc; border-radius: 4px; }
.photo-editor-grid figcaption { color: var(--muted); font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.photo-editor-grid .text-button { font-size: 10px; padding: 4px 0; justify-content: flex-start; }
.photo-status { color: var(--primary); font-size: 12px; margin: 14px 0 0; }
.photo-editor .form-error { margin-top: 14px; }
.record-cover-button { border: 0; background: none; padding: 0; width: 100%; cursor: zoom-in; border-radius: 6px; }
.record-cover-button > .book-cover { display: block; }
.book-gallery { margin: 24px 0; max-width: 1150px; }
.book-gallery h2 { font-size: 16px; }
.book-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px; padding: 0 26px 26px; }
.gallery-thumb { height: 150px; border: 1px solid var(--line); border-radius: 9px; background: #f5f7fc; padding: 9px; cursor: zoom-in; }
.gallery-thumb:hover { border-color: var(--brand-secondary); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.photo-viewer { padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.photo-viewer > img, .photo-viewer > .book-cover { width: 100%; max-height: 60dvh; height: 510px; object-fit: contain; box-shadow: none; background: #f4f7fc; border-radius: 8px; }
.photo-viewer-controls { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: 12px; }
.photo-viewer-controls .icon-btn { border: 1px solid var(--line); border-radius: 8px; }

@media (min-width: 761px) and (max-width: 1200px) {
  .member-shell .public-main { padding: 28px; }
  .member-shell .catalog-layout { grid-template-columns: 155px minmax(0, 1fr); gap: 22px; }
  .member-shell .member-layout { grid-template-columns: 1fr; }
  .member-shell .member-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 760px) {
  .mobile-brand { display: block; }
  .mobile-brand .brand { gap: 9px; }
  .mobile-brand .community-logo { width: 38px; }
  .mobile-brand .brand strong { font-size: 18px; letter-spacing: -.4px; }
  .breadcrumbs { display: none; }
  .admin-topbar { height: 76px; padding: 0 16px; }
  .admin-topbar > .topbar-location { gap: 13px; }
  .admin-topbar .notification-button { display: inline-flex; }
  .member-shell .public-main { padding: 26px 20px; min-height: calc(100dvh - 176px); }
  .member-shell .public-footer { padding: 22px 20px; }
  .member-shell .catalog-grid:not(.list-view) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-shell .catalog-layout { display: block; }
  .table-scroll th, .table-scroll td { padding: 14px; }
  .table-scroll th:first-child, .table-scroll td:first-child { padding-left: 14px; }
  .table-scroll .table-book { min-width: 0; }
  .table-scroll table { min-width: 720px; }
  .record-section .table-scroll table { min-width: 580px; }
  .records-footer { flex-wrap: wrap; }
  .footer-controls { flex-wrap: wrap; }
  .modal-panel.drawer:has(#book-form) { width: 100%; }
  .photo-editor-grid { gap: 8px; }
  .photo-editor-grid figure { padding: 6px; }
  .cover-editor { gap: 18px; }
  .book-gallery-grid { padding: 0 18px 18px; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-thumb { height: 140px; }
  .photo-viewer { padding: 18px; }
  .borrow-facts { padding: 16px; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .catalog-card:hover, .catalog-card:hover .book-cover { transform: none !important; }
}

/* A single account entry point and quiet, consistent library branding. */
.admin-shell { min-height: 100dvh; }
.admin-sidebar { top: 0; height: 100dvh; padding-top: 24px; overflow-y: auto; }
.admin-sidebar > .brand { justify-content: center; padding: 0; width: 100%; flex-shrink: 0; }
.admin-sidebar .brand .community-logo { width: 89.6px; }
.admin-sidebar nav { margin-top: 28px; flex-shrink: 0; }
.sidebar-bottom:empty { display: none; }
.sidebar-bottom { padding-bottom: 22px; flex-shrink: 0; }
.admin-workspace { min-height: 100dvh; display: flex; flex-direction: column; }
.admin-main, .member-shell .public-main { flex: 1; min-height: 0; }
.admin-topbar { flex: none; }
.breadcrumbs .app-title { color: var(--ink); font-size: 19px; font-weight: 700; letter-spacing: -.5px; }
.sidebar-footer { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 18px 2px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.6; text-align: center; }
.sidebar-footer .footer-credit { font-size: 9px; }
.modal-panel > .sidebar-footer { margin: 4px 24px 22px; padding-top: 16px; }
.footer-credit { color: #718099; }
.footer-credit strong, .auth-footer strong { font-weight: 500; }
.auth-footer { text-align: center; }
.settings-actions { justify-content: flex-end; }

/* Searchable member and copy selection; hidden identifiers are never guessed. */
.search-picker { position: relative; min-width: 0; }
.search-picker > label { display: flex; margin-bottom: 10px; }
.picker-input { position: relative; }
.picker-input > .icon { position: absolute; left: 13px; top: 14px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.picker-input > input { width: 100%; padding-left: 40px; min-height: 46px; text-overflow: ellipsis; font-size: 12px; }
.picker-popup { position: absolute; z-index: 5; top: 100%; margin-top: 5px; width: 100%; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px #172b4d1a; overflow: hidden; }
.picker-popup[hidden] { display: none; }
.picker-options { max-height: 246px; overflow-y: auto; overscroll-behavior: contain; }
.picker-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid #edf1f7; }
.picker-option > span:first-child { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.picker-option strong { font-size: 12px; font-weight: 600; color: var(--ink); }
.picker-option small { font-size: 10px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.picker-option[aria-selected="true"], .picker-option:not([aria-disabled="true"]):hover { background: var(--primary-soft); }
.picker-option[aria-disabled="true"] { cursor: default; background: #f9fafc; }
.picker-option[aria-disabled="true"] strong { color: var(--muted); }
.picker-meta { font-size: 9px; color: var(--muted); text-align: right; flex: 0 0 85px; line-height: 1.5; }
.picker-status { font-size: 10px; color: var(--muted); background: #f8fafd; margin: 0; padding: 9px 14px; line-height: 1.5; }

/* Gallery thumbnails sit directly under the cover. */
.record-thumbnails { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.record-thumbnails .gallery-thumb { width: 100%; height: 68px; min-width: 0; padding: 4px; border-radius: 5px; transition: border-color .18s, background .18s; }
.record-thumbnails .gallery-thumb:hover { background: var(--primary-soft); }
.record-cover-button > .book-cover { width: 100%; box-shadow: 5px 8px 18px #1f488c21; }

@media (max-width: 760px) {
  .admin-topbar > .topbar-location { gap: 10px; }
  .mobile-brand .community-logo { width: 36px; }
  .breadcrumbs { display: flex; }
  .breadcrumbs > :not(.app-title) { display: none; }
  .breadcrumbs .app-title { font-size: 18px; }
  .record-thumbnails { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
  .record-thumbnails .gallery-thumb { height: 48px; padding: 3px; }
  .picker-input > input { font-size: 13px; }
  .picker-option { padding: 11px 12px; gap: 8px; }
  .picker-meta { flex-basis: 72px; }
}
@media (max-width: 760px) {
  .record-cover { display: contents; }
  .record-cover-button { grid-column: 1; grid-row: 1 / 5; align-self: start; }
  .record-thumbnails { grid-column: 1 / -1; grid-row: 5; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
  .record-thumbnails .gallery-thumb { width: 58px; min-width: 44px; height: 70px; padding: 4px; }
}
