:root {
  --bg:        #13111a;
  --surface:   #1e1b2e;
  --surface2:  #2a2540;
  --accent:    #c084fc;
  --accent2:   #a855f7;
  --text:      #e8e3f0;
  --muted:     #7c7a8e;
  --card-w:    140px;
  --cover-h:   210px;
  --radius:    8px;
  --shadow:    0 6px 24px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────── */
header {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.2rem 2rem;
}
.search-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color .15s;
}
.search-icon-btn:hover, .search-icon-btn.active { color: var(--accent); }
.header-search {
  display: none;
  padding: 0 2rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.header-search.open { display: block; }
.header-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 560px;
}
.header-search-bar input {
  flex: 1;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
}
.header-search-bar input::placeholder { color: var(--muted); }
.header-search-bar input:focus { border-color: var(--accent); }
.header-search-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 6px;
  transition: color .15s;
}
.header-search-close:hover { color: var(--text); }
.header-search-results {
  margin-top: 0.75rem;
  max-width: 560px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: none;
}
.header-search-results::-webkit-scrollbar { display: none; }
.header-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: background .15s;
}
.header-result-item:hover { background: rgba(255,255,255,0.04); }
.header-result-cover {
  width: 32px;
  height: 48px;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--surface2);
  overflow: hidden;
}
.header-result-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.header-result-info { flex: 1; min-width: 0; }
.header-result-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-result-author {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-add-btn {
  flex-shrink: 0;
  padding: 0.28rem 0.65rem;
  border-radius: 4px;
  border: 1px solid var(--accent2);
  background: transparent;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.header-add-btn:hover { background: var(--accent2); color: #fff; }
.header-add-btn:disabled { opacity: 0.5; cursor: default; }
.header-search-hint { font-size: 0.82rem; color: var(--muted); padding: 0.5rem; }
.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: background .15s;
}
.menu-btn:hover span { background: var(--accent); }
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.user-menu { position: relative; }
.user-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.user-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(192,132,252,0.08);
}
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 140px;
  z-index: 200;
  overflow: hidden;
}
.user-dropdown.open { display: block; }
.dropdown-username {
  padding: 0.65rem 1rem 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, background .15s;
}
.dropdown-item:hover { color: #ff6b6b; background: rgba(255,107,107,0.06); }
.home-btn {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color .15s;
}
.home-btn:hover { color: var(--accent2); }

/* ── Sidebar ─────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.open { display: block; }
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 220px;
  background: var(--surface);
  z-index: 100;
  transform: translateX(-100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  padding-top: 1rem;
  box-shadow: 4px 0 24px rgba(0,0,0,0.4);
}
.sidebar.open { transform: translateX(0); }
.sidebar-header {
  padding: 0.75rem 1.25rem 1.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 0.5rem;
}
.sidebar nav button {
  display: block;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  font-family: inherit;
}
.sidebar nav button:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.sidebar nav button.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(192,132,252,0.08);
}
.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 0.5rem 0;
}

/* ── Loading ─────────────────────────────────────── */
.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 0;
}
.page-loader.hidden { display: none; }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(192,132,252,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.shelf-content.hidden { display: none; }

/* ── Book cards ──────────────────────────────────── */
.book-card {
  width: var(--card-w);
  flex-shrink: 0;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform .2s;
}
.book-card:hover { transform: translateY(-5px); }
.book-card:hover .cover-img { box-shadow: 0 12px 36px rgba(192,132,252,0.3); }
.cover-wrap {
  width: var(--card-w);
  height: var(--cover-h);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  cursor: pointer;
}
.cover-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background .2s;
}
.book-card:hover .cover-wrap::after { background: rgba(0,0,0,0.28); }
.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: box-shadow .2s;
}
.cover-placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  text-align: center;
  gap: 0.4rem;
}
.cover-placeholder .ph-title {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  word-break: break-word;
}
.cover-placeholder .ph-author {
  font-size: 0.62rem;
  color: var(--muted);
}
.card-meta { margin-top: 0.5rem; }
.card-meta .card-title {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.card-meta .card-author {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.card-stars {
  font-size: 0.7rem;
  margin-top: 3px;
  color: #f5c518;
  letter-spacing: 1px;
}
.add-btn {
  margin-top: 0.4rem;
  width: 100%;
  padding: 0.3rem 0;
  border-radius: 4px;
  border: 1px solid var(--accent2);
  background: transparent;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.add-btn:hover { background: var(--accent2); color: #fff; }
.add-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Edit modal ──────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 14px;
  padding: 1.75rem;
  max-width: 560px;
  width: 94%;
  max-height: 90vh;
  display: flex;
  gap: 1.5rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  overflow: hidden;
}
.modal-cover {
  flex-shrink: 0;
  width: 110px;
  height: 165px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  align-self: flex-start;
}
.modal-cover img { width: 100%; height: 100%; object-fit: cover; }
.modal-cover-placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}
.modal-body { flex: 1; min-width: 0; overflow-y: auto; padding-right: 4px; }
.modal-book-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.2rem;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text);
  padding: 2px 0;
  outline: none;
  font-family: inherit;
  cursor: text;
  transition: border-color .15s;
}
.modal-book-title:hover  { border-bottom-color: rgba(255,255,255,0.15); }
.modal-book-title:focus  { border-bottom-color: var(--accent); }
.modal-book-author {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  padding: 2px 0;
  outline: none;
  font-family: inherit;
  cursor: text;
  transition: border-color .15s;
}
.modal-book-author:hover { border-bottom-color: rgba(255,255,255,0.15); }
.modal-book-author:focus { border-bottom-color: var(--accent); }
.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 0.25rem;
  margin-top: 0.75rem;
}
.field-label:first-of-type { margin-top: 0; }
.modal-body select,
.modal-body textarea,
.modal-body input[type=date],
.modal-body input[type=text]:not(.modal-book-title):not(.modal-book-author) {
  width: 100%;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.modal-body select:focus,
.modal-body textarea:focus,
.modal-body input[type=date]:focus,
.modal-body input[type=text]:not(.modal-book-title):not(.modal-book-author):focus { border-color: var(--accent); }
.modal-body textarea { resize: vertical; min-height: 64px; }
.date-row { display: flex; align-items: center; gap: 0.75rem; }
.date-row input[type=date] { flex: 1; }
.na-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.na-label input[type=checkbox] { cursor: pointer; accent-color: var(--accent); }
.stars-row { display: flex; gap: 5px; margin-top: 0.3rem; }
.star {
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--surface2);
  transition: color .1s, transform .1s;
  line-height: 1;
}
.star:hover, .star.lit { color: #f5c518; }
.star:hover { transform: scale(1.15); }
.modal-actions { display: flex; gap: 0.5rem; margin-top: 1.2rem; flex-wrap: wrap; }
.btn-save {
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  background: var(--accent2);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-save:hover { background: var(--accent); }
.btn-ghost {
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.15);
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  font-family: inherit;
}
.btn-ghost:hover { border-color: #ff6b6b; color: #ff6b6b; }
.btn-close {
  margin-left: auto;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.1);
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.btn-close:hover { color: var(--text); }

/* ── Detail modal ────────────────────────────────── */
.detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 250;
  align-items: center;
  justify-content: center;
}
.detail-overlay.open { display: flex; }
.detail-modal {
  background: var(--surface);
  border-radius: 14px;
  padding: 2rem;
  max-width: 500px;
  width: 92%;
  display: flex;
  gap: 1.75rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.detail-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  transition: color .15s;
}
.detail-close:hover { color: var(--text); }
.detail-cover {
  flex-shrink: 0;
  width: 130px;
  height: 195px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface2);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-cover-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 0.75rem; text-align: center;
  font-size: 0.72rem; color: var(--muted); line-height: 1.4;
}
.detail-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.detail-title {
  font-size: 1.1rem; font-weight: 700; line-height: 1.3;
  margin-bottom: 0.25rem; padding-right: 1.5rem;
}
.detail-author { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }
.detail-badge {
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border-radius: 20px;
  background: rgba(192,132,252,0.15);
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  width: fit-content;
}
.detail-stars { font-size: 1.05rem; color: #f5c518; letter-spacing: 1px; margin-bottom: 0.75rem; }
.detail-notes {
  font-size: 0.82rem; color: var(--muted);
  line-height: 1.5; font-style: italic;
  margin-bottom: 1rem; flex: 1;
}
.detail-actions { display: flex; gap: 0.5rem; margin-top: auto; }

/* ── Status picker modal ─────────────────────────── */
.status-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.status-modal-overlay.open { display: flex; }
.status-modal {
  background: var(--surface);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  width: 92%;
  max-width: 320px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  text-align: center;
}
.status-modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; }
.status-modal-book {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-options { display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 1rem; }
.status-opt {
  width: 100%;
  padding: 0.7rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: none;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
}
.status-opt:hover { background: rgba(192,132,252,0.1); border-color: var(--accent); color: var(--accent); }
.status-cancel {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s;
  padding: 0.25rem 0.5rem;
}
.status-cancel:hover { color: var(--text); }

/* ── Book detail panel ───────────────────────────── */
.book-detail-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.72); z-index: 300;
  align-items: center; justify-content: center; padding: 1.5rem;
}
.book-detail-overlay.open { display: flex; }
.book-detail-panel {
  background: var(--surface); border-radius: 14px;
  max-width: 820px; width: 100%; max-height: 90vh;
  overflow-y: auto; position: relative;
  padding: 2rem 2rem 2rem; box-shadow: 0 24px 64px rgba(0,0,0,0.7);
}
.book-detail-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; color: var(--muted);
  font-size: 1.1rem; cursor: pointer; padding: 0.3rem 0.6rem;
  border-radius: 4px; transition: color .15s, background .15s;
}
.book-detail-close:hover { color: var(--text); background: var(--surface2); }

.book-detail-layout { display: flex; gap: 2rem; align-items: flex-start; }

/* Left column */
.book-detail-left { flex-shrink: 0; width: 180px; }
.book-detail-cover-img {
  width: 100%; border-radius: 8px; box-shadow: var(--shadow); display: block;
}
.book-detail-cover-ph {
  width: 100%; aspect-ratio: 2/3; background: var(--surface2);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; color: var(--muted); text-align: center; padding: 0.75rem;
}
.book-detail-meta-list {
  margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem;
}
.book-meta-item { display: flex; flex-direction: column; gap: 0.15rem; }
.book-meta-label {
  font-size: 0.68rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.7px; font-weight: 600;
}
.book-meta-value { font-size: 0.87rem; color: var(--text); }

/* Right column */
.book-detail-right { flex: 1; min-width: 0; padding-top: 0.25rem; }
.book-detail-badge {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--accent);
  background: rgba(192,132,252,0.12); padding: 0.2rem 0.65rem;
  border-radius: 4px; margin-bottom: 0.65rem;
}
.book-detail-title {
  font-size: 1.55rem; font-weight: 800; color: var(--text);
  line-height: 1.2; margin-bottom: 0.35rem;
}
.book-detail-author { font-size: 1rem; color: var(--muted); margin-bottom: 0.6rem; }
.book-detail-stars  { font-size: 1.1rem; color: var(--accent); letter-spacing: 2px; margin-bottom: 1rem; }
.book-detail-subjects {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem;
}
.book-detail-subject {
  font-size: 0.72rem; background: var(--surface2); color: var(--muted);
  padding: 0.2rem 0.55rem; border-radius: 999px;
}
.book-detail-desc {
  font-size: 0.92rem; color: var(--text); line-height: 1.75;
  margin-bottom: 1.25rem; white-space: pre-wrap;
}
.book-detail-desc.loading { color: var(--muted); font-style: italic; }
.book-detail-notes {
  font-size: 0.88rem; color: var(--muted); font-style: italic;
  margin-bottom: 1.25rem; padding: 0.75rem 1rem;
  background: var(--surface2); border-radius: var(--radius);
  border-left: 2px solid var(--accent);
}
.book-detail-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.25rem; }

/* ══ Reading Tracker — removable feature ════════════════════
   To remove: delete this CSS block, the #reading-tracker-section
   and #reading-journal-section HTML in shelf.html, and the
   tracker logic in shared.js / app.js marked with the same tag.
   ══════════════════════════════════════════════════════════ */
.book-detail-progress { margin-bottom: 1rem; }
.bdp-text { font-size: 0.83rem; color: var(--muted); display: block; margin-bottom: 0.35rem; }
.bdp-bar-wrap { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.bdp-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }

#reading-tracker-section { margin-bottom: 0.9rem; }
.tracker-progress-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
#tracker-current-page {
  width: 72px; padding: 0.3rem 0.5rem; border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15); background: var(--surface2);
  color: var(--text); font-size: 0.88rem; text-align: center; font-family: inherit;
}
#tracker-current-page:focus { outline: none; border-color: var(--accent); }
.tracker-total-label { font-size: 0.82rem; color: var(--muted); }
.tracker-bar-wrap { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; margin-bottom: 0.1rem; }
.tracker-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }

#reading-journal-section { margin-bottom: 0.5rem; }
.tracker-entry-btn {
  font-size: 0.78rem; color: var(--accent); background: none; font-family: inherit;
  border: 1px dashed rgba(192,132,252,0.4); border-radius: 4px;
  padding: 0.28rem 0.75rem; cursor: pointer; transition: all .15s; margin-bottom: 0.5rem;
}
.tracker-entry-btn:hover { background: rgba(192,132,252,0.1); border-style: solid; }
.tracker-compose textarea {
  width: 100%; padding: 0.5rem 0.6rem; border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12); background: var(--bg);
  color: var(--text); font-size: 0.88rem; resize: vertical;
  font-family: inherit; box-sizing: border-box; margin-bottom: 0.4rem;
}
.tracker-compose textarea:focus { outline: none; border-color: var(--accent); }
.tracker-compose-actions { display: flex; gap: 0.5rem; }

/* Card hover progress overlay */
.book-card-progress-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 1.5rem 0.5rem 0.4rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.82));
  opacity: 0; transform: translateY(4px);
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.book-card:hover .book-card-progress-overlay { opacity: 1; transform: translateY(0); }
.bcp-label {
  display: block; text-align: center; margin-bottom: 0.3rem;
  font-size: 0.67rem; color: rgba(255,255,255,0.88); font-weight: 500;
}
.bcp-bar  { height: 3px; background: rgba(255,255,255,0.2); border-radius: 2px; overflow: hidden; }
.bcp-fill { height: 100%; background: var(--accent); border-radius: 2px; }
/* ══ End Reading Tracker ══════════════════════════════════ */

/* ── Toast notifications ─────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface2);
  color: var(--text);
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  border-left: 3px solid var(--accent);
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.error  { border-left-color: #e05252; }
.toast.success { border-left-color: #52c97f; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── On-shelf indicators ─────────────────────────── */
.shelf-check-badge {
  position: absolute; top: 7px; right: 7px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%;
  background: #52c97f; color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  pointer-events: none;
}

.on-shelf-label {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1rem; border-radius: var(--radius);
  background: rgba(82,201,127,0.12); color: #52c97f;
  font-size: 0.9rem; font-weight: 600;
}
