/* ── DESIGN TOKENS ──────────────────────────────────────── */
:root {
  --color-bg: #f5f0f8;
  --color-surface: #ffffff;
  --color-surface-tinted: #f0e8f8;
  --color-border: rgba(139,79,179,0.12);
  --color-text: #2d1b45;
  --color-text-muted: #7a6890;
  --color-text-faint: #b0a0c0;
  --color-accent: #8b4fb3;
  --color-accent-hover: #7a40a0;
  --color-accent-soft: #ede0f7;
  --color-pink: #e8589a;
  --color-pink-soft: #fde8f3;
  --color-yellow: #f5c842;
  --color-yellow-soft: #fef9e0;
  --color-teal: #4db8c4;
  --color-teal-soft: #e0f6f8;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;

  --radius-sm: 8px; --radius-md: 14px; --radius-lg: 20px; --radius-xl: 28px; --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(139,79,179,0.08);
  --shadow-md: 0 6px 24px rgba(139,79,179,0.12);
  --shadow-lg: 0 16px 48px rgba(139,79,179,0.18);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --nav-height: 76px;
  --header-height: 60px;
  --save-bar-height: 52px;
}

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── BLOBS ──────────────────────────────────────────────── */
#blobCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50% 40% 60% 40% / 50% 60% 40% 50%;
  opacity: 0.45;
  filter: blur(24px);
  animation: blobDrift linear infinite;
}

@keyframes blobDrift {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  33%  { transform: translate(20px, -30px) scale(1.04) rotate(5deg); }
  66%  { transform: translate(-15px, 20px) scale(0.97) rotate(-3deg); }
  100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}

/* ── BANNER BADGE ───────────────────────────────────────── */
.banner-badge {
  position: fixed;
  /* sits below header + a comfortable gap on mobile */
  top: calc(var(--header-height) + 12px);
  right: 12px;
  z-index: 110;
  width: 96px;
  height: 96px;
  border-radius: var(--radius-pill);
  background: #fff8f0;
  border: 3px solid #f5c089;
  box-shadow: 0 4px 20px rgba(245,192,137,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: #a06010;
  line-height: 1.35;
  pointer-events: none;
}

/* On wider screens push it down further so it clears the title area */
@media (min-width: 480px) {
  .banner-badge {
    top: calc(var(--header-height) + 20px);
  }
}

/* ── TOP HEADER ─────────────────────────────────────────── */
.top-header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(245,240,248,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: 640px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
}

.header-brand { display: flex; align-items: center; gap: var(--space-2); }

.header-heart { width: 20px; height: 20px; color: var(--color-pink); flex-shrink: 0; }

.header-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  font-weight: 400;
  color: var(--color-accent);
  letter-spacing: -0.01em;
}

/* ── SAVE ALL BAR ───────────────────────────────────────── */
.save-all-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: var(--save-bar-height);
  background: #1e1040;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  gap: var(--space-4);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.save-all-label {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-save-all {
  height: 36px;
  padding: 0 var(--space-5);
  background: #27ae60;
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.btn-save-all:disabled { opacity: 0.4; cursor: default; }
.btn-save-all:not(:disabled):hover { opacity: 0.88; }

/* ── MAIN CONTENT ───────────────────────────────────────── */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--header-height) + var(--space-6)) var(--space-5) calc(var(--nav-height) + var(--space-8));
}

/* When edit mode bar is shown, push content down */
body.edit-mode-active .main-content {
  padding-top: calc(var(--header-height) + var(--save-bar-height) + var(--space-6));
}

.tab-section { display: none; }
.tab-section.active { display: block; }

/* ── PAGE HEADERS ───────────────────────────────────────── */
.page-header { margin-bottom: var(--space-8); }

.page-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-title-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 38px;
  font-weight: 300;
  color: var(--color-accent);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--space-3);
}

.page-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-top: var(--space-2);
}

/* ── ACTIVITY FEED ──────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: var(--space-4); }

.activity-item {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  animation: fadeUp 0.4s ease-out both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.activity-item:nth-child(1) { animation-delay: 0.05s; }
.activity-item:nth-child(2) { animation-delay: 0.10s; }
.activity-item:nth-child(3) { animation-delay: 0.15s; }
.activity-item:nth-child(4) { animation-delay: 0.20s; }
.activity-item:nth-child(n+5) { animation-delay: 0.25s; }

.activity-cover {
  width: 52px; height: 68px; border-radius: 6px; object-fit: cover;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15); flex-shrink: 0;
}

.activity-cover-placeholder {
  width: 52px; height: 68px; border-radius: 6px;
  background: var(--color-accent-soft); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}

.activity-avatar {
  width: 36px; height: 36px; border-radius: var(--radius-pill);
  object-fit: cover; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  border: 2px solid white;
}

.activity-avatar-placeholder {
  width: 36px; height: 36px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-accent-soft), var(--color-pink-soft));
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--color-accent);
  border: 2px solid white; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.activity-left {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-2); flex-shrink: 0;
}

.activity-body { flex: 1; min-width: 0; }

.activity-text { font-size: 15px; color: var(--color-text); line-height: 1.5; margin-bottom: var(--space-2); }
.activity-text strong { color: var(--color-accent); font-weight: 700; }

.activity-book-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--color-text);
  font-weight: 400;
  display: block;
}

.activity-meta {
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap; margin-top: var(--space-2);
}

.activity-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 3px 8px; border-radius: var(--radius-pill);
}

.tag-gift { background: var(--color-accent-soft); color: var(--color-accent); }
.tag-added { background: var(--color-teal-soft); color: #2a7a80; }

.activity-time { font-size: 12px; color: var(--color-text-faint); }

/* ── LIBRARY ────────────────────────────────────────────── */
.library-controls { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-6); }

.search-wrap { position: relative; display: flex; align-items: center; }

.search-icon-svg {
  position: absolute; left: 14px;
  color: var(--color-text-faint); pointer-events: none; flex-shrink: 0;
}

.search-input {
  width: 100%; height: 44px; padding: 0 var(--space-4) 0 44px;
  background: var(--color-surface); border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill); font-family: var(--font-body);
  font-size: 15px; color: var(--color-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  outline: none; border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(139,79,179,0.1);
}
.search-input::placeholder { color: var(--color-text-faint); }

.sort-wrap { display: flex; gap: var(--space-2); }

.sort-btn {
  flex: 1; height: 36px; padding: 0 var(--space-4);
  background: var(--color-surface); border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill); font-family: var(--font-body);
  font-size: 13px; font-weight: 600; color: var(--color-text-muted);
  cursor: pointer; transition: all 0.2s;
}
.sort-btn:hover, .sort-btn.active {
  background: var(--color-accent-soft); border-color: var(--color-accent); color: var(--color-accent);
}

/* ── BOOK LIST ──────────────────────────────────────────── */
.book-list { display: flex; flex-direction: column; gap: var(--space-2); }

.book-item {
  background: var(--color-surface); border-radius: var(--radius-md);
  padding: var(--space-4); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: var(--space-3);
  transition: box-shadow 0.2s, transform 0.2s; animation: fadeUp 0.3s ease-out both;
}
.book-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.book-thumb-wrap { position: relative; flex-shrink: 0; }
.book-thumb { width: 40px; height: 52px; border-radius: 4px; object-fit: cover; display: block; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.book-thumb-placeholder {
  width: 40px; height: 52px; border-radius: 4px;
  background: var(--color-accent-soft); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.book-info { flex: 1; min-width: 0; }
.book-name { font-size: 15px; font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-detail { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }

/* Edit mode */
.book-item-edit { flex-direction: column; align-items: stretch; gap: var(--space-3); }
.book-item-edit .book-row { display: flex; align-items: center; gap: var(--space-3); }
.edit-row { background: var(--color-surface-tinted); border-radius: var(--radius-sm); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }
.edit-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-accent); margin-bottom: 4px; display: block; }
.edit-select, .edit-date-input {
  width: 100%; height: 40px; padding: 0 var(--space-3);
  background: var(--color-surface); border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 14px; color: var(--color-text);
}
.edit-actions { display: flex; gap: var(--space-2); justify-content: flex-end; }
.btn-delete { height: 36px; width: 36px; background: #e74c3c; color: white; border: none; border-radius: var(--radius-sm); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Cover preview with remove button */
.cover-preview-wrap {
  position: relative; display: inline-flex; flex-shrink: 0;
}
.cover-remove-btn {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: var(--radius-pill);
  background: #e74c3c; color: white; border: 2px solid white;
  font-size: 10px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0; font-family: var(--font-body);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Cover search panel */
.cover-search-box { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.cover-search-row, .cover-url-row { display: flex; gap: 6px; align-items: center; }
.cover-upload-row { display: flex; }

.btn-find-cover {
  height: 32px; padding: 0 var(--space-3);
  background: var(--color-accent-soft); color: var(--color-accent);
  border: 1.5px solid rgba(139,79,179,0.25); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.btn-find-cover:hover { background: rgba(139,79,179,0.15); border-color: var(--color-accent); }

/* ── CROP EDITOR OVERLAY ────────────────────────────────── */
.crop-overlay {
  position: fixed; inset: 0;
  background: rgba(20,10,40,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.crop-sheet {
  width: 100%; max-width: 500px;
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-5) var(--space-5) calc(var(--space-8) + env(safe-area-inset-bottom));
  animation: slideUp 0.28s ease-out;
}

.crop-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-2);
}

.crop-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text);
}

.crop-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.crop-frame {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  cursor: grab;
}
.crop-frame:active { cursor: grabbing; }

.crop-canvas {
  display: block;
  width: 200px;
  height: 260px;
  touch-action: none;
}

.crop-controls {
  display: flex; gap: var(--space-2); justify-content: center;
  margin-bottom: var(--space-5);
}

.crop-btn {
  height: 36px; padding: 0 var(--space-4);
  background: var(--color-bg); border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill); font-family: var(--font-body);
  font-size: 13px; font-weight: 600; color: var(--color-text-muted);
  cursor: pointer; transition: all 0.2s;
}
.crop-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }

.crop-actions {
  display: flex; gap: var(--space-3); justify-content: flex-end;
}

/* ── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1e1040;
  color: white;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 400;
  pointer-events: none;
  white-space: nowrap;
}
.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── MANAGE TAB ─────────────────────────────────────────── */
.password-wall { display: flex; justify-content: center; padding-top: var(--space-8); }
.password-card {
  background: var(--color-surface); border-radius: var(--radius-lg);
  padding: var(--space-8); width: 100%; max-width: 320px;
  box-shadow: var(--shadow-md); display: flex; flex-direction: column;
  gap: var(--space-4); text-align: center;
}
.password-label { font-size: 15px; color: var(--color-text-muted); }
.password-input {
  width: 100%; height: 44px; padding: 0 var(--space-4);
  background: var(--color-bg); border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 16px; color: var(--color-text); text-align: center;
}
.password-input:focus { outline: none; border-color: var(--color-accent); }
.manage-card { background: var(--color-surface); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-sm); margin-bottom: var(--space-4); }
.manage-heading { font-size: 16px; font-weight: 700; color: var(--color-text); margin-bottom: var(--space-1); }
.manage-hint { font-size: 13px; color: var(--color-text-muted); margin-bottom: var(--space-4); }
.manage-input { flex: 1; height: 40px; padding: 0 var(--space-3); background: var(--color-bg); border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 14px; color: var(--color-text); }
.manage-input:focus { outline: none; border-color: var(--color-accent); }
.add-row { display: flex; gap: var(--space-2); margin-top: var(--space-4); align-items: center; }

.manage-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-3) var(--space-4); background: var(--color-surface-tinted);
  border-radius: var(--radius-sm); margin-bottom: var(--space-2);
  font-size: 14px; color: var(--color-text);
}

.buyer-item-left { display: flex; align-items: center; gap: var(--space-3); }
.buyer-item-right { display: flex; align-items: center; gap: var(--space-2); }

.buyer-avatar-img {
  width: 36px; height: 36px; border-radius: var(--radius-pill);
  object-fit: cover; flex-shrink: 0;
  border: 2px solid white; box-shadow: var(--shadow-sm);
}

.buyer-avatar-placeholder {
  width: 36px; height: 36px; border-radius: var(--radius-pill);
  background: var(--color-accent-soft); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--color-accent);
  border: 2px solid white;
}

.btn-upload-avatar {
  height: 28px; padding: 0 var(--space-2);
  background: var(--color-surface); border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm); font-family: var(--font-body);
  font-size: 11px; font-weight: 600; color: var(--color-text-muted);
  cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.btn-upload-avatar:hover { border-color: var(--color-accent); color: var(--color-accent); }

.remove-btn {
  width: 28px; height: 28px; border-radius: var(--radius-pill);
  background: rgba(231,76,60,0.1); border: none; color: #e74c3c;
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-family: var(--font-body);
}

/* ── BOTTOM NAV ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 100; padding-bottom: env(safe-area-inset-bottom);
}

.nav-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; height: 100%; background: none; border: none;
  cursor: pointer; color: var(--color-text-faint);
  font-family: var(--font-body); padding-top: 8px; transition: color 0.2s;
  position: relative;
}

.nav-tab.active { color: var(--color-accent); }
.nav-tab:hover { color: var(--color-accent); }

.nav-tab.active::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 32px;
  background: var(--color-accent-soft);
  border-radius: var(--radius-pill);
  z-index: -1;
}

.nav-icon-svg { width: 22px; height: 22px; flex-shrink: 0; position: relative; z-index: 1; }

.nav-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

.nav-spacer { flex: 1; }

.nav-add-wrap {
  flex: 1; display: flex; justify-content: center;
  align-items: center; padding-bottom: 4px;
}

.nav-add-btn {
  width: 52px; height: 52px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-pink) 100%);
  border: none; color: white; cursor: pointer;
  box-shadow: 0 4px 16px rgba(139,79,179,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-add-btn:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(139,79,179,0.5); }

/* ── ADD MODAL ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(45,27,69,0.5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 200; display: flex; align-items: flex-end; padding: 0;
}

.modal-sheet {
  width: 100%; max-width: 640px; margin: 0 auto;
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-4) var(--space-5) calc(var(--space-8) + env(safe-area-inset-bottom));
  max-height: 90dvh; overflow-y: auto; animation: slideUp 0.3s ease-out;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-drag-bar { width: 40px; height: 4px; background: var(--color-border); border-radius: var(--radius-pill); margin: 0 auto var(--space-4); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-6); }
.modal-title { font-family: var(--font-display); font-size: 26px; font-weight: 600; font-style: italic; color: var(--color-text); letter-spacing: -0.01em; }
.modal-close { width: 32px; height: 32px; border-radius: var(--radius-pill); background: var(--color-bg); border: none; color: var(--color-text-muted); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: var(--font-body); }
.modal-field { display: flex; flex-direction: column; margin-bottom: var(--space-4); }
.modal-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.modal-input { width: 100%; height: 48px; padding: 0 var(--space-4); background: var(--color-bg); border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 16px; color: var(--color-text); transition: border-color 0.2s, box-shadow 0.2s; }
.modal-input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(139,79,179,0.1); }
.modal-select { width: 100%; height: 48px; padding: 0 var(--space-4); background: var(--color-bg); border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 15px; color: var(--color-text); -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a6890' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.modal-textarea { width: 100%; min-height: 120px; padding: var(--space-3) var(--space-4); background: var(--color-bg); border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 15px; color: var(--color-text); resize: vertical; }
.modal-textarea:focus { outline: none; border-color: var(--color-accent); }
.search-status { font-size: 14px; color: var(--color-text-muted); text-align: center; padding: var(--space-3) 0; }

.book-results { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.book-result-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--color-surface-tinted); border: 1.5px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s; text-align: left; width: 100%; font-family: var(--font-body); }
.book-result-item:hover { background: var(--color-accent-soft); border-color: var(--color-accent); box-shadow: var(--shadow-sm); }
.result-cover { width: 40px; height: 52px; border-radius: 4px; object-fit: cover; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.result-cover-placeholder { width: 40px; height: 52px; border-radius: 4px; background: var(--color-accent-soft); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.result-info { flex: 1; min-width: 0; }
.result-title { font-size: 14px; font-weight: 700; color: var(--color-text); line-height: 1.3; }
.result-author { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.result-arrow { font-size: 16px; color: var(--color-text-faint); flex-shrink: 0; }

.divider-row { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0; }
.divider-row::before, .divider-row::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }
.divider-label { font-size: 12px; font-weight: 600; color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.bulk-toggle-row { display: flex; justify-content: center; margin-top: var(--space-4); }

.confirm-book-preview { display: flex; gap: var(--space-4); align-items: center; background: var(--color-surface-tinted); border-radius: var(--radius-md); padding: var(--space-4); }
.confirm-cover { width: 64px; height: 84px; border-radius: 6px; object-fit: cover; box-shadow: var(--shadow-sm); flex-shrink: 0; }
.confirm-title { font-family: var(--font-display); font-style: italic; font-size: 18px; font-weight: 400; color: var(--color-text); line-height: 1.3; }
.confirm-author { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }
.confirm-actions { display: flex; gap: var(--space-3); margin-top: var(--space-5); }

.success-inner { text-align: center; padding: var(--space-8) var(--space-4); display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.success-emoji { font-size: 48px; }
.success-message { font-size: 18px; color: var(--color-text); font-weight: 600; }
.success-actions { display: flex; gap: var(--space-3); }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn-primary { height: 48px; padding: 0 var(--space-6); background: linear-gradient(135deg, var(--color-accent) 0%, #a360d8 100%); color: white; border: none; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 14px rgba(139,79,179,0.3); white-space: nowrap; }
.btn-primary:hover { background: linear-gradient(135deg, var(--color-accent-hover) 0%, #9050c8 100%); box-shadow: 0 6px 18px rgba(139,79,179,0.4); }
.btn-secondary { height: 44px; padding: 0 var(--space-5); background: var(--color-accent-soft); color: var(--color-accent); border: 1.5px solid rgba(139,79,179,0.2); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-secondary:hover { background: rgba(139,79,179,0.15); }
.btn-ghost { height: 44px; padding: 0 var(--space-4); background: none; color: var(--color-text-muted); border: none; font-family: var(--font-body); font-size: 14px; font-weight: 600; cursor: pointer; transition: color 0.2s; }
.btn-ghost:hover { color: var(--color-accent); }
.full-width { width: 100%; }

.empty-message { text-align: center; color: var(--color-text-faint); font-size: 15px; padding: var(--space-12) var(--space-4); font-style: italic; }

@media (min-width: 500px) {
  .confirm-actions { justify-content: flex-end; }
  .success-actions { justify-content: center; }
}
