/* ============================================================
   TBR Pile — Editorial / Bookshop Aesthetic
   Playfair Display (headings) + EB Garamond (body)
   Warm neutrals · Deep green · Burgundy · Antique gold
   ============================================================ */

/* ---- RESET ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- CSS VARIABLES ---------------------------------------- */
:root {
  /* Backgrounds */
  --bg:              #f4ede0;
  --surface:         #fdf8f0;
  --surface-alt:     #ede5d5;

  /* Text */
  --text:            #281d0f;
  --text-mid:        #5c4830;
  --text-muted:      #8a7055;

  /* Accents */
  --green:           #2c4e1a;
  --green-mid:       #3e6a24;
  --green-light:     #e5eedd;
  --burgundy:        #7a1e30;
  --burgundy-mid:    #9c2a40;
  --burgundy-light:  #f5e6e9;
  --gold:            #b5882a;
  --gold-light:      #f6edcc;

  /* Structure */
  --border:          #d0bfa5;
  --border-light:    #e4d8c6;
  --radius:          6px;
  --radius-sm:       4px;

  --shadow:          0 1px 3px rgba(40, 29, 15, 0.06), 0 2px 8px rgba(40, 29, 15, 0.04);
  --shadow-lg:       0 4px 20px rgba(40, 29, 15, 0.12);
  --shadow-card:     0 1px 4px rgba(40, 29, 15, 0.06);

  --font-serif:      'Playfair Display', Georgia, serif;
  --font-body:       'EB Garamond', Georgia, serif;
  --font-ui:         -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- BASE ------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  background: #cfc5b0;
  color: var(--text);
  min-height: 100vh;
}

#app {
  max-width: 1280px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  box-shadow: 0 0 80px rgba(40, 29, 15, 0.22);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
}

button { cursor: pointer; font-family: var(--font-body); font-size: inherit; border: none; background: none; }
img    { display: block; max-width: 100%; }

/* ---- HEADER ---------------------------------------------- */
/* ---- HEADER ---------------------------------------------- */
.app-header {
  background: var(--green);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.24);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
}

.header-brand {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  padding: 18px 0 15px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.user-menu {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 28px 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.app-nav {
  grid-column: 1 / -1;
  grid-row: 2;
}

.header-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 700;
  font-style: normal;
  color: #f5ede0;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  line-height: 1;
}

/* ---- MAIN CONTENT AREA ----------------------------------- */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 28px 64px;
}

/* ---- DASHBOARD LAYOUT ------------------------------------ */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: start;
}

.col-tbr { /* left column — picker + book grid */ }

.col-right {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---- PICKER SECTION (top of left column) ----------------- */
.picker-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.picker-section > h2 {
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-mid);
  margin-bottom: 18px;
}

.picker-filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.filter-group > label,
.filter-group > .filter-group-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

/* ---- MOOD CHIPS ------------------------------------------ */
.mood-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  padding: 5px 13px;
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--surface-alt);
  color: var(--text-mid);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.chip:hover  { border-color: var(--burgundy); color: var(--burgundy); background: var(--burgundy-light); }
.chip.active { background: var(--burgundy-light); border-color: var(--burgundy); color: var(--burgundy); font-weight: 500; }

/* ---- GENRE SELECT ---------------------------------------- */
select {
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  min-width: 200px;
  transition: border-color 0.15s;
}
select:hover, select:focus { border-color: var(--green); outline: none; }

/* ---- BUTTONS --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.95); }
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary   { background: var(--green); color: #f5ede0; }
.btn-primary:hover {
  background: var(--green-mid);
  box-shadow: 0 3px 10px rgba(44, 78, 26, 0.3);
}

.btn-secondary { background: var(--burgundy-light); color: var(--burgundy); border: 1px solid var(--burgundy); }
.btn-secondary:hover { background: var(--burgundy); color: #fdf8f0; }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--text-mid); color: var(--text); }

.btn-add { background: var(--gold-light); color: var(--gold); border: 1px solid var(--gold); padding: 7px 16px; }
.btn-add:hover { background: var(--gold); color: #fdf8f0; }

.btn-sm { padding: 5px 12px; font-size: 0.82rem; }

.picker-buttons { display: flex; flex-direction: column; gap: 12px; align-items: center; }

.picker-buttons .btn {
  padding: 13px 28px;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  width: 100%;
  max-width: 280px;
}

.picker-explanation {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

/* ---- LIST HEADER (shared) -------------------------------- */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.list-header > h2 {
  font-size: 1.15rem;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--green-light);
  color: var(--green-mid);
  border-radius: 3px;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
}

/* ---- BOOK GRID (TBR left column) ------------------------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

/* ---- BOOK CARD ------------------------------------------- */
.book-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
  box-shadow: var(--shadow-card);
}
.book-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.book-cover {
  position: relative;
  height: 240px;
  background: var(--surface-alt);
  overflow: hidden;
  flex-shrink: 0;
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  filter: contrast(1.06) saturate(1.1);
}

.book-info {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.book-title {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.book-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.tag {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
}
.tag-length { background: var(--green-light);    color: var(--green-mid); }
.tag-mood   { background: var(--burgundy-light); color: var(--burgundy-mid); }

.book-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 10px;
}

/* ---- COVER PLACEHOLDER ----------------------------------- */
.cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--surface-alt), var(--burgundy-light));
  color: var(--burgundy);
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
}

.book-cover          .cover-placeholder { width: 100%; height: 100%; font-size: 3.2rem; }
.simple-book-cover   .cover-placeholder { width: 44px; height: 60px; font-size: 1.3rem; border-radius: 3px; flex-shrink: 0; }
.result-cover        .cover-placeholder { width: 38px; height: 52px; font-size: 0.95rem; border-radius: 3px; flex-shrink: 0; }
.confirm-cover       .cover-placeholder { width: 90px; height: 130px; font-size: 2.5rem; border-radius: var(--radius-sm); }
.pick-cover          .cover-placeholder { width: 130px; height: 190px; font-size: 3.5rem; border-radius: var(--radius); }

/* ---- EMPTY STATE ----------------------------------------- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-style: italic;
}
.empty-state p { margin-bottom: 8px; }

.empty-state-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 16px 0;
}

.sort-select {
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* ---- SECTION PANELS (book-list-section + right column) --- */
.book-list-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

/* ---- SIMPLE LIST (Reading & Finished, right column) ------ */
.simple-list-view {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.simple-list { display: flex; flex-direction: column; gap: 8px; }

.simple-book-row {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 11px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.18s, border-left-color 0.18s, padding-left 0.18s;
}
.simple-book-row:hover {
  box-shadow: var(--shadow);
  border-left: 3px solid var(--green);
  padding-left: 11px;
}

.simple-book-cover { width: 44px; flex-shrink: 0; }
.simple-book-cover img {
  width: 44px;
  height: 60px;
  object-fit: cover;
  border-radius: 3px;
  image-rendering: -webkit-optimize-contrast;
  filter: contrast(1.06) saturate(1.1);
}

.simple-book-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.simple-book-info strong {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.simple-book-info > span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.simple-book-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---- RIGHT COLUMN: Reading vs Finished accent colours ---- */
.col-reading .list-header h2  { color: var(--green); }
.col-reading .count           { background: var(--green-light); color: var(--green-mid); }

.col-finished .list-header h2 { color: var(--burgundy); }
.col-finished .count          { background: var(--burgundy-light); color: var(--burgundy-mid); }

/* ---- MODAL ----------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 4, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-inner {
  padding: 32px;
  position: relative;
}
.modal-inner > h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--border); color: var(--text); }

/* ---- SEARCH FORM ----------------------------------------- */
.search-form { display: flex; gap: 8px; margin-bottom: 18px; }

.search-form input {
  flex: 1;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.15s;
}
.search-form input:focus { outline: none; border-color: var(--green); }

/* ---- SEARCH RESULTS -------------------------------------- */
.search-result-list { display: flex; flex-direction: column; gap: 6px; }

.search-result-item {
  display: flex;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.15s;
  align-items: flex-start;
}
.search-result-item:hover { border-color: var(--green); background: var(--green-light); }

.result-cover img {
  width: 38px;
  height: 52px;
  object-fit: cover;
  border-radius: 3px;
  image-rendering: -webkit-optimize-contrast;
  filter: contrast(1.06) saturate(1.1);
}

.result-info { display: flex; flex-direction: column; gap: 2px; }
.result-info strong { font-family: var(--font-serif); font-size: 0.92rem; }
.result-info span   { font-size: 0.8rem; color: var(--text-muted); }
.result-description { font-size: 0.76rem !important; line-height: 1.45; margin-top: 3px; font-style: italic; }

/* ---- CONFIRM MODAL --------------------------------------- */
.book-confirm {
  display: flex;
  gap: 18px;
  margin-bottom: 22px;
  align-items: flex-start;
}

.confirm-cover img {
  width: 90px;
  height: 130px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  box-shadow: var(--shadow);
  image-rendering: -webkit-optimize-contrast;
  filter: contrast(1.06) saturate(1.1);
}

.confirm-details { display: flex; flex-direction: column; gap: 4px; }
.confirm-details h3  { font-family: var(--font-serif); font-size: 1.05rem; }
.confirm-details p   { font-size: 0.85rem; color: var(--text-muted); }

.book-description {
  color: var(--text) !important;
  line-height: 1.55;
  margin-top: 5px !important;
  font-size: 0.85rem !important;
}

.mood-selector { margin-bottom: 22px; }
.mood-selector > label,
.mood-selector > .mood-selector-label {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 10px;
  color: var(--text-mid);
}

.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---- PICK RESULT MODAL ----------------------------------- */
.pick-result { text-align: center; }

.pick-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--burgundy);
  margin-bottom: 18px;
}

.pick-book { margin-bottom: 26px; }

.pick-cover {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.pick-cover img {
  width: 130px;
  height: 190px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  image-rendering: -webkit-optimize-contrast;
  filter: contrast(1.06) saturate(1.1);
}

.pick-book h2     { font-size: 1.45rem; margin-bottom: 5px; }
.pick-author      { color: var(--text-muted); font-size: 0.95rem; font-style: italic; margin-bottom: 14px; }
.pick-description {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto;
  font-style: italic;
}

.pick-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---- UTILITY --------------------------------------------- */
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.loading    { text-align: center; color: var(--text-muted); padding: 24px; font-style: italic; }
.error      { color: #8a1020; font-size: 0.9rem; text-align: center; padding: 16px; }
.empty      { text-align: center; color: var(--text-muted); padding: 24px; font-style: italic; }

/* ---- SECTION SEARCH -------------------------------------- */
.section-search-wrap {
  margin-bottom: 16px;
  position: relative;
}

.section-search {
  width: 100%;
  padding: 8px 36px 8px 34px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a7055' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E")
    no-repeat 10px center;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.section-search::placeholder       { color: var(--text-muted); font-style: italic; }
.section-search:focus               { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.section-search::-webkit-search-cancel-button { display: none; }

.section-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-search-clear::before {
  content: '×';
}

.section-search-clear:hover {
  color: var(--burgundy);
}

.section-search-clear:active {
  color: var(--burgundy-mid);
}

.filter-empty {
  padding: 20px 0 4px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ---- HEADER NAV ------------------------------------------ */
.app-nav { display: flex; gap: 0; padding: 0 20px; }

.nav-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 0;
  color: rgba(245, 237, 224, 0.58);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-bottom-color 0.15s;
  letter-spacing: 0.01em;
}
.nav-btn:hover  { color: #f5ede0; background: rgba(255,255,255,0.08); border-bottom-color: rgba(245,237,224,0.22); }
.nav-btn.active { color: #f5ede0; font-weight: 600; background: none; border-bottom-color: var(--gold); }

/* ---- BESTSELLERS VIEW ------------------------------------ */
.bestsellers-view { max-width: 820px; margin: 0 auto; }

.bestsellers-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.bestsellers-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.bestsellers-heading {
  font-family: var(--font-serif);
  font-size: 1.5rem;
}

.bestsellers-subhead {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.nyt-list-select {
  min-width: 220px;
  font-size: 0.9rem;
}

/* ---- NYT BOOK CARDS -------------------------------------- */
.nyt-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}

.nyt-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.18s, border-left-color 0.18s;
}
.nyt-card:hover {
  box-shadow: var(--shadow);
  border-left: 3px solid var(--burgundy);
  padding-left: 15px;
}
.nyt-card--shimmer { pointer-events: none; }

.nyt-rank {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--border);
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
  padding-top: 6px;
  line-height: 1;
}

.nyt-cover {
  position: relative;
  width: 72px;
  height: 108px;
  flex-shrink: 0;
  background: var(--surface-alt);
  border-radius: 3px;
  overflow: hidden;
}
.nyt-cover img {
  width: 72px;
  height: 108px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: var(--shadow-card);
  filter: contrast(1.06) saturate(1.1);
}
.nyt-cover .cover-placeholder { width: 100%; height: 100%; font-size: 1.6rem; }

.nyt-shimmer-cover {
  width: 72px;
  height: 108px;
  border-radius: 3px;
  flex-shrink: 0;
}

.nyt-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.nyt-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.nyt-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.nyt-desc {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.55;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nyt-actions { margin-top: 8px; }

.in-library {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green-mid);
  letter-spacing: 0.02em;
}

/* ---- THE TIMES UK SECTION -------------------------------- */
.times-uk-section {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  margin-top: 8px;
  margin-bottom: 40px;
}

.times-uk-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
}

.times-uk-text h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  margin-bottom: 4px;
}
.times-uk-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  max-width: 480px;
  line-height: 1.5;
}

/* ---- RESPONSIVE (desktop resize) ------------------------- */
@media (max-width: 960px) {
  .dashboard { grid-template-columns: 1fr; }
}

/* ============================================================
   ANIMATIONS & MICRO-INTERACTIONS
   ============================================================ */

/* Modal entrance */
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.93) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-box { animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Pick result — staggered cover flip + text fade */
@keyframes coverFlip {
  from { opacity: 0; transform: perspective(600px) rotateY(-25deg) scale(0.86); }
  to   { opacity: 1; transform: perspective(600px) rotateY(0deg) scale(1); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pick-result .pick-cover           { animation: coverFlip 0.48s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both; }
.pick-result .pick-book h2         { animation: fadeUp 0.32s ease 0.36s both; }
.pick-result .pick-author          { animation: fadeUp 0.32s ease 0.44s both; }
.pick-result .pick-description     { animation: fadeUp 0.32s ease 0.50s both; }
.pick-result .pick-actions         { animation: fadeUp 0.32s ease 0.56s both; }

/* New book card entering */
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.book-card--entering {
  animation: cardEnter 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ---- SHIMMER (search loading) ---------------------------- */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.shimmer-bg {
  background: linear-gradient(
    90deg,
    var(--surface-alt) 25%,
    var(--surface)     50%,
    var(--surface-alt) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 3px;
}
.shimmer-list { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.shimmer-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  align-items: center;
}
.shimmer-cover-box { width: 38px; height: 52px; flex-shrink: 0; }
.shimmer-info { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.shimmer-line { height: 11px; }
.shimmer-line-long   { width: 75%; }
.shimmer-line-medium { width: 50%; }
.shimmer-line-short  { width: 35%; }

/* ---- TOAST NOTIFICATION ---------------------------------- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(18px);
  background: var(--green);
  color: #f5ede0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  padding: 12px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3000;
  pointer-events: none;
  white-space: nowrap;
}
.toast.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- DATE STAMP ------------------------------------------ */
.book-date {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-top: 1px;
}

/* ---- NOTES COMPONENT ------------------------------------- */
.book-note-wrap { margin-top: 6px; }

.add-note-btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}
.add-note-btn:hover { color: var(--green); }

.book-note-text {
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 3px;
}

.note-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text);
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.15s;
  min-height: 54px;
}
.note-input:focus { outline: none; border-color: var(--green); }

.note-controls { display: flex; gap: 6px; margin-top: 5px; }

.btn-note-save, .btn-note-cancel {
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-note-save          { background: var(--green); color: #f5ede0; border: none; }
.btn-note-save:hover    { background: var(--green-mid); }
.btn-note-cancel        { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-note-cancel:hover  { border-color: var(--text-mid); color: var(--text); }

/* ---- CONFIRM MODAL NOTE ---------------------------------- */
.confirm-note-wrap { margin-bottom: 20px; }
.confirm-note-wrap label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-mid);
  margin-bottom: 6px;
}

/* ---- STAR RATING ----------------------------------------- */
.star-rating { display: flex; gap: 3px; margin-top: 7px; }

.star {
  font-size: 1.15rem;
  color: var(--border);
  cursor: pointer;
  line-height: 1;
  user-select: none;
  transition: color 0.1s, transform 0.1s;
}
.star--filled   { color: var(--gold); }
.star--hovering { color: var(--gold); transform: scale(1.18); }

/* ============================================================
   LANDING PAGE
   ============================================================ */

/* Dark body background on wide screens when on landing */
body.body--landing { background: #0e1a0b; }

/* Hide the app chrome; reset main-content padding */
.app--landing              { background: #0e1a0b; }
.app--landing .app-header  { display: none; }
.app--landing .app-main    { max-width: none; padding: 0; margin: 0; }

/* Make the header brand feel clickable on dashboard/bestsellers */
.header-brand { cursor: pointer; }
.header-brand:hover .header-title { opacity: 0.78; transition: opacity 0.15s; }

/* ---- LANDING SHELL --------------------------------------- */
.landing-page {
  min-height: 100vh;
  background: linear-gradient(155deg, #0e1a0b 0%, #0b1409 55%, #130f08 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 64px;
  position: relative;
  overflow: hidden;
}

/* Subtle radial vignette darkens the edges */
.landing-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 50%, transparent 15%, rgba(0,0,0,0.48) 100%);
  pointer-events: none;
}

.landing-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---- COVER STACK ----------------------------------------- */
.landing-covers {
  position: relative;
  width: 340px;
  height: 250px;
  margin-bottom: 48px;
  flex-shrink: 0;
  transition: opacity 0.65s ease;
}
.landing-covers--fading { opacity: 0; pointer-events: none; }

.landing-covers-empty { height: 16px; margin-bottom: 32px; }

.landing-cover-item {
  position: absolute;
  width: 140px;
  height: 200px;
  top: 25px;
  left: calc(50% - 70px);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 16px 50px rgba(0,0,0,0.78), 0 4px 14px rgba(0,0,0,0.5);
}
.landing-cover-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.04) saturate(1.06) brightness(0.96);
}
.landing-cover-item .cover-placeholder {
  width: 100%;
  height: 100%;
  font-size: 2.8rem;
  border-radius: 0;
}

.landing-cover-item--0 { transform: rotate(-8deg)  translate(-72px,  18px); z-index: 1; }
.landing-cover-item--1 { transform: rotate(-1deg)  translate(  0px,  -8px); z-index: 2; }
.landing-cover-item--2 { transform: rotate( 7deg)  translate( 72px,  22px); z-index: 3; }

/* ---- LANDING TYPOGRAPHY ---------------------------------- */
.landing-title {
  font-family: var(--font-serif);
  font-size: 3.8rem;
  font-weight: 700;
  font-style: normal;
  color: #f5ede0;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  line-height: 1;
  text-shadow: 0 2px 28px rgba(0,0,0,0.55);
  margin-bottom: 0;
}

.landing-rule {
  width: 44px;
  height: 1px;
  background: var(--gold);
  opacity: 0.65;
  margin: 18px auto 16px;
}

.landing-tagline {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  font-style: italic;
  color: rgba(245, 237, 224, 0.58);
  letter-spacing: 0.03em;
  margin-bottom: 42px;
}

/* ---- LANDING BUTTONS ------------------------------------- */
.landing-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-btn {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 13px 34px;
  border-radius: 1px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.landing-btn:active { transform: scale(0.97); }

/* Primary: cream fill, dark text; inverts on hover */
.landing-btn-solid {
  background: #f0e6d3;
  color: #0e1a0b;
  border: 1px solid #f0e6d3;
}
.landing-btn-solid:hover {
  background: transparent;
  color: #f0e6d3;
}

/* Secondary: gold outline */
.landing-btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.landing-btn-outline:hover {
  background: var(--gold);
  color: #0e1a0b;
}

/* ---- RESPONSIVE ------------------------------------------ */
@media (max-width: 480px) {
  .landing-title { font-size: 2.8rem; letter-spacing: 0.2em; }
  .landing-covers { width: 280px; }
  .landing-cover-item--0 { transform: rotate(-8deg) translate(-54px, 18px); }
  .landing-cover-item--2 { transform: rotate( 7deg) translate( 54px, 22px); }
  .landing-actions { flex-direction: column; align-items: center; }
  .landing-btn { width: 220px; text-align: center; }
}

/* Third landing button — burgundy outline */
.landing-btn-outline2 {
  background: transparent;
  color: var(--burgundy-light);
  border: 1px solid rgba(245, 230, 233, 0.5);
}
.landing-btn-outline2:hover {
  background: rgba(122, 30, 48, 0.6);
  color: #fdf8f0;
  border-color: var(--burgundy-mid);
}

/* ============================================================
   ADAPTATIONS VIEW
   ============================================================ */
.adaptations-view { max-width: 980px; margin: 0 auto; }

.adaptations-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.adaptations-heading {
  font-family: var(--font-serif);
  font-size: 1.5rem;
}

.adaptations-updated {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ---- FILTER BUTTONS -------------------------------------- */
.adaptations-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 7px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover  { border-color: var(--text-mid); color: var(--text); }
.filter-btn.active { background: var(--green); color: #f5ede0; border-color: var(--green); }

/* ---- CARD GRID ------------------------------------------- */
.adaptations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- ADAPTATION CARD ------------------------------------- */
.adaptation-card {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.18s, border-left-color 0.18s, padding-left 0.18s;
  align-items: flex-start;
}
.adaptation-card:hover {
  box-shadow: var(--shadow);
  border-left: 3px solid var(--burgundy);
  padding-left: 13px;
}

/* Poster */
.adaptation-poster {
  width: 110px;
  height: 162px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface-alt);
  position: relative;
}
.adaptation-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.04) saturate(1.06);
}
.adaptation-poster .cover-placeholder {
  width: 100%;
  height: 100%;
  font-size: 2.4rem;
  border-radius: 0;
}

/* Info column */
.adaptation-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.adaptation-badges {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 2px;
}

.adaptation-type {
  font-family: var(--font-ui);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  white-space: nowrap;
}
.adaptation-type--film { background: var(--green-light);    color: var(--green-mid); }
.adaptation-type--tv   { background: var(--burgundy-light); color: var(--burgundy-mid); }

.adaptation-streamer {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adaptation-title {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin: 1px 0;
}

.adaptation-book {
  font-size: 0.82rem;
  color: var(--text-mid);
}
.adaptation-book em { font-style: italic; }

.adaptation-date {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.adaptation-desc {
  font-size: 0.84rem;
  color: var(--text-mid);
  line-height: 1.55;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.adaptation-actions { margin-top: auto; padding-top: 8px; }

/* ---- RESPONSIVE ------------------------------------------ */
@media (max-width: 820px) {
  .adaptations-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   READING GOAL WIDGET
   ============================================================ */

.reading-goal-wrap { margin-bottom: 24px; }

.reading-goal {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 22px;
  box-shadow: var(--shadow-card);
}

.reading-goal--unset {
  text-align: center;
  padding: 14px 22px;
}

.goal-set-link {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.goal-set-link:hover { color: var(--green); }

.goal-text-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.goal-label {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-mid);
}
.goal-label strong {
  font-weight: 600;
  color: var(--text);
}

.goal-edit-btn {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 0;
  flex-shrink: 0;
  transition: color 0.15s;
}
.goal-edit-btn:hover { color: var(--green); }

.goal-bar-track {
  height: 5px;
  background: var(--surface-alt);
  border-radius: 3px;
  margin-top: 11px;
  overflow: hidden;
}

.goal-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 2px;
}

.reading-goal--editing { padding: 14px 22px; }

.goal-edit-form { display: flex; flex-direction: column; gap: 8px; }

.goal-edit-label {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-mid);
}

.goal-edit-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.goal-input {
  width: 90px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color 0.15s;
}
.goal-input:focus { outline: none; border-color: var(--green); }

/* ============================================================
   STATS VIEW
   ============================================================ */

.stats-view,
.playlist-detail-view {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 700px) {
  .playlist-detail-view {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.members-panel {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e0d8);
  border-radius: 10px;
  padding: 20px;
}

.members-heading {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 16px;
}

.member-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border, #e5e0d8);
}

.member-row:last-child { border-bottom: none; }

.member-name {
  flex: 1;
  font-size: 0.875rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role-label {
  font-size: 0.82rem;
  color: var(--color-text-muted, #888);
}

.member-role-select {
  font-size: 0.75rem;
  padding: 2px 6px;
  height: auto;
  width: auto;
}

.member-empty {
  font-size: 0.875rem;
  color: var(--color-text-muted, #888);
  margin: 0;
}

.playlists-view {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.shelves-col,
.shelves-right-col { min-width: 0; }

.discover-view {
  max-width: 980px;
  margin: 0 auto;
}

.corner-view {
  max-width: 680px;
  margin: 0 auto;
}

.corner-section {
  margin-bottom: 40px;
}

.corner-section-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.corner-reading-wrap .list-header { display: none; }

.corner-placeholder-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  padding: 12px 0;
}

.corner-footer {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.discover-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tag-curated    { background: var(--gold-light);      color: var(--gold); }
.tag-adaptation { background: var(--burgundy-light);  color: var(--burgundy-mid); }

@media (max-width: 700px) {
  .playlists-view {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.stats-heading {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.stats-subhead {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* Each stat card */
.stats-section {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

/* Goal widget inside stats section — strip double chrome */
.stats-section--goal { padding: 0; background: transparent; border: none; box-shadow: none; }
.stats-section--goal .reading-goal-wrap { margin-bottom: 0; }

.stats-section-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text-mid);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.stats-big-number {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.stats-of {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-muted);
}

.stats-star { font-size: 2.2rem; color: var(--gold); }

.stats-big-text {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.stats-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.stats-empty {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Library overview & longest/shortest lists */
.stats-list { display: flex; flex-direction: column; }

.stats-list-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.92rem;
}
.stats-list-row:last-child { border-bottom: none; padding-bottom: 0; }
.stats-list-row dt { color: var(--text-mid); }
.stats-list-row dd { color: var(--text); font-weight: 500; text-align: right; }

.stats-list-row--total {
  margin-top: 4px;
  padding-top: 13px;
  border-top: 2px solid var(--border);
  border-bottom: none;
}
.stats-list-row--total dt { font-weight: 600; color: var(--text); }
.stats-list-row--total dd { font-weight: 700; color: var(--green); }

/* Monthly breakdown */
.stats-months { display: flex; flex-direction: column; }

.stats-month-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}
.stats-month-row:last-child { border-bottom: none; padding-bottom: 0; }

.stats-month-name  { color: var(--text-muted); font-style: italic; }
.stats-month-count { color: var(--text-muted); }
.stats-month-zero  { color: var(--border); }

.stats-month-row--active .stats-month-name  { color: var(--text); font-style: normal; font-weight: 500; }
.stats-month-row--active .stats-month-count { color: var(--green-mid); font-weight: 600; }

.stats-pages {
  font-size: 0.82em;
  color: var(--text-muted);
}

.stats-year-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

/* ============================================================
   PAST READ MODAL FORM
   ============================================================ */

.modal-subhead {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: -14px;
  margin-bottom: 20px;
}

.past-read-warning {
  background: #fef3cd;
  border: 1px solid #e8c84a;
  border-radius: var(--radius-sm);
  color: #7a5a00;
  font-size: 0.85rem;
  padding: 8px 13px;
  margin-bottom: 16px;
}


/* ============================================================
   AUTH SCREEN
   ============================================================ */

.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.auth-logo {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--burgundy);
  margin-bottom: 4px;
}

.auth-sub {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 32px;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.auth-tab:hover { color: var(--text); }

.auth-tab--active {
  color: var(--burgundy);
  border-bottom-color: var(--burgundy);
}

.auth-field {
  text-align: left;
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}

.auth-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.15s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--green);
}

.auth-message {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  text-align: left;
}

.auth-message--error {
  background: var(--burgundy-light);
  color: var(--burgundy);
  border: 1px solid rgba(122, 30, 48, 0.2);
}

.auth-message--success {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(44, 78, 26, 0.2);
}

.auth-btn {
  width: 100%;
  margin-top: 4px;
  margin-bottom: 12px;
  padding: 11px;
  font-size: 1rem;
}

.auth-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.auth-link:hover { color: var(--text); }

.auth-note {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* User menu in the header */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name-btn {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: rgba(245, 237, 224, 0.82);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.user-name-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f5ede0;
}

#sign-out-btn {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: #F5F0E8;
  color: #3a3a3a;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, transform 0.1s;
}
#sign-out-btn:hover  { background: #a93226; }
#sign-out-btn:active { transform: scale(0.97); }

.past-read-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 20px 0 24px;
}

.past-read-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.past-read-label {
  font-size: 0.88rem;
  color: var(--text-mid);
  font-weight: 500;
}

.past-read-date-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.past-read-select {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  cursor: pointer;
  min-width: 0;
  transition: border-color 0.15s;
}
.past-read-select:hover,
.past-read-select:focus { border-color: var(--green); outline: none; }

.past-read-same-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  font-style: italic;
}
.past-read-same-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--green);
}

/* The star rating inside the modal doesn't need extra sizing — inherits .star-rating */
.past-read-stars { margin-top: 2px; }

/* Fourth landing button — soft warm outline */
.landing-btn-outline3 {
  background: transparent;
  color: rgba(245, 237, 224, 0.48);
  border: 1px solid rgba(245, 237, 224, 0.22);
}
.landing-btn-outline3:hover {
  background: rgba(245, 237, 224, 0.1);
  color: rgba(245, 237, 224, 0.8);
  border-color: rgba(245, 237, 224, 0.38);
}

/* ---- SHARE CARD ------------------------------------------- */

/* Icon button on each book row */
.share-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.share-card-btn:hover {
  background: var(--surface-alt);
  color: var(--green);
  border-color: var(--green);
}

/* Modal sizing — wider than default to show the canvas preview */
.share-modal {
  max-width: 520px;
  width: 95vw;
}

/* Format switcher row */
.share-format-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.share-format-row span {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  margin-right: 4px;
}
.share-fmt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-mid);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.2;
}
.share-fmt-btn:hover {
  border-color: var(--green);
  color: var(--green);
}
.share-fmt-btn--active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.share-fmt-btn--active .share-fmt-sub {
  color: rgba(255,255,255,0.65);
}
.share-fmt-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-weight: 400;
}

/* Canvas preview area */
.share-canvas-outer {
  background: #1a1612;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  min-height: 120px;
}
.share-canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}
#share-canvas {
  display: block;
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

/* Cover unavailable note */
.share-cover-note {
  text-align: center;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: -4px;
  margin-bottom: 8px;
}

/* Download button row */
.share-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-top: 4px;
}

/* ---- DATA & BACKUP ---------------------------------------- */
.stats-section--backup {
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.stats-section-desc {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 16px;
}

.data-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.backup-meta {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Import confirmation modal */
.import-warning {
  background: var(--burgundy-light);
  border: 1px solid rgba(122, 30, 48, 0.2);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 16px 0 20px;
}

.import-warning-detail {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.5;
}

.import-warning-caution {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--burgundy);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.btn-danger {
  background: var(--burgundy);
  color: #fff;
  border-color: var(--burgundy);
}

.btn-danger:hover {
  background: var(--burgundy-mid);
  border-color: var(--burgundy-mid);
}

/* ---- READING YEAR CARD MODAL ------------------------------ */
.yc-modal {
  max-width: 560px;
}

.yc-section-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-top: 16px;
}

.yc-type-row .share-fmt-btn {
  font-size: 0.8rem;
  padding: 6px 12px;
  flex: 1;
}

.yc-period-inputs {
  margin-bottom: 4px;
}

.yc-inputs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 4px;
}

.yc-range-row {
  gap: 16px;
}

.yc-range-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.yc-range-sep {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text-muted);
  padding-top: 2px;
}

.yc-label {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-mid);
  white-space: nowrap;
}

.yc-select {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  cursor: pointer;
  appearance: auto;
}

/* ---- FINISH BOOK MODAL ---------------------------------- */
.finish-book-modal {
  max-width: 480px;
}

.finish-book-header {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.4;
}

.finish-book-header em {
  font-style: italic;
  color: var(--burgundy);
  font-weight: 700;
}

.finish-book-cover {
  margin: 20px auto 16px;
  width: 120px;
  height: 180px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(40,29,15,0.15);
}

.finish-book-cover img,
.finish-book-cover .cover-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.finish-book-title {
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-mid);
  margin-bottom: 24px;
  line-height: 1.4;
}

.finish-book-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--surface-alt);
}

.finish-book-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finish-book-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-mid);
}

.fb-stars {
  display: flex;
  gap: 8px;
  font-size: 1.8rem;
}

.fb-stars .star {
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}

.fb-stars .star:hover {
  transform: scale(1.15);
}

.fb-stars .star--filled {
  color: var(--gold);
}

.fb-stars .star--hovering {
  color: var(--gold);
}

.fb-stars .star:not(.star--filled):not(.star--hovering) {
  color: rgba(40,29,15,0.15);
}

/* ---- SETTINGS MODAL -------------------------------------- */
.settings-modal h2 {
  margin-bottom: 0;
  padding-bottom: 16px;
}

.settings-section {
  padding: 22px 0;
  border-top: 1px solid var(--border-light);
}

.settings-section-title {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-mid);
  margin-bottom: 14px;
}

.settings-section-title--danger {
  color: var(--burgundy);
}

.settings-section--danger {
  border-top: 1px solid var(--burgundy-light);
}

.settings-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.settings-label {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-mid);
}

.settings-input {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.15s;
}
.settings-input:focus {
  outline: none;
  border-color: var(--green);
}

.settings-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.settings-status {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}
.settings-status--ok {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(44, 78, 26, 0.2);
}
.settings-status--err {
  background: var(--burgundy-light);
  color: var(--burgundy);
  border: 1px solid rgba(122, 30, 48, 0.2);
}

.settings-current-value {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.settings-placeholder {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.settings-danger-desc {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-bottom: 4px;
}

.settings-danger-confirm-text {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--burgundy);
  font-weight: 600;
  margin-bottom: 4px;
}

.recovery-modal {
  max-width: 400px;
}

.recovery-modal h2 {
  margin-bottom: 4px;
  padding-bottom: 12px;
}

.recovery-subtitle {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-bottom: 18px;
}

/* ──────────────────────────── Shelf invite UI ──────────────────────────── */
.shelf-invite-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.shelf-invite-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shelf-invite-name {
  flex: 1;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text);
}
.shelf-invite-role {
  width: auto;
  flex-shrink: 0;
}
.shelf-invite-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ──────────────────────────── Footer ──────────────────────────── */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 20px;
  background: var(--bg);
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  z-index: 99;
}

.footer-link {
  color: var(--green);
  text-decoration: none;
  transition: opacity 0.15s;
}

.footer-link:hover {
  opacity: 0.7;
}

/* Add bottom padding to main content to account for fixed footer */
.app-main {
  padding-bottom: 60px;
}

/* ── Playlist cards ──────────────────────────────────────────────────────── */

.playlist-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.playlist-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.playlist-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Horizontal content body shared by personal and curated cards */
.shelf-card-body,
.curated-card-body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}

/* ── Personal shelf card — coloured band + 2×2 cover grid ───────────────── */

.shelf-card-band {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shelf-band-0 { background: var(--burgundy); }
.shelf-band-1 { background: var(--green); }
.shelf-band-2 { background: var(--gold); }

.shelf-cover-grid {
  display: flex;
  width: 100%;
  height: 100%;
  gap: 2px;
}

.shelf-cover-cell {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}
.shelf-cover-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.shelf-cover-cell--empty { background: rgba(255, 255, 255, 0.08); }

.shelf-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
}

.shelf-no-books {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

/* ── Curated card — horizontal scrolling cover strip ────────────────────── */

.curated-cover-strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 14px 12px;
  scrollbar-width: none;
}
.curated-cover-strip::-webkit-scrollbar { display: none; }

.curated-cover-item {
  flex-shrink: 0;
  width: 52px;
  height: 74px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface-alt);
}
.curated-cover-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.playlist-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.playlist-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.playlist-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.playlist-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  margin: 0;
}

.playlist-card-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-visibility--private { background: var(--surface-alt);     color: var(--text-mid); }
.tag-visibility--shared  { background: var(--burgundy-light);  color: var(--burgundy-mid); }
.tag-visibility--public  { background: var(--green-light);     color: var(--green-mid); }

/* ── Playlist detail — book rows ─────────────────────────────────────────── */

.playlist-book-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 8px;
}

.playlist-book-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  transition: background 0.15s;
}
.playlist-book-row:hover { background: var(--surface-alt); }

.playlist-book-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.playlist-book-actions { display: flex; gap: 6px; flex-shrink: 0; }
.playlist-tbr-btn { min-width: 120px; }

.playlist-book-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.playlist-book-author {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Notification bell ──────────────────────────────────────────────────── */
.notif-bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: rgba(245, 237, 224, 0.7);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.notif-bell-btn:hover,
.notif-bell-btn.notif-bell--active {
  color: #f5ede0;
  background: rgba(255, 255, 255, 0.1);
}
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--burgundy);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  border-radius: 8px;
  text-align: center;
  pointer-events: none;
}

/* ── Notification panel ─────────────────────────────────────────────────── */
.notif-panel {
  position: fixed;
  z-index: 300;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  overflow: hidden;
}
.notif-panel-inner {
  display: flex;
  flex-direction: column;
}
.notif-panel-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-light);
}
.notif-panel-header h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.notif-panel-body {
  display: flex;
  flex-direction: column;
  max-height: 400px;
  overflow-y: auto;
}
.notif-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}
.notif-row:last-child { border-bottom: none; }
.notif-text {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.45;
}
.notif-text strong { color: var(--text); }
.notif-role {
  display: inline;
  color: var(--text-muted);
  font-style: italic;
}
.notif-actions {
  display: flex;
  gap: 8px;
}
.notif-empty {
  padding: 16px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}
.notif-joined {
  padding: 4px 0;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 600;
}

/* ── Shared shelves section ─────────────────────────────────────────────── */
.shared-shelves-section {
  margin-top: 0;
}
.discover-wip-note {
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}
.shelves-subheading {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.tag-shared {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(44, 78, 26, 0.2);
}

