@charset "UTF-8";
/* CSS Document */

:root {
/* ============================================================
   PRIMITIVES - raw values only. Never reference these directly
   in component CSS; always go through the semantic tokens below.
   ============================================================ */
  --ndl-p-white:     #fff;
  --ndl-p-gray-100:  #eee;
  --ndl-p-gray-200:  #d0d0d0;
  --ndl-p-gray-500:  #888;
  --ndl-p-gray-700:  #555;
  --ndl-p-gray-900:  #333;
  --ndl-p-black:     #000;
  
  --ndl-p-page-bg:   #fff;
  
  /*brand primary - dash,btns       DARK THEME ALT */
  --ndl-p-blue:          #5262a7;   --ndl-p-blue-dark:       #45568f;  
  --ndl-p-blue-light:    #6b7bc0;   --ndl-p-blue-light-dark: #45568f;
                                  
  /*brand secondary - icon-windows */
  --ndl-p-skyblue:       #52a9dc;   --ndl-p-skyb-dark:       #5262a7;
  --ndl-p-skyblue-light: #e8f1f3; /*BG in header */ 

  
  --ndl-p-green:         #2f8f4f;   --ndl-p-green-dark:    #276f3f;
  --ndl-p-red:           #b3402a;
  
  --ndl-p-status-available:   #e3f2e7;
  --ndl-p-status-reserved:    #dcedf8;
  --ndl-p-status-borrowed:    #fbedd4;
  --ndl-p-status-unavailable: #f9e3e2;
  

  /* ============================================================
     SEMANTIC - what component CSS actually uses. Names unchanged
     from before, so nothing elsewhere in this file needs editing.
     ============================================================ */
  --ndl-primary: var(--ndl-p-blue);
  --ndl-primary-hover: var(--ndl-p-blue-dark);
  --ndl-primary-light: var(--ndl-p-blue-light);
  --ndl-success: var(--ndl-p-green);
  --ndl-success-hover: var(--ndl-p-green-dark);
  --ndl-danger: var(--ndl-p-red);

  --ndl-status-available: var(--ndl-p-status-available);
  --ndl-status-reserved: var(--ndl-p-status-reserved);
  --ndl-status-borrowed: var(--ndl-p-status-borrowed);
  --ndl-status-unavailable: var(--ndl-p-status-unavailable);

  --ndl-gray-light: var(--ndl-p-gray-100);
  --ndl-gray-mid: var(--ndl-p-gray-500);
  --ndl-gray-dark: var(--ndl-p-gray-900);

  --ndl-bg-page: var(--ndl-p-page-bg);
  --ndl-bg-surface: var(--ndl-p-white);
  --ndl-bg-subtle: var(--ndl-p-gray-100);
  --ndl-border: var(--ndl-p-gray-100);
  --ndl-text-secondary: var(--ndl-p-gray-500);
  --ndl-text-primary: var(--ndl-p-gray-900);
}

/* Automatic dark mode - only primitives get redefined; every semantic
   token above updates on its own since it just points at one of these. */
@media (prefers-color-scheme: dark) {
  :root {
    --ndl-p-page-bg: #000;
    --ndl-p-blue: #7c8cd6;
    --ndl-p-blue-light: #97a3e0;
    --ndl-p-blue-dark: #93a1e0;
    --ndl-p-green: #5cbf82;
    --ndl-p-green-dark: #4aa870;
    --ndl-p-red: #e0705a;
    --ndl-p-gray-100: #3a3a3a;
    --ndl-p-gray-500: #a0a0a0;
    --ndl-p-gray-900: #e8e8e8;
    --ndl-p-white: #1e1e1e;
    --ndl-p-status-available: #1e3a24;
    --ndl-p-status-reserved: #1c3550;
    --ndl-p-status-borrowed: #4a3a1a;
    --ndl-p-status-unavailable: #4a2622;
  }
}

/* Manual override for the testing toggle button - same primitive-only
   redefinition as the media query above, just gated by an attribute
   instead of OS preference. Remove this whole block (and the toggle
   button JS) once you're done tuning values. */
html[data-ndl-theme="dark"] {
  /* --ndl-p-blue: #7c8cd6; */
  --ndl-p-page-bg: #000;
  --ndl-p-blue: #06064B;
  --ndl-p-blue-light: #97a3e0;
  --ndl-p-blue-dark: #93a1e0;
  --ndl-p-green: #5cbf82;
  --ndl-p-green-dark: #4aa870;
  --ndl-p-red: #e0705a;
  --ndl-p-gray-100: #3a3a3a;
  --ndl-p-gray-500: #a0a0a0;
  --ndl-p-gray-900: #e8e8e8;
  --ndl-p-white: #1e1e1e;
  --ndl-p-status-available: #1e3a24;
  --ndl-p-status-reserved: #1c3550;
  --ndl-p-status-borrowed: #4a3a1a;
  --ndl-p-status-unavailable: #4a2622;
}
html[data-ndl-theme="light"] {
  --ndl-p-page-bg: #FFF;
  --ndl-p-blue: #5262a7;
  --ndl-p-blue-light: #6b7bc0;
  --ndl-p-blue-dark: #45568f;
  --ndl-p-green: #2f8f4f;
  --ndl-p-green-dark: #276f3f;
  --ndl-p-red: #b3402a;
  --ndl-p-gray-100: #e0e0e0;
  --ndl-p-gray-500: #888;
  --ndl-p-gray-900: #333;
  --ndl-p-white: #fff;
  --ndl-p-status-available: #e3f2e7;
  --ndl-p-status-reserved: #dcedf8;
  --ndl-p-status-borrowed: #fbedd4;
  --ndl-p-status-unavailable: #f9e3e2;
}

#ndl-theme-toggle {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 9999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--ndl-border);
  background: var(--ndl-bg-surface);
  color: var(--ndl-text-primary);
  font-size: 1.2em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#ndl-theme-toggle:hover {
  background: var(--ndl-bg-subtle);
}

/* Extends theming beyond the plugin's own cards to the page itself, so dark mode doesn't
   leave plugin content floating on a theme background stuck in light mode. Targets body
   universally, plus the specific block-theme main wrapper for extra coverage where present. */
body,
#wp--skip-link--target {
  background-color: var(--ndl-bg-page);
}

/* ============================================================
   My Library: book card — inherits the global three-column grid
   (cover | info | copies) from .ndl-book-card; only override
   what genuinely differs from the Browse page card.
   ============================================================ */
.ndl-my-library .ndl-book-card {
  margin: 0;
}
.ndl-my-library .ndl-book-cover {
  aspect-ratio: 284 / 400;
  background: var(--ndl-bg-subtle);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ndl-my-library .ndl-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ndl-book-info {
  min-width: 0;
  var(--ndl-text-primary);
}

.book_title {
  margin: 0;
  font-weight: bold;
  font-size: 1.3em;
}
.book_author {
  font-weight: bold;
}
.book_info {
  font-size: 0.85em;
}

.ndl-book-actions {
  display: flex;
  gap: .75rem;
  margin-top: 1rem;
  align-items: center;
}
.ndl-edit-link {
  text-decoration: none;
}

.ndl-edit-panel {
  display: none;
  margin-top: 1rem;
}
.ndl-edit-panel.active {
  display: block;
}


/* Tag-style category picker */
.ndl-tag-input {
  position: relative;
  max-width: 500px;
}
.ndl-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.ndl-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eef3f8;
  border: 1px solid #c9d8e6;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.85em;
}
.ndl-tag-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1em;
  line-height: 1;
  padding: 0;
  color: var(--ndl-text-secondary);
}
.ndl-tag-chip-remove:hover {
  color: var(--ndl-danger);
}
.ndl-tag-search {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem;
  border: 1px solid var(--ndl-border);
  border-radius: 6px;
}
.ndl-tag-suggestions {
  display: none;
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--ndl-bg-surface);
  border: 1px solid var(--ndl-border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: var(--ndl-border) 0 4px 6px;
}
.ndl-tag-suggestions.active {
  display: block;
}
.ndl-tag-suggestion {
  padding: 0.5rem;
  cursor: pointer;
}
.ndl-tag-suggestion:hover {
  background: #f0f4f8;
}

/* OpenLibrary live search (Add Book form) */
.ndl-ol-search {
  position: relative;
  max-width: 500px;
}
.ndl-ol-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem;
  border: 1px solid var(--ndl-border);
  border-radius: 6px;
  font-size: 1em;
}
.ndl-ol-results {
  display: none;
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: var(--ndl-bg-surface);
  border: 1px solid var(--ndl-border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: var(--ndl-border) 0 4px 6px;
}
.ndl-ol-results.active {
  display: block;
}
.ndl-ol-result {
  padding: 0.6rem;
  cursor: pointer;
  border-bottom: 1px solid var(--ndl-bg-subtle);
}
.ndl-ol-result:last-child {
  border-bottom: none;
}
.ndl-ol-result:hover {
  background: #f0f4f8;
}
.ndl-ol-result-author {
  font-size: 0.85em;
  color: var(--ndl-text-secondary);
}
.ndl-ol-cover-preview {
  margin-top: 0.75rem;
}
.ndl-ol-cover-preview img {
  max-width: 90px;
  max-height: 130px;
  display: block;
  border: 1px solid var(--ndl-border);
  border-radius: 4px;
}
.ndl-ol-cover-note {
  font-size: 0.8em;
  color: var(--ndl-text-secondary);
  margin-top: 0.4rem;
}

/* Admin: merge-target search (Delete book with copies) */
.ndl-merge-search {
  position: relative;
  max-width: 500px;
}
.ndl-merge-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem;
  border: 1px solid var(--ndl-border);
  border-radius: 6px;
  font-size: 1em;
}
.ndl-merge-results {
  display: none;
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: var(--ndl-bg-surface);
  border: 1px solid var(--ndl-border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: var(--ndl-border) 0 4px 6px;
}
.ndl-merge-results.active {
  display: block;
}
.ndl-merge-result {
  padding: 0.6rem;
  cursor: pointer;
  border-bottom: 1px solid var(--ndl-bg-subtle);
}
.ndl-merge-result:last-child {
  border-bottom: none;
}
.ndl-merge-result:hover {
  background: #f0f4f8;
}

/* Admin: Books list table - fixed cover column width so Title doesn't get squeezed on narrow screens */
.column-cover {
  width: 60px;
  max-width: 60px;
}

/* ============================================================
   Front-end: Book Detail page
   ============================================================ */
.ndl-book-detail {
  max-width: 800px;
}
.ndl-book-detail-header {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 1.5rem;
  align-items: start;
}
.ndl-book-detail-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: var(--ndl-bg-subtle);
  border-radius: 6px;
  overflow: hidden;
}
.ndl-book-detail-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ndl-book-detail-cover-placeholder {
  color: var(--ndl-text-secondary);
  font-size: 0.9em;
}
.ndl-book-detail-title {
  margin: 0 0 0.4rem;
  font-size: 1.6em;
}
.ndl-book-detail-year {
  color: var(--ndl-text-secondary);
  font-weight: normal;
  font-size: 0.85em;
}
.ndl-book-detail-authors {
  margin: 0 0 1rem;
  font-weight: bold;
  color: var(--ndl-text-primary);
}
.ndl-book-detail-description {
  margin: 0 0 1rem;
  line-height: 1.5;
}
.ndl-book-detail-meta {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.9em;
}
.ndl-book-detail-meta li {
  margin-bottom: 0.3rem;
}
.ndl-book-detail-tags {
  margin: 0 0 0.5rem;
  font-size: 0.9em;
}

/* Copies / availability section (Book Detail + Browse) */
.ndl-book-detail-copies h3 {
  margin-bottom: 0.75rem;
}
.ndl-copies-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ndl-copy-row {
  position: relative;
  border: 1px solid var(--ndl-border);
  border-radius: 8px;
  background: var(--ndl-bg-surface);
  overflow: visible; /* must be visible so the absolutely-positioned ⋮ button is never clipped */
}
.ndl-copy-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 0.9rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.95em;
  box-sizing: border-box;
}
.ndl-copy-toggle:hover {
  background: var(--ndl-bg-subtle);
}
.ndl-copy-toggle-arrow {
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--ndl-text-secondary);
}
.ndl-copy-row.active .ndl-copy-toggle-arrow {
  transform: rotate(90deg);
}
.ndl-copy-summary {
  color: var(--ndl-text-primary);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-align: left;
}
.ndl-copy-attribution {
  font-size: 0.88em;
  font-weight: 600;
  color: var(--ndl-text-primary);
}
.ndl-copy-attribution-row {
  padding: 0 0.9rem 0.5rem;
}
.ndl-copy-status-label {
/*  font-size: 0.82em; */
  color: var(--ndl-text-secondary);
}

/* floating action icon + dropdown menu, top-right of each row */
.ndl-copy-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}
.ndl-copy-action-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  color: var(--ndl-text-secondary);
  border-radius: 4px;
}
.ndl-copy-action-icon:hover {
  background: var(--ndl-bg-subtle);
}
.ndl-copy-actions-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  min-width: 200px;
  background: var(--ndl-bg-surface);
  border: 1px solid var(--ndl-border);
  border-radius: 6px;
  box-shadow: var(--ndl-border) 0 4px 8px;
  padding: 0.4rem;
}
.ndl-copy-actions-menu.active {
  display: block;
}
.ndl-copy-request-button {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--ndl-bg-subtle);
  border: 1px solid var(--ndl-border);
  border-radius: 4px;
  color: var(--ndl-text-secondary);
  cursor: not-allowed;
  font-size: 0.9em;
}
.ndl-copy-request-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 0.9rem 0.75rem;
}
.ndl-copy-request-buttons .ndl-copy-request-button {
  width: auto;
  cursor: pointer;
  background: var(--ndl-primary);
  border: 1px solid var(--ndl-primary);
  color: #fff;
  font-weight: 600;
}
.ndl-copy-request-buttons .ndl-copy-request-button:hover {
  background: var(--ndl-primary-hover);
}
.ndl-copy-request-offered {
  background: var(--ndl-success);
  border-color: var(--ndl-success);
}
.ndl-copy-request-offered:hover {
  background: var(--ndl-success-hover);
}
.ndl-copy-request-cancel {
  background: var(--ndl-bg-surface);
  color: var(--ndl-danger);
  border-color: #e2b3a8;
}
.ndl-copy-request-cancel:hover {
  background: var(--ndl-status-unavailable);
}
.ndl-copy-request-note {
  font-size: 0.85em;
  color: var(--ndl-text-secondary);
  padding: 0.4rem 0;
}

/* expandable detail panel beneath the summary row */
.ndl-copy-details {
  display: none;
  padding: 0 0.9rem 0.9rem 2.4rem;
  font-size: 0.88em;
  color: var(--ndl-text-secondary);
}
.ndl-copy-row.active .ndl-copy-details {
  display: block;
}
.ndl-copy-details ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ndl-copy-details li {
  margin-bottom: 0.25rem;
}
.ndl-copy-location-placeholder em {
  color: var(--ndl-text-secondary);
}

/* Colour-coded copy row status backgrounds */
.ndl-copy-status-available   { background: var(--ndl-status-available); }
.ndl-copy-status-reserved    { background: var(--ndl-status-reserved); }
.ndl-copy-status-borrowed    { background: var(--ndl-status-borrowed); }
.ndl-copy-status-unavailable { background: var(--ndl-status-unavailable); }
.ndl-copy-status-sold        { background: #f5f5f5; }

/* Shared copy row: text link styled to match the menu's button rows */
.ndl-copy-menu-link {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9em;
  color: var(--ndl-text-primary);
  text-decoration: none;
  border-radius: 4px;
  box-sizing: border-box;
}
.ndl-copy-menu-link:hover {
  background: var(--ndl-bg-subtle);
}

@media (max-width: 600px) {
  .ndl-book-detail-header {
    grid-template-columns: 1fr;
  }
  .ndl-book-detail-cover {
    max-width: 200px;
  }
}
.ndl-copy-checkbox-wrap {
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem 0 0.9rem;
}
.ndl-copy-row-header {
  display: flex;
  align-items: center;
}
.ndl-copy-row-header .ndl-copy-toggle {
  flex: 1;
}
button.ndl-copy-menu-link {
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.ndl-copy-edit-panel {
  padding: 0.9rem;
  border-top: 1px solid var(--ndl-border);
  background: var(--ndl-bg-subtle);
}

/* ============================================================
   Front-end: My Library management panel
   ============================================================ */
.ndl-my-libraries-panel {
  background: var(--ndl-bg-subtle);
  border: 1px solid var(--ndl-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.ndl-libraries-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
}
.ndl-libraries-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--ndl-border);
}
.ndl-libraries-list li:last-child {
  border-bottom: none;
}
.ndl-library-item-count {
  color: var(--ndl-text-secondary);
  font-size: 0.85em;
  margin-left: 0.4rem;
}
.ndl-library-private-tag {
  display: inline-block;
  background: var(--ndl-bg-subtle);
  color: var(--ndl-text-secondary);
  font-size: 0.75em;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.4rem;
}
.ndl-library-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 500px;
}
.ndl-library-form input[type="text"],
.ndl-library-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem;
  border: 1px solid var(--ndl-border);
  border-radius: 6px;
}
.ndl-library-message {
  background: #eef8ee;
  border: 1px solid #cde5cd;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9em;
}

/* Bulk-assign bar above the My Library grid */
.ndl-bulk-assign-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--ndl-bg-subtle);
  border-radius: 8px;
}
.ndl-bulk-assign-bar select {
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--ndl-border);
}

/* Checkbox overlay on each My Library card */
.ndl-bulk-select {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 5;
  background: rgba(255,255,255,0.85);
  border-radius: 4px;
  padding: 0.2rem;
}
.ndl-bulk-select input {
  margin: 0;
}

/* Subtle "Create a New Library" form: collapsed to just a [+] name field until focused */
.ndl-library-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.ndl-library-create-icon {
  font-size: 1.1em;
  color: var(--ndl-text-secondary);
  line-height: 1;
}
#ndl-library-name-input {
  flex: 1;
}
.ndl-library-form-fields {
  display: none;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.ndl-library-form.active .ndl-library-form-fields {
  display: flex;
}
.ndl-library-form.active .ndl-library-create-icon {
  color: var(--ndl-text-primary);
}

/* Edit Library mode: styled header row with divider and X close button */
.ndl-library-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.75rem 0 0.5rem;
  padding: 0.5rem 0.6rem;
  background: var(--ndl-bg-subtle);
  border-radius: 6px;
  font-size: 0.78em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ndl-text-secondary);
}
.ndl-library-edit-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1em;
  color: var(--ndl-text-secondary);
  line-height: 1;
  padding: 0 0.2rem;
  text-decoration: none;
}
.ndl-library-edit-close:hover {
  color: var(--ndl-danger);
}

@media (max-width: 600px) {
  .ndl-bulk-assign-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================================================
   Front-end: Library Detail page
   ============================================================ */
.ndl-library-detail {
}
.ndl-library-detail-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.ndl-library-detail-cover {
  width: 160px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
}
.ndl-library-detail-cover img {
  width: 100%;
  display: block;
}
.ndl-library-detail-description {
  margin: 0.5rem 0;
  line-height: 1.5;
}
.ndl-library-detail-location,
.ndl-library-detail-notes {
  font-size: 0.9em;
  margin: 0.4rem 0;
}

/* Library Detail item list now uses shared .ndl-copies-list / .ndl-copy-row */
/* NOTE: this block styles render_browse_row(), which is no longer called anywhere -
   safe to delete in a future cleanup pass, not actively used */
.ndl-library-detail-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.ndl-library-detail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--ndl-border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
}
.ndl-library-detail-item-cover {
  width: 40px;
  height: 58px;
  flex-shrink: 0;
  background: var(--ndl-bg-subtle);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ndl-library-detail-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ndl-library-detail-item-cover-placeholder {
  font-size: 0.65em;
  color: var(--ndl-text-secondary);
}
.ndl-library-detail-item-status {
  font-size: 0.85em;
  color: var(--ndl-text-secondary);
}

@media (max-width: 600px) {
  .ndl-library-detail-header {
    flex-direction: column;
  }
  .ndl-library-detail-cover {
    width: 100%;
    max-width: 200px;
  }
}

/* ============================================================
   Browse page ([ndl_library] shortcode / render_library)
   ============================================================ */

/* Toolbar */
.ndl-browse-toolbar {
  margin-bottom: 1.25rem;
}
.ndl-browse-toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ndl-browse-search-form {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.ndl-browse-search-form input[type="text"] {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--ndl-border);
  border-radius: 6px;
  font-size: 0.95em;
  min-width: 0;
}
.ndl-search-btn {
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--ndl-border);
  border-radius: 6px;
  background: var(--ndl-bg-surface);
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.9em;
}
.ndl-search-btn:hover {
  background: var(--ndl-bg-subtle);
}

/* Filter icon button */
.ndl-filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--ndl-border);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  color: var(--ndl-text-secondary);
  flex-shrink: 0;
}
.ndl-filter-toggle-btn:hover,
.ndl-filter-toggle-btn[aria-expanded="true"] {
  background: var(--ndl-bg-subtle);
  color: var(--ndl-text-primary);
  border-color: var(--ndl-text-secondary);
}

/* Card/List view toggle buttons */
.ndl-view-toggle {
  display: inline-flex;
  border: 1px solid var(--ndl-border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.ndl-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  color: var(--ndl-text-secondary);
}
.ndl-view-btn[aria-pressed="true"] {
  background: var(--ndl-bg-subtle);
  color: var(--ndl-text-primary);
}
.ndl-view-btn:hover {
  color: var(--ndl-text-secondary);
}

/* Filter panel: hidden by default, shown when toggled or a filter is active */
.ndl-browse-filter-panel {
  display: none;
  margin-top: 0.6rem;
}
.ndl-browse-filter-panel.ndl-filter-open {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ndl-browse-filter-panel select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--ndl-border);
  border-radius: 6px;
  font-size: 0.9em;
}

.ndl-browse-clear {
  font-size: 0.85em;
  color: var(--ndl-text-secondary);
  white-space: nowrap;
}
.ndl-browse-active-filter {
  font-size: 0.88em;
  color: var(--ndl-text-secondary);
  margin-bottom: 1rem;
}

/* Book card: three-column grid layout */
.ndl-book-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ndl-book-card {
  display: grid;
  grid-template-columns: 120px 1fr 340px;
  gap: 1rem;
  padding: 1rem;
  margin: 0;
  border: 1px solid var(--ndl-border);
  border-radius: 10px;
  background: var(--ndl-bg-surface);
  align-items: start;
}
.ndl-book-cover {
  width: 100%;
  aspect-ratio: 284 / 400;
  background: var(--ndl-bg-subtle);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ndl-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ndl-book-cover-placeholder {
  font-size: 0.75em;
  color: var(--ndl-text-secondary);
}

/* Book info column */
.ndl-book-title {
  font-size: 1.15em;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.ndl-book-title a {
  color: var(--ndl-text-primary);
  text-decoration: none;
}
.ndl-book-title a:hover {
  text-decoration: underline;
}
.ndl-book-year {
  font-weight: normal;
  color: var(--ndl-text-secondary);
  font-size: 0.9em;
  margin-left: 0.3rem;
}
.ndl-book-authors {
  font-size: 0.9em;
  color: var(--ndl-text-primary);
  margin-bottom: 0.2rem;
}
.ndl-book-categories {
  font-size: 0.82em;
  margin-bottom: 0.4rem;
}
.ndl-filter-link {
  color: var(--ndl-text-secondary);
  text-decoration: none;
}
.ndl-filter-link:hover {
  color: var(--ndl-primary);
  text-decoration: underline;
}

/* Description: CSS-clamped to 3 lines by default, released when More Details opens */
.ndl-book-description {
  font-size: 0.88em;
  line-height: 1.5;
  color: var(--ndl-text-primary);
  margin-bottom: 0.5rem;
}
.ndl-book-description.ndl-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* More Details toggle */
.ndl-more-details-toggle {
  background: var(--ndl-bg-subtle);
  color: var(--ndl-text-secondary);
  border: solid 1px var(--ndl-bg-subtle);
  
  background-color: var(--ndl-p-skyblue-light);
  
  padding: 2px 3px;
  cursor: pointer;
  font-size: 0.75em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  width: fit-content;
}
.ndl-more-details-toggle:hover {
  color: var(--ndl-text-primary);
  border: solid 1px var(--ndl-text-secondary);
}
.ndl-more-details-arrow {
  display: inline-block;
  font-size: 0.75em;
  transition: transform 0.15s ease;
}
.ndl-more-details {
  display: none;
  font-size: 0.85em;
  color: var(--ndl-text-secondary);
  line-height: 1.7;
}
.ndl-request-history {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85em;
  color: var(--ndl-text-secondary);
}
.ndl-request-history li {
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--ndl-bg-subtle);
}
.ndl-request-history li:last-child {
  border-bottom: none;
}
.ndl-history-time {
  margin-left: 0.4rem;
  font-style: italic;
}
.ndl-history-detail {
}

/* Copies column */
.ndl-book-copies {
  border-left: 1px solid var(--ndl-border);
  padding-left: 1rem;
}
.ndl-copies-count {
  font-size: 0.88em;
  font-weight: 600;
  color: var(--ndl-text-primary);
  margin-bottom: 0.6rem;
}
.ndl-login-hint {
  font-weight: normal;
  font-size: 0.9em;
  color: var(--ndl-text-secondary);
  display: block;
  margin-top: 0.2rem;
}

/* List view: compact single-row format */
.ndl-book-list.ndl-list-view .ndl-book-card {
  grid-template-columns: 48px 1fr auto;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  align-items: center;
}
.ndl-book-list.ndl-list-view .ndl-book-cover {
  aspect-ratio: 284 / 400;
  border-radius: 3px;
}
.ndl-book-list.ndl-list-view .ndl-book-description,
.ndl-book-list.ndl-list-view .ndl-more-details-toggle,
.ndl-book-list.ndl-list-view .ndl-more-details,
.ndl-book-list.ndl-list-view .ndl-book-categories {
  display: none;
}
.ndl-book-list.ndl-list-view .ndl-book-title {
  font-size: 0.95em;
  margin-bottom: 0.1rem;
}
.ndl-book-list.ndl-list-view .ndl-book-authors {
  font-size: 0.8em;
  margin-bottom: 0;
}
.ndl-book-list.ndl-list-view .ndl-book-copies {
  border-left: none;
  padding-left: 0.5rem;
  min-width: 140px;
  text-align: right;
}
.ndl-book-list.ndl-list-view .ndl-copies-list {
  display: none;
}

@media (max-width: 760px) {
  .ndl-browse-toolbar-row {
    flex-wrap: wrap;
  }
  .ndl-browse-search-form {
    flex: 1 1 200px;
  }
  .ndl-book-card {
    grid-template-columns: 80px 1fr;
  }
  .ndl-book-copies {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid var(--ndl-border);
    padding-left: 0;
    padding-top: 0.75rem;
  }
  .ndl-book-list.ndl-list-view .ndl-book-copies {
    grid-column: auto;
    border-top: none;
    padding-top: 0;
  }
}
@media (max-width: 480px) {
  .ndl-book-card {
    grid-template-columns: 1fr;
  }
  .ndl-book-cover {
    max-width: 120px;
  }
}

/* ============================================================
   Dashboard ([ndl_dashboard] shortcode)
   ============================================================ */

.ndl-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: linear-gradient(to bottom, var(--ndl-primary-light) 0%, var(--ndl-primary) 30%, var(--ndl-primary) 100%);
  border-radius: 12px;
  padding: 1.5rem;
}

/* Section wrapper */
.ndl-dash-section {
  background: var(--ndl-bg-surface);
  border: 0 solid var(--ndl-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
@media (max-width: 480px) {
  .ndl-dash-section {
    border-radius: 8px;
    padding: 0.5em 0.6rem
  }
}
.ndl-dash-section-title {
  margin: 0 0 1rem;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ndl-text-secondary);
}

/* Quick stats row — full width across the dashboard */
.ndl-dash-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0;
  background: transparent;
}
.ndl-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 70px;
  padding: 0.75rem 0.5rem;
  background: var(--ndl-bg-subtle);
  border-radius: 8px;
  border: 1px solid var(--ndl-border);
  text-align: center;
}
.ndl-stat-number {
  font-size: 1.9em;
  font-weight: 700;
  line-height: 1;
  color: var(--ndl-text-primary);
}
.ndl-stat-label {
  font-size: 0.7em;
  color: var(--ndl-text-secondary);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ndl-stat-available .ndl-stat-number { color: #2a7a44; }
.ndl-stat-borrowed  .ndl-stat-number { color: #8a5a1a; }
.ndl-stat-reserved  .ndl-stat-number { color: #1a5080; }
.ndl-stat-ungrouped .ndl-stat-number { color: var(--ndl-text-secondary); }
.ndl-stat-available { background: var(--ndl-status-available); border-color: #b8dfc2; }
.ndl-stat-borrowed  { background: var(--ndl-status-borrowed); border-color: #f0d0a0; }
.ndl-stat-reserved  { background: var(--ndl-status-reserved); border-color: #a8cce8; }
.ndl-stat-ungrouped { background: var(--ndl-bg-subtle); border-color: var(--ndl-gray-light); }

/* Two-column body below stats — 1/3 libraries, 2/3 attention+notifications */
.ndl-dash-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.25rem;
  align-items: start;
}

/* Left column: My Libraries */
.ndl-dash-col-libraries {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Libraries as a compact stacked list */
.ndl-dash-libraries-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}
.ndl-dash-library-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--ndl-bg-subtle);
}
.ndl-dash-library-row:last-child {
  border-bottom: none;
}
.ndl-dash-library-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.ndl-dash-library-name {
  font-weight: 600;
  font-size: 0.92em;
  color: var(--ndl-text-primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
a.ndl-dash-library-name:hover {
  color: var(--ndl-primary);
}
.ndl-dash-library-count {
  font-size: 0.76em;
  color: var(--ndl-text-secondary);
  white-space: nowrap;
}
.ndl-dash-library-actions {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}
.ndl-dash-lib-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--ndl-gray-light);
  background: var(--ndl-bg-surface);
  color: var(--ndl-text-secondary);
  text-decoration: none;
  font-size: 0.8em;
  cursor: pointer;
  flex-shrink: 0;
}
.ndl-dash-lib-btn:hover {
  background: var(--ndl-bg-subtle);
  color: var(--ndl-text-primary);
}
.ndl-dash-lib-btn-delete:hover {
  background: var(--ndl-status-unavailable);
  border-color: #e8a0a0;
  color: var(--ndl-danger);
}
.ndl-dash-empty {
  color: var(--ndl-text-secondary);
  font-style: italic;
  font-size: 0.88em;
  margin: 0 0 0.75rem;
}

/* Right column: Attention + Notifications stacked */
.ndl-dash-col-right {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Activity rows (borrows + reservations) */
.ndl-dash-activity-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--ndl-bg-subtle);
  padding-left: 0.4rem;
  margin: 0.2em 0;
}
.ndl-dash-activity-row:last-child {
  border-bottom: none;
}
.ndl-dash-activity-cover {
  width: 34px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--ndl-bg-subtle);
}
.ndl-dash-activity-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  color: var(--ndl-text-primary);
}
.ndl-dash-activity-library {
  font-size: 0.8em;
  color: var(--ndl-text-secondary);
}
.ndl-dash-activity-source {
  display: block;
  margin: -0.4rem 0 0 -0.1rem;
  color: var(--ndl-text-secondary);
}
.ndl-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.85rem;
  text-decoration: none;
  margin-right: 0.2rem;
  padding: 1px 6px;
  color: var(--ndl-text-primary);
  background-color: var(--ndl-bg-subtle);
  /*background-color: var(--ndl-p-skyblue-light); */
}
a.ndl-source-chip:hover {
  color: var(--ndl-primary);
  background-color: rgba(255, 255, 255, 0.85);
  box-shadow: 2px 2px 5px var(--ndl-primary)
}
.ndl-dash-activity-meta {
  font-size: 0.85em;
  color: var(--ndl-text-primary);
}
.ndl-dash-placeholder {
  font-style: italic;
  color: var(--ndl-text-secondary);
}
.ndl-dash-activity-actions {
  flex-shrink: 0;
}
.ndl-dash-action-btn {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--ndl-primary);
  border-radius: 5px;
  background: var(--ndl-primary);
  color: #fff;
  cursor: pointer;
  font-size: 0.78em;
  font-weight: 600;
}
.ndl-dash-action-btn:hover {
  background: var(--ndl-primary-hover);
}
.ndl-dash-action-btn:disabled {
  background: var(--ndl-bg-subtle);
  color: var(--ndl-text-secondary);
  border-color: var(--ndl-border);
  cursor: not-allowed;
}
@media (max-width: 580px) {
  .ndl-dash-activity-row {
    flex-wrap: wrap;
  }
  .ndl-dash-activity-actions {
    flex: 1 0 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-left: calc(34px + 0.75rem);
  }
}
.ndl-dash-borrowed { border-left: 3px solid #f0c040; }
.ndl-dash-reserved { border-left: 3px solid #88aadd; }

/* Notifications */
.ndl-dash-notifications-empty {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ndl-text-secondary);
  font-size: 0.88em;
}
.ndl-dash-bell {
  font-size: 1.3em;
  flex-shrink: 0;
  opacity: 0.5;
}
.ndl-dash-notifications-empty p {
  margin: 0;
}

@media (max-width: 760px) {
  .ndl-dash-body {
    grid-template-columns: 1fr;
  }
  .ndl-dash-library-name {
    max-width: 200px;
  }
}
@media (max-width: 480px) {
  .ndl-dash-stats {
    gap: 0.4rem;
  }
  .ndl-stat-card {
    min-width: 60px;
    padding: 0.5rem 0.25rem;
  }
  .ndl-stat-number {
    font-size: 1.5em;
  }
}

/* Dashboard: +Add New Item — own section box, anchor fills the entire clickable area */
.ndl-dash-add-item {
  padding: 0;
  background: #e8f1f3;
  border-color: #c5dde3;
  overflow: hidden;
}
.ndl-dash-add-item-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1.25rem;
  background: transparent;
  color: var(--ndl-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95em;
  transition: background 0.15s ease;
}
.ndl-dash-add-item-btn:hover {
  background: rgba(26, 77, 143, 0.08);
  color: var(--ndl-primary);
}
.ndl-dash-add-icon {
  font-size: 1.4em;
  line-height: 1;
  font-weight: 300;
}

/* Library Detail: inline +Add New Item (less prominent than dashboard version) */
.ndl-add-item-inline {
  display: inline-flex;
  width: auto;
  padding: 0.4rem 0.9rem;
  background: #f0f4fa;
  color: var(--ndl-primary);
  border: 1px solid #b8cff0;
  border-radius: 6px;
  font-size: 0.88em;
  margin-bottom: 0.75rem;
}
.ndl-add-item-inline:hover {
  background: var(--ndl-primary);
  color: #fff;
  border-color: var(--ndl-primary);
}

/* Add Book page: prefill notice shown when arriving from a Library Detail link */
.ndl-prefill-notice {
  background: #eaf0fb;
  border: 1px solid #b8cff0;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9em;
  color: var(--ndl-primary);
  margin-bottom: 1rem;
}

/* ============================================================
   Add Book page ([ndl_add_book] shortcode)
   ============================================================ */

.ndl-add-book-success {
  background: #eaf6ee;
  border: 1px solid #c3e6cb;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  color: #1a7a3c;
  margin-bottom: 1rem;
}

.ndl-add-book-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}
.ndl-add-book-left,
.ndl-add-book-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ndl-add-book-section {
  background: var(--ndl-bg-surface);
  border: 1px solid var(--ndl-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
.ndl-add-book-section-title {
  margin: 0 0 1rem;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ndl-text-secondary);
}
.ndl-add-book-hint {
  font-size: 0.88em;
  color: var(--ndl-text-secondary);
  margin: -0.5rem 0 0.75rem;
}
.ndl-manual-toggle {
  background: none;
  border: none;
  padding: 0;
  margin-top: 0.75rem;
  cursor: pointer;
  font-size: 0.85em;
  color: var(--ndl-text-secondary);
  text-decoration: underline;
  display: block;
}
.ndl-manual-toggle:hover {
  color: var(--ndl-text-primary);
}
.ndl-add-book-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.ndl-add-book-row p {
  flex: 1;
  min-width: 100px;
}
.ndl-add-book-section p {
  margin: 0 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.ndl-add-book-section label {
  font-size: 0.82em;
  font-weight: 600;
  color: var(--ndl-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ndl-add-book-section input[type="text"],
.ndl-add-book-section input[type="number"],
.ndl-add-book-section select,
.ndl-add-book-section textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--ndl-border);
  border-radius: 6px;
  font-size: 0.9em;
}
.ndl-add-book-section textarea {
  resize: vertical;
}
.ndl-checkbox-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88em !important;
  font-weight: normal !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--ndl-text-primary) !important;
}
.ndl-price-model-inline {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.ndl-price-model-inline select {
  flex: 1;
}
.ndl-price-model-inline input[type="number"] {
  width: 90px;
  flex-shrink: 0;
}
.ndl-add-book-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.ndl-add-book-actions button {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--ndl-border);
  border-radius: 6px;
  background: var(--ndl-bg-subtle);
  cursor: pointer;
  font-size: 0.9em;
}
.ndl-add-book-actions .ndl-btn-primary {
  background: var(--ndl-primary);
  color: #fff;
  border-color: var(--ndl-primary);
}
.ndl-add-book-actions .ndl-btn-primary:hover {
  background: var(--ndl-primary-hover);
}

@media (max-width: 760px) {
  .ndl-add-book-layout {
    grid-template-columns: 1fr;
  }
}

/* Add Book: selected book summary panel */
.ndl-book-summary {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f0f4fa;
  border: 1px solid #b8cff0;
  border-radius: 8px;
  margin-top: 0.75rem;
  position: relative;
}
.ndl-book-summary-cover {
  width: 48px;
  height: 68px;
  flex-shrink: 0;
  background: var(--ndl-bg-subtle);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ndl-book-summary-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ndl-summary-cover-placeholder {
  font-size: 0.6em;
  color: var(--ndl-text-secondary);
}
.ndl-book-summary-info {
  flex: 1;
  min-width: 0;
}
.ndl-summary-title {
  font-weight: 700;
  font-size: 0.95em;
  color: var(--ndl-text-primary);
  margin-bottom: 0.2rem;
}
.ndl-summary-authors {
  font-size: 0.85em;
  color: var(--ndl-text-secondary);
  margin-bottom: 0.15rem;
}
.ndl-summary-meta {
  font-size: 0.78em;
  color: var(--ndl-text-secondary);
}
.ndl-clear-selection {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78em;
  color: var(--ndl-text-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}
.ndl-clear-selection:hover {
  background: #e0eaf8;
  color: var(--ndl-danger);
}
.ndl-ol-results-header {
  padding: 0.3rem 0.6rem;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ndl-text-secondary);
  background: var(--ndl-bg-subtle);
  border-bottom: 1px solid var(--ndl-bg-subtle);
}
.ndl-result-ndl {
  border-left: 3px solid var(--ndl-primary);
}
.ndl-result-ol {
  border-left: 3px solid var(--ndl-border);
}
.ndl-ol-cover-preview {
  margin-top: 0.5rem;
}
.ndl-ol-cover-preview img {
  max-width: 70px;
  max-height: 100px;
  display: block;
  border: 1px solid var(--ndl-border);
  border-radius: 4px;
}
.ndl-ol-cover-note {
  font-size: 0.78em;
  color: var(--ndl-text-secondary);
  margin-top: 0.3rem;
}

/* ============================================================
   My Library page ([ndl_my_library] shortcode)
   ============================================================ */

.ndl-copy-bulk-checkbox {
  display: flex;
  align-items: center;
  padding: 0 0.4rem 0 0.6rem;
  cursor: pointer;
  flex-shrink: 0;
}
.ndl-copy-bulk-checkbox input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--ndl-primary);
}
.ndl-edit-panel {
  display: none;
  padding: 1rem 1rem 0.75rem;
  background: var(--ndl-bg-subtle);
  border-top: 1px solid var(--ndl-border);
}
.ndl-edit-panel.ndl-edit-panel-open {
  display: block;
}
.ndl-edit-copy-form p {
  margin: 0 0 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ndl-edit-copy-form label:first-child {
  font-size: 0.78em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ndl-text-secondary);
}
.ndl-edit-copy-form select,
.ndl-edit-copy-form input[type="text"],
.ndl-edit-copy-form input[type="number"],
.ndl-edit-copy-form textarea {
  width: 100%;
  max-width: 340px;
  box-sizing: border-box;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--ndl-border);
  border-radius: 5px;
  font-size: 0.88em;
}
.ndl-edit-copy-form textarea {
  resize: vertical;
  max-width: 100%;
}
.ndl-edit-copy-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ndl-bg-subtle);
}
.ndl-edit-copy-actions button {
  padding: 0.4rem 0.9rem;
  border-radius: 5px;
  border: 1px solid var(--ndl-border);
  background: var(--ndl-bg-subtle);
  cursor: pointer;
  font-size: 0.88em;
}
.ndl-edit-copy-actions button[type="submit"] {
  background: var(--ndl-primary);
  color: #fff;
  border-color: var(--ndl-primary);
}
.ndl-ml-bulk-bar {
  display: none;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: var(--ndl-primary);
  color: #fff;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  position: sticky;
  top: 0.5rem;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.ndl-ml-bulk-bar.ndl-bulk-bar-active {
  display: flex;
}
.ndl-ml-bulk-count {
  font-size: 0.88em;
  font-weight: 600;
  white-space: nowrap;
  margin-right: 0.25rem;
}
.ndl-ml-bulk-bar select {
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  border: none;
  font-size: 0.88em;
  background: var(--ndl-bg-surface);
  color: var(--ndl-text-primary);
}
.ndl-ml-bulk-apply {
  padding: 0.3rem 0.75rem;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.88em;
  cursor: pointer;
  font-weight: 600;
}
.ndl-ml-bulk-apply:hover {
  background: rgba(255,255,255,0.28);
}
.ndl-ml-bulk-cancel {
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.75);
  font-size: 0.82em;
  cursor: pointer;
  margin-left: auto;
  text-decoration: underline;
}
.ndl-ml-bulk-cancel:hover {
  color: #fff;
}
#ndl-ml-bulk-library-wrap {
  display: inline-flex;
  align-items: center;
}
.ndl-copy-menu-action {
  display: block;
  width: 100%;
  padding: 0.4rem 0.75rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.88em;
  color: var(--ndl-text-primary);
  white-space: nowrap;
}
.ndl-copy-menu-action:hover {
  background: #f0f4fa;
  color: var(--ndl-primary);
}
.ndl-copy-menu-action[disabled] {
  color: var(--ndl-text-secondary);
  cursor: not-allowed;
}
.ndl-copy-menu-action[disabled]:hover {
  background: none;
  color: var(--ndl-text-secondary);
}
.ndl-my-library-list.ndl-list-view .ndl-book-info .ndl-more-details-toggle,
.ndl-my-library-list.ndl-list-view .ndl-book-info .ndl-more-details,
.ndl-my-library-list.ndl-list-view .ndl-book-info .ndl-book-categories {
  display: none;
}

/* Copy row: compact quick-edit panel (owner_library mode) */
.ndl-copy-quick-edit {
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.03);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.ndl-quick-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ndl-quick-status-label {
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ndl-text-secondary);
  white-space: nowrap;
}
.ndl-quick-status-select {
  flex: 1;
  min-width: 120px;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--ndl-border);
  border-radius: 5px;
  font-size: 0.88em;
  background: var(--ndl-bg-surface);
}
.ndl-quick-status-save {
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  border: 1px solid var(--ndl-primary);
  background: var(--ndl-primary);
  color: #fff;
  font-size: 0.82em;
  cursor: pointer;
  white-space: nowrap;
}
.ndl-quick-status-save:hover {
  background: var(--ndl-primary-hover);
}
.ndl-quick-details {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
  font-size: 0.78em;
  color: var(--ndl-text-secondary);
}
.ndl-quick-notes {
  font-style: italic;
}

/* ── Dashboard row 1: +Add left, stat pills right ── */
.ndl-dash-row-top {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}
.ndl-dash-row-top .ndl-dash-add-item {
  flex-shrink: 0;
  width: 200px;
}

/* Compact stat pills */
.ndl-dash-stats {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  flex-wrap: wrap;
  align-items: stretch;
}
.ndl-stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 60px;
  padding: 0.5rem 0.4rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.ndl-stat-pill:hover {
  background: rgba(255, 255, 255, 0.28);
}
.ndl-stat-pill-number {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}
.ndl-stat-pill-label {
  font-size: 0.65em;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.ndl-stat-pill.ndl-stat-available { background: rgba(227, 242, 231, 0.25); border-color: rgba(227, 242, 231, 0.4); }
.ndl-stat-pill.ndl-stat-borrowed  { background: rgba(251, 237, 212, 0.25); border-color: rgba(251, 237, 212, 0.4); }
.ndl-stat-pill.ndl-stat-reserved  { background: rgba(220, 237, 248, 0.25); border-color: rgba(220, 237, 248, 0.4); }
.ndl-stat-pill.ndl-stat-ungrouped { background: rgba(255, 255, 255, 0.1);  border-color: rgba(255, 255, 255, 0.15); }

.ndl-stat-pill.ndl-stat-available   { border-color: var(--ndl-status-available); }
.ndl-stat-pill.ndl-stat-reserved    { border-color: var(--ndl-status-reserved); }
.ndl-stat-pill.ndl-stat-borrowed    { border-color: var(--ndl-status-borrowed); }
.ndl-stat-pill.ndl-stat-ungrouped   { border-color: var(--ndl-gray-light); }

.ndl-stat-pill.ndl-stat-unavailable { background: rgba(249, 227, 226, 0.25); border-color: rgba(249, 227, 226, 0.4); border-color: var(--ndl-status-unavailable); }
.ndl-stat-pill.ndl-stat-unavailable:hover { background: rgba(249, 227, 226, 0.75); }

.ndl-stat-pill.ndl-stat-available:hover { background: rgba(227, 242, 231, 0.75); }
.ndl-stat-pill.ndl-stat-borrowed:hover  { background: rgba(251, 237, 212, 0.75); }
.ndl-stat-pill.ndl-stat-reserved:hover  { background: rgba(220, 237, 248, 0.75); }

/* Full/Compact toggle bar */
.ndl-dash-toggle-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.35rem 0.6rem;
  background: rgba(0, 0, 0, 0.12);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75em;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.15s ease;
}
.ndl-dash-toggle-bar:hover {
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
}
.ndl-dash-toggle-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
  transform: rotate(90deg);
  font-size: 0.9em;
}

@media (max-width: 760px) {
  .ndl-dash-row-top {
    flex-direction: column;
  }
  .ndl-dash-row-top .ndl-dash-add-item {
    width: 100%;
  }
}

.ndl-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.ndl-modal-overlay.active {
  display: flex;
}
.ndl-modal-box {
  background: var(--ndl-bg-surface);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 420px;
  width: 90%;
  position: relative;
  box-shadow: var(--ndl-border) 0 6px 20px;
}
.ndl-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.4em;
  cursor: pointer;
  color: var(--ndl-text-secondary);
}
.ndl-modal-summary {
  font-weight: 600;
  margin-bottom: 0.75rem;
}
#ndl-request-message {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.5rem;
}
.ndl-modal-error {
  color: var(--ndl-danger);
  font-size: 0.9em;
  min-height: 1.2em;
}
.ndl-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.ndl-modal-cancel {
  background: var(--ndl-bg-subtle);
  border: 1px solid var(--ndl-border);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}
.ndl-modal-submit {
  background: var(--ndl-primary);
  border: 1px solid var(--ndl-primary);
  color: #fff;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
}
.ndl-modal-submit:hover {
  background: var(--ndl-primary-hover);
}

/* mobile: stack the copy row's action buttons full-width below the status summary */
@media (max-width: 480px) {
  .ndl-copy-request-buttons {
    flex-direction: column;
  }
  .ndl-copy-request-buttons .ndl-copy-request-button {
    width: 100%;
  }
}

.ndl-dash-activity-message {
  font-style: italic;
  color: var(--ndl-text-secondary);
  font-size: 0.9em;
}
.ndl-dash-action-btn-secondary {
  background: var(--ndl-bg-surface);
  color: var(--ndl-text-secondary);
  border: 1px solid var(--ndl-border);
}
.ndl-dash-activity-note {
  font-size: 0.85em;
  color: var(--ndl-text-secondary);
}


/*
   ============================================================
   Front-end: Browse row (Library Detail render_browse_row)
   DISABLED - render_browse_row() is no longer called anywhere.
   Kept here, commented out, as a safety net before full deletion.
   ============================================================

.ndl-browse-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ndl-browse-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  position: relative;
  border: 1px solid var(--ndl-border);
  border-radius: 8px;
  background: var(--ndl-bg-surface);
  padding: 0.6rem 2.5rem 0.6rem 0.6rem;
}
.ndl-browse-cover {
  width: 48px;
  height: 68px;
  flex-shrink: 0;
  background: var(--ndl-bg-subtle);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ndl-browse-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ndl-browse-cover-placeholder {
  font-size: 0.65em;
  color: var(--ndl-text-secondary);
}
.ndl-browse-info {
  flex: 1;
  min-width: 0;
}
.ndl-browse-toggle {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-size: 1em;
  font-weight: 600;
  color: var(--ndl-text-primary);
  width: 100%;
}
.ndl-browse-toggle:hover {
  color: #000;
}
.ndl-browse-toggle-arrow {
  display: inline-block;
  font-size: 0.75em;
  color: var(--ndl-text-secondary);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.ndl-browse-row.active .ndl-browse-toggle-arrow {
  transform: rotate(90deg);
}
.ndl-browse-title {
  flex: 1;
}
.ndl-browse-title a {
  color: inherit;
  text-decoration: none;
}
.ndl-browse-title a:hover {
  text-decoration: underline;
}
.ndl-browse-authors {
  font-size: 0.85em;
  color: var(--ndl-text-secondary);
  margin-top: 0.2rem;
}
.ndl-browse-categories {
  font-size: 0.8em;
  color: var(--ndl-text-secondary);
  margin-top: 0.15rem;
}
.ndl-browse-details {
  display: none;
  margin-top: 0.6rem;
  font-size: 0.88em;
  color: var(--ndl-text-secondary);
}
.ndl-browse-row.active .ndl-browse-details {
  display: block;
}
.ndl-browse-details ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ndl-browse-details li {
  margin-bottom: 0.25rem;
}
.ndl-browse-row .ndl-copy-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

@media (max-width: 480px) {
  .ndl-browse-cover {
    width: 38px;
    height: 54px;
  }
}
*/
