/* --- Design System & CSS Variables --- */
:root {
  --font-header: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Premium HSL Color Palette */
  --bg-color: #0b0f19;
  --bg-color-rgb: 11, 15, 25;
  --card-bg: rgba(17, 24, 39, 0.55);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-focus: rgba(250, 204, 21, 0.4);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #1f2937;

  --color-primary: #facc15; /* Highlighter Yellow */
  --color-primary-hover: #eab308;
  --color-primary-rgb: 250, 204, 21;

  --color-secondary: #6366f1; /* Indigo */
  --color-secondary-hover: #4f46e5;
  --color-secondary-rgb: 99, 102, 241;

  --color-success: #10b981; /* Emerald */
  --color-success-rgb: 16, 185, 129;

  --color-danger: #ef4444;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --glow-primary: 0 0 20px rgba(250, 204, 21, 0.25);
  --glow-secondary: 0 0 20px rgba(99, 102, 241, 0.25);

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Layout --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  line-height: 1.5;
}

/* Background Ambient Glows */
.bg-glow {
  position: fixed;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
}

.bg-glow-primary {
  top: -10vw;
  right: -10vw;
  background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.6) 0%, transparent 70%);
}

.bg-glow-secondary {
  bottom: -10vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(var(--color-secondary-rgb), 0.6) 0%, transparent 70%);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(250, 204, 21, 0.5);
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  overflow-x: hidden;
  position: relative;
}

/* --- Header Section --- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 76px;
  padding: 0;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.brand-block .tagline {
  font-size: 11px;
  color: #aeb7c7;
  display: block;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.logo-wrapper .highlight-word {
  color: #000000;
  position: relative;
  z-index: 2;
  padding: 0 6px;
  margin-right: 2px;
}

.logo-wrapper .highlight-word::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 100%;
  height: 65%;
  background: var(--color-primary);
  z-index: -1;
  transform-origin: left;
  transform: scaleX(0) skewX(-12deg);
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.45);
  animation: marker-draw 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.2s;
}

@keyframes marker-draw {
  to {
    transform: scaleX(1) skewX(-12deg);
  }
}

.logo-wrapper .marker-word {
  color: #ffffff;
  z-index: 2;
}

@keyframes scanner-laser {
  0% { transform: translate(-50%, -65px); }
  50% { transform: translate(-50%, 65px); }
  100% { transform: translate(-50%, -65px); }
}
.laser-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 85%;
  height: 2px;
  background-color: rgba(239, 68, 68, 0.85);
  pointer-events: none;
  z-index: 11;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  animation: scanner-laser 2.5s infinite ease-in-out;
}

/* --- Quagga Scanner Styles --- */
#barcode-reader {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#barcode-reader video,
#barcode-reader canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#barcode-reader canvas.drawingBuffer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.header-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 500px;
  margin-left: 2rem;
  margin-right: auto;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  padding-left: 1.5rem;
}

/* --- Layout Grid --- */
.app-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding: 2rem 0;
  flex-grow: 1;
}

@media (min-width: 1024px) {
  .app-main {
    grid-template-columns: 1fr 1.1fr;
  }
}

.section-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0; /* Prevents flex children from stretching */
}

/* --- Glassmorphism UI Components --- */
.glass-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-card:focus-within {
  border-color: var(--card-border-focus);
}

/* --- Tab Header --- */
.tab-headers {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0.5rem 0 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

.tab-header {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-header);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 0;
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.tab-header:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-header.active {
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.08);
}

.tab-header span {
  font-size: 1.2rem;
}

/* Highlight Auto-Extract Tab */
#tab-btn-triggers {
  color: var(--color-success);
  background: rgba(var(--color-success-rgb), 0.08);
  border: 1px dashed rgba(var(--color-success-rgb), 0.5);
  margin-left: 0.25rem;
}

#tab-btn-triggers:hover {
  background: rgba(var(--color-success-rgb), 0.15);
  border-style: solid;
}

#tab-btn-triggers.active {
  color: #fff;
  background: rgba(var(--color-success-rgb), 0.6);
  border: 1px solid var(--color-success);
  box-shadow: 0 0 20px rgba(var(--color-success-rgb), 0.4);
}

/* Tab panes */
.tab-contents {
  padding: 1.5rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tab-description {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* --- Input Fields --- */
.textarea-wrapper {
  position: relative;
  width: 100%;
}

textarea {
  width: 100%;
  height: 280px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-main);
  padding: 1.25rem;
  font-family: var(--font-body);
  font-size: 16px;
  resize: none;
  outline: none;
  transition: all var(--transition-fast);
}

textarea:focus {
  border-color: var(--color-primary);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.1);
}

.clear-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
}

.textarea-wrapper:hover .clear-button,
textarea:focus + .clear-button {
  opacity: 1;
}

.clear-button:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.15);
}

/* URL Input */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
}

input[type="url"],
input[type="text"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-main);
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

input[type="url"]:focus,
input[type="text"]:focus {
  border-color: var(--color-primary);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.1);
}

/* --- Buttons --- */
.tab-actions {
  display: flex;
  gap: 0.75rem;
}

button {
  font-family: var(--font-header);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.primary-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, #eab308 100%);
  border: none;
  color: var(--text-dark);
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.primary-button:hover {
  background: linear-gradient(135deg, #fef08a 0%, var(--color-primary) 100%);
  box-shadow: var(--glow-primary);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.icon-button {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-button:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: rotate(15deg);
}

/* --- Quick Triggers Elements --- */
.trigger-groups {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.trigger-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trigger-box h3 {
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.trigger-box h3 span {
  color: var(--color-primary);
  font-size: 1.2rem;
}

.trigger-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.bookmarklet-btn,
.shortcut-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.75rem;
  border-radius: 8px;
  text-align: center;
  transition: all var(--transition-fast);
}

.bookmarklet-btn {
  background: rgba(var(--color-primary-rgb), 0.1);
  border: 1px dashed rgba(var(--color-primary-rgb), 0.4);
  color: var(--color-primary);
  cursor: grab;
}

.bookmarklet-btn:hover {
  background: rgba(var(--color-primary-rgb), 0.18);
  border-style: solid;
}

.shortcut-btn {
  background: rgba(var(--color-secondary-rgb), 0.1);
  border: 1px solid rgba(var(--color-secondary-rgb), 0.3);
  color: #a5b4fc;
}

.shortcut-btn:hover {
  background: rgba(var(--color-secondary-rgb), 0.2);
  color: #fff;
  box-shadow: var(--glow-secondary);
}

/* --- Extractor Console Logs Card --- */
.status-card {
  padding: 1.25rem;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
}

.status-header h3 {
  font-family: var(--font-header);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.engine-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(250, 204, 21, 0.25);
  border-top-color: var(--color-primary);
  border-radius: 50%;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-logs {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: #34d399; /* Green terminal font */
}

.log-entry {
  display: flex;
  gap: 0.5rem;
}

.log-time {
  color: #6b7280;
  user-select: none;
}

.log-text {
  word-break: break-all;
}

.log-error {
  color: var(--color-danger);
}

/* --- Results Section --- */
.results-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.results-header h2 {
  font-family: var(--font-header);
  font-size: 1.4rem;
  font-weight: 700;
}

.badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

/* Results Empty State */
.results-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  padding: 4rem 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.empty-icon {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

.results-empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 320px;
}

/* Books Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
}

.hidden {
  display: none !important;
}

/* --- Book Card Component --- */
.book-card {
  background: linear-gradient(135deg, rgba(25, 30, 45, 0.7) 0%, rgba(15, 18, 30, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.book-card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--color-primary-rgb), 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(var(--color-primary-rgb), 0.05);
}

.book-cover-container {
  height: 180px;
  background: #111420;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.book-cover-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(20px) opacity(0.25);
  transform: scale(1.1);
}

.book-cover {
  width: 100px;
  height: 145px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
  z-index: 1;
  transition: transform var(--transition-normal);
}

.book-card:hover .book-cover {
  transform: scale(1.06) rotate(-2deg);
}

.book-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
  min-width: 0;
}

.book-title {
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  /* Truncate multi-line */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7rem;
}

.book-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  height: 3.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.25rem;
}

.book-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.book-price-box {
  display: flex;
  flex-direction: column;
}

.price-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.price-val {
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-success);
}

.price-val.free {
  color: var(--color-primary);
}

/* Card Action Links */
.book-card-actions {
  display: flex;
  flex-wrap: wrap;
  padding: 0.75rem 1.25rem 1.25rem 1.25rem;
  gap: 0.5rem;
}

.card-btn {
  flex: 1 1 auto;
  min-width: calc(50% - 0.5rem);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.65rem 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: all var(--transition-fast);
}

.card-btn-buy {
  background: var(--color-primary);
  color: var(--text-dark);
}

.card-btn-buy:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.15);
}

.card-btn-save {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.card-btn-save:hover {
  background: rgba(255, 255, 255, 0.12);
}

.card-btn-save.saved {
  background: rgba(var(--color-success-rgb), 0.15);
  border-color: rgba(var(--color-success-rgb), 0.4);
  color: var(--color-success);
}

/* Skeleton Loading Animation */
.skeleton-card {
  height: 380px;
}
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Floating Drawer Button (Mobile) --- */
.floating-wishlist-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-secondary);
  border: none;
  color: #fff;
  display: none; /* Desktop hidden */
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
  z-index: 99;
}

.floating-wishlist-btn:hover {
  background: var(--color-secondary-hover);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
  transform: scale(1.05);
}

.count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-danger);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 2px solid var(--bg-color);
}

/* --- Wishlist Sidebar Drawer --- */
.wishlist-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  background: rgba(10, 14, 23, 0.85);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.wishlist-sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.sidebar-header h2 {
  font-family: var(--font-header);
  font-size: 1.3rem;
  font-weight: 700;
}

/* Stats Row */
.sidebar-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-family: var(--font-header);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-primary);
}

.stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Empty Shelf state */
.wishlist-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  text-align: center;
  gap: 0.75rem;
  padding: 2rem;
}

.empty-shelf-icon {
  font-size: 3.5rem;
  color: rgba(255, 255, 255, 0.05);
}

.wishlist-empty p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Shelf Items */
.wishlist-items {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Saved Item Card */
.wishlist-item {
  display: flex;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0.65rem;
  position: relative;
  align-items: center;
  transition: all var(--transition-fast);
}

.wishlist-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.wishlist-item-cover {
  width: 45px;
  height: 65px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.wishlist-item-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.wishlist-item-title {
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.wishlist-item-author {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.wishlist-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wishlist-item-price {
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-success);
}

.wishlist-item-actions {
  display: flex;
  gap: 0.5rem;
}

.wishlist-item-btn {
  text-decoration: none;
  background: rgba(var(--color-primary-rgb), 0.12);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.wishlist-item-btn:hover {
  background: var(--color-primary);
  color: var(--text-dark);
}

.btn-remove-item {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.btn-remove-item:hover {
  color: var(--color-danger);
}

/* Sidebar Actions */
.sidebar-actions {
  display: flex;
  gap: 0.75rem;
  position: relative;
}

.action-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  padding: 0.8rem 0;
  border-radius: 10px;
  font-size: 0.88rem;
}

.share-btn {
  background: var(--color-secondary);
  color: #fff;
}

.share-btn:hover {
  background: var(--color-secondary-hover);
  box-shadow: var(--glow-secondary);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.export-dropdown-wrapper {
  flex: 1;
  position: relative;
  display: flex;
}

.export-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #111524;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  z-index: 10;
}

.export-menu button {
  background: none;
  border: none;
  color: var(--text-muted);
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.export-menu button:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

/* --- Modals --- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 1;
  transition: opacity var(--transition-normal);
  overscroll-behavior: contain;
}

.modal-card {
  width: 480px;
  max-width: 90%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.9) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header h2 {
  font-family: var(--font-header);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.01);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-footer button {
  flex: none;
}

/* --- Toast Alerts --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #10b981;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-error {
  background: var(--color-danger);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

/* --- Responsive Adjustments --- */


@media (max-width: 768px) {
  .header-subtitle {
    display: none;
  }
  
  .floating-wishlist-btn {
    display: flex;
  }

  .wishlist-sidebar {
    width: 100%;
    z-index: 101;
  }

  .app-header {
    padding: 1rem 0;
  }
}

/* /* ==========================================
   LANDING PAGE STYLES (IDEO Premium Design)
   ========================================== */
.landing-page {
  --bg-dark: #070b13; /* Ultra-deep indigo black */
  --primary-neon: #ffe600; /* Signature highlighter yellow */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  background-color: var(--bg-dark) !important;
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
}

.landing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
  overflow-x: hidden;
}

/* Background glows */
.bg-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  filter: blur(150px);
  opacity: 0.08;
}

.bg-glow-primary {
  background: var(--primary-neon);
  top: -150px;
  left: -150px;
}

.bg-glow-secondary {
  background: #6366f1; /* Indigo */
  bottom: -150px;
  right: -150px;
}

/* Header Navigation */
.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-header);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--primary-neon);
}

.nav-links .nav-cta-btn {
  background: var(--primary-neon);
  color: #000 !important;
  padding: 0.6rem 1.5rem;
  border-radius: 30px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(255, 230, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.nav-links .nav-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 230, 0, 0.4);
}

/* SVG Highlighter Logo and Streak Animation */
.logo-highlighter {
  cursor: pointer;
}

.highlight-stroke {
  stroke-dasharray: 250;
  stroke-dashoffset: 250;
  animation: draw-streak 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.4s;
}

@keyframes draw-streak {
  to {
    stroke-dashoffset: 0;
  }
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 5rem;
  padding: 7rem 0 8rem 0;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-content h1 {
  font-family: var(--font-header);
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

.text-neon {
  color: var(--primary-neon);
  text-shadow: 0 0 20px rgba(255, 230, 0, 0.15);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1.65;
  margin-bottom: 3rem;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  gap: 1.25rem;
  align-items: flex-end;
}

.hero-primary-btn {
  background: var(--primary-neon);
  color: #000 !important;
  text-decoration: none;
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.9rem 2rem;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 25px rgba(255, 230, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.hero-primary-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(255, 230, 0, 0.45);
}

.hero-secondary-btn {
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.9rem 2rem;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hero-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Premium Glassmorphic Auth Card */
.hero-auth-card {
  perspective: 1000px;
}

.auth-card {
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  padding: 3rem 2.25rem;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255,255,255,0.1);
  transform: rotateY(-5deg) rotateX(5deg);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card:hover {
  transform: rotateY(0deg) rotateX(0deg);
}

.auth-card h3 {
  font-family: var(--font-header);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

.auth-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}

.auth-buttons {
  margin-top: 0.75rem;
}

.google-auth-btn {
  width: 100%;
  background: #ffffff;
  color: #0f172a !important;
  border: none;
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0.85rem 1.5rem;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.google-auth-btn:hover {
  background: #f9fafb;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.lock-icon {
  font-size: 1rem;
  color: var(--color-success);
}

/* Key Capabilities Features Grid */
.features-section {
  padding: 8rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.section-title-wrapper {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 5.5rem auto;
}

.section-title-wrapper .badge {
  background: rgba(255, 230, 0, 0.08);
  border: 1px solid rgba(255, 230, 0, 0.2);
  color: var(--primary-neon);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.section-title-wrapper h2 {
  font-family: var(--font-header);
  font-size: 2.5rem;
  font-weight: 800;
  margin: 1.25rem 0 1rem 0;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.section-title-wrapper p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 2rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 3rem 2.5rem;
  border-radius: 20px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 230, 0, 0.3);
  box-shadow: 0 15px 40px rgba(255, 230, 0, 0.06);
  background: rgba(255, 255, 255, 0.025);
}

.feature-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 230, 0, 0.06);
  border: 1px solid rgba(255, 230, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.feature-icon {
  color: var(--primary-neon);
  font-size: 1.65rem;
}

.feature-card h3 {
  font-family: var(--font-header);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: #ffffff;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}

/* Landing Footer */
.landing-footer {
  text-align: center;
  padding: 4rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Responsive Landing Details */
@media (max-width: 992px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 4rem;
    padding: 5rem 0;
    text-align: center;
  }
  
  .hero-content {
    align-items: center;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .hero-auth-card {
    max-width: 450px;
    margin: 0 auto;
  }
  
  .auth-card {
    transform: none;
  }
  
  .auth-card:hover {
    transform: none;
  }

  .hero-content h1 {
    font-size: 3rem;
  }
}

@media (max-width: 900px) {
  .dashboard-grid, .app-main {
    display: flex !important;
    flex-direction: column !important;
  }
  .results-container {
    order: 1 !important;
  }
  .dashboard-sidebar {
    order: 2 !important;
  }

  /* Mobile-first HIG Result State */
  .app-main.has-results {
    flex-direction: column-reverse !important;
  }
  .app-main.has-results .section-left {
    display: none !important;
  }
  .app-main.has-results .mobile-only-new-search {
    display: flex !important;
  }
}

@media (max-width: 576px) {
  .landing-container, .app-container {
    padding: 0 1.25rem;
  }
  
  .hero-content h1 {
    font-size: 2.4rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  @media (max-width: 400px) {
    .hero-content h1 {
      font-size: 2rem;
    }
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 1rem;
  }

  .hero-primary-btn, .hero-secondary-btn {
    width: 100%;
    justify-content: center;
  }

  .landing-header {
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem 0;
  }
  
  .section-title-wrapper h2 {
    font-size: 1.8rem;
  }

  /* Extractor & Dashboard Mobile Fixes */
  .btn-text {
    display: none !important;
  }
  .user-name-text {
    display: inline-block !important;
    max-width: 90px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
  }
  #user-name-span {
    display: inline-block !important;
    max-width: 90px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
  }
  #user-profile-header button, #user-profile-header a, .icon-btn-header {
    padding: 0 !important;
    width: 36px !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #f6f7fb !important;
    flex: none !important;
  }
  .app-header {
    height: 76px !important;
    padding: 0 !important;
    gap: 0.5rem !important;
  }
  .header-actions {
    gap: 8px !important;
  }
  .tab-header {
    font-size: 0.78rem !important;
    gap: 0.25rem !important;
    padding: 0.6rem 0.25rem !important;
  }
  .filter-sort-panel > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }
  .filter-sort-panel > div > div {
    width: 100% !important;
    margin-left: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  .library-items-grid {
    grid-template-columns: 1fr !important;
  }
  
  .book-card-actions,
  .tab-actions {
    flex-direction: column !important;
  }
}

/* Dashboard Select Picker Styling */
.dashboard-select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 2rem 0.4rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  transition: all var(--transition-fast);
}

.dashboard-select:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.dashboard-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.2);
}

.dashboard-select option {
  background-color: #0f131a;
  color: var(--text-main);
  padding: 0.5rem;
}

/* Animation helper for pending books */
.animate-pulse {
  animation: pulse-effect 1.8s ease-in-out infinite;
}

@keyframes pulse-effect {
  0%, 100% {
    opacity: 0.35;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.05);
  }
}

/* Omni-Capture Features */
.image-feature-card {
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.image-feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  border-color: var(--color-primary);
}

.image-feature-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.image-feature-card:hover img {
  transform: scale(1.05);
}

.pain-points-section .glass-card {
  transition: all 0.3s ease;
}

.pain-points-section .glass-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(5px);
}

/* --- Hide Distractions Post-Extraction --- */
.app-main.has-results .trigger-groups-card,
.app-main.has-results .visitor-stats-card,
.app-main.has-results .section-left h2 {
    display: none !important;
}

/* --- Global App Navigation (Floating Bottom Tabs) --- */
body {
  padding-bottom: 70px; /* Space for fixed bottom tab bar */
}

.floating-bottom-nav {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #0c111cf2;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 8px;
  display: flex;
  gap: 4px;
  z-index: 1000;
}

.floating-bottom-nav a {
  color: var(--text-muted, rgba(255, 255, 255, 0.6));
  text-decoration: none !important;
  font-size: 11.5px;
  padding: 8px 14px;
  border-radius: 10px;
  transition: all var(--transition-fast, 0.15s ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 500;
}

.floating-bottom-nav a:hover {
  color: #fff;
}

.floating-bottom-nav a.active {
  color: #151515 !important;
  background: var(--color-primary, #facc15);
  font-weight: 700;
}

@media (max-width: 640px) {
  .floating-bottom-nav {
    width: calc(100% - 24px);
    justify-content: space-around;
  }
  .floating-bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 9px 4px;
  }
}

.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: rgba(15, 19, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.7rem;
  text-decoration: none !important;
  transition: all var(--transition-fast);
  width: 100%;
  height: 100%;
  position: relative;
}

.tab-item:visited {
  color: var(--text-muted);
}

.tab-item:hover {
  color: var(--text-main);
}

.tab-item.active, .tab-item.active:visited {
  color: var(--color-primary);
}

.tab-item .material-symbols-outlined {
  font-size: 1.5rem;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.tab-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.tab-badge {
  position: absolute;
  top: 6px;
  right: 50%;
  margin-right: -20px;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 12px;
  border: 2px solid #0f131a;
  z-index: 2;
}

.more-menu-btn:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* --- iOS Style Article Lists --- */
.ios-list-group {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 1.5rem;
}

.ios-list-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--text-main);
  background: transparent;
  transition: background 0.2s;
  position: relative;
}

.ios-list-item:hover, .ios-list-item:active {
  background: rgba(255, 255, 255, 0.05);
}

/* Border between items, but not on the last one */
.ios-list-item:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 3.5rem; /* Indent the line past the icon */
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.ios-list-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  margin-right: 1rem;
}

.ios-list-icon.color-blue { background: #0A84FF; }
.ios-list-icon.color-orange { background: #FF9F0A; }
.ios-list-icon.color-green { background: #32D74B; }
.ios-list-icon.color-purple { background: #BF5AF2; }

.ios-list-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}

.ios-list-chevron {
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.2rem;
}

/* --- iOS Control Center Action Grid --- */
.ios-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 1.5rem;
}

.ios-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.2rem 0.5rem;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ios-action-btn:hover, .ios-action-btn:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.97);
}

.ios-action-btn.active {
  background: rgba(250, 204, 21, 0.15); /* Primary yellow tint */
  border-color: rgba(250, 204, 21, 0.4);
  color: var(--color-primary);
}

.ios-action-btn .material-symbols-outlined {
  font-size: 2rem;
}

.ios-action-btn span:not(.material-symbols-outlined) {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-primary-btn, .hero-secondary-btn {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
  
  .landing-footer div {
    flex-direction: column;
    align-items: center;
    gap: 1rem !important;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .hero-section {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 3rem 0;
  }
  
  .auth-card {
    padding: 2rem 1.5rem;
  }
  
  .landing-container {
    padding: 0 1rem;
  }
}

/* --- Slide-out Filter Panel --- */
.side-panel {
  position: fixed;
  top: 0;
  left: -400px;
  width: 350px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-color);
  border-right: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.side-panel.open {
  left: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.panel-header h3 {
  font-family: var(--font-header);
  font-size: 1.2rem;
  color: var(--text-main);
  margin: 0;
}

.panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.panel-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

/* --- Book Status Buttons --- */
.card-btn-save.status-wishlist {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.card-btn-save.status-owned {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.3);
}/* --- Reason Chips --- */
.reason-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.reason-chip:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-main);
}
.reason-chip.selected {
  background: rgba(var(--color-primary-rgb), 0.2);
  border-color: var(--color-primary);
  color: var(--color-primary);
}



/* Blog Layout */
.blog-container { max-width: 800px; margin: 0 auto; padding: 6rem 1.5rem 4rem 1.5rem; }
.blog-header { text-align: center; margin-bottom: 3rem; }
.blog-header h1 { font-size: 2.5rem; color: #fff; margin-bottom: 1rem; line-height: 1.2; }
.blog-content p { font-size: 1.1rem; line-height: 1.8; color: var(--text-muted); margin-bottom: 1.5rem; }
.blog-content h2 { font-size: 1.75rem; color: #fff; margin-top: 2.5rem; margin-bottom: 1rem; }
.blog-content h3 { font-size: 1.25rem; color: var(--color-primary); margin-top: 2rem; margin-bottom: 0.75rem; }
.blog-content ul { color: var(--text-muted); margin-bottom: 1.5rem; padding-left: 2rem; line-height: 1.8; }
.blog-content li { margin-bottom: 0.5rem; }

/* ==========================================================================
   FoldMarker Unified Visual System (Phase 1, 2, 3 Enhancements)
   ========================================================================== */

/* --- Brand Header & Tagline Alignment --- */
.header-brand-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.header-tagline {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.015em;
  margin-top: 0.15rem;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .header-tagline {
    font-size: 0.68rem;
    white-space: normal;
    line-height: 1.2;
  }
}

/* --- Reader DNA & What to Read Next Elevated Insight Panel --- */
/* --- Reader DNA & What to Read Next Independent Components --- */
.reader-dna-card,
.what-to-read-next-card {
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.5rem 1.75rem;
  position: relative;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: 2rem;
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.dna-header-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-header);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  margin-bottom: 0.85rem;
  position: relative;
}

.dna-header-title .dna-title-text,
.dna-next-label-row .dna-next-label,
.dna-next-label {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-family: var(--font-header);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.dna-header-title .dna-title-text::before,
.dna-next-label-row .dna-next-label::before,
.dna-next-label::before {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 2px;
  height: 50%;
  background: rgba(250, 204, 21, 0.45);
  z-index: -1;
  transform: rotate(-1deg);
  border-radius: 2px;
  pointer-events: none;
}

.dna-next-title {
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.dna-next-title-link {
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  margin-left: -0.3rem;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  display: inline;
}

.dna-next-title-link:hover {
  background-color: rgba(250, 204, 21, 0.25);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.25);
}

.dna-next-title-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.dna-next-cover-link {
  display: block;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dna-next-cover-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(250, 204, 21, 0.3);
}

.dna-next-cover-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.dna-next-cover-link .book-cover-area,
.dna-next-cover-link .book-cover-container {
  width: 54px !important;
  height: 80px !important;
  min-width: 54px !important;
  border-radius: 6px !important;
  overflow: hidden;
  padding: 0 !important;
  position: relative;
}

.dna-next-cover-link .book-cover-placeholder-styled {
  width: 100% !important;
  height: 100% !important;
  font-size: 7px !important;
  padding: 4px !important;
  box-shadow: none !important;
  border-radius: 6px !important;
}

.dna-next-cover-link .real-cover {
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  border-radius: 6px !important;
}

.dna-rationale-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
  font-style: italic;
  border-left: 2px solid rgba(255, 255, 255, 0.18);
  padding-left: 0.85rem;
  margin-top: 0.5rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.reader-dna-empty {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  text-align: left;
}

.reader-dna-empty-title {
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.reader-dna-empty-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* --- Card Hierarchy Refinements --- */
.card-discovery-compact {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 0.75rem;
  text-align: left;
}

.card-discovery-compact .discovery-primary-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  color: #e5e7eb;
}

.card-discovery-compact .discovery-note {
  margin-top: 0.25rem;
  font-style: italic;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-discovery-compact .discovery-more-count {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--color-primary);
  font-weight: 600;
}

.card-btn-view-primary {
  width: 100%;
  padding: 0.65rem 1rem;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: var(--color-primary);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.card-btn-view-primary:hover {
  background: var(--color-primary);
  color: var(--text-dark);
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.25);
  transform: translateY(-1px);
}

.card-secondary-actions-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.card-secondary-actions-row .card-btn {
  font-size: 0.75rem;
  padding: 0.5rem 0.6rem;
}

/* --- How It Works Section on Home Page --- */
.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
  text-align: left;
}

.how-it-works-card {
  background: rgba(17, 24, 39, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
  text-decoration: none;
  color: inherit;
}

.how-it-works-card:hover {
  border-color: rgba(250, 204, 21, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.how-it-works-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.how-it-works-card h3 {
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.how-it-works-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

.how-it-works-card .guide-link-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: auto;
}

/* --- 2-Layer Book Cover Design System (Authenticated Prototype Parity) --- */
.cover, .book-cover-area {
  height: 205px;
  background: linear-gradient(145deg, #222d43, #111827);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
  position: relative;
  border-radius: 12px 12px 0 0;
}

.book, .book-cover-placeholder-styled {
  width: 105px;
  height: 154px;
  border-radius: 3px 7px 7px 3px;
  background: linear-gradient(160deg, #4c6b8d, #17304e);
  box-shadow: 9px 10px 20px rgba(0, 0, 0, 0.55);
  padding: 12px;
  color: #f4f4f4;
  font: 700 11px Georgia, var(--font-header), serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.book:after, .book-cover-placeholder-styled:after {
  content: "";
  display: block;
  height: 3px;
  background: var(--color-primary, #facc15);
  transform: rotate(-13deg);
  margin-top: 8px;
  border-radius: 3px;
}

.real-cover, .book-cover-container img.book-cover {
  position: absolute;
  z-index: 2;
  width: 105px;
  height: 154px;
  object-fit: cover;
  border-radius: 3px 7px 7px 3px;
  box-shadow: 9px 10px 20px rgba(0, 0, 0, 0.55);
}

.cover-preview-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.9);
  font-size: 7.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 5px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  z-index: 1;
}

/* --- Phase 3 Multi-Card Recommendation System Styles --- */
.dna-recommendations-section {
  margin-top: 1.5rem;
}

.dna-next-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.dna-next-label {
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dna-next-sublabel {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rec-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 900px) {
  .rec-cards-grid {
    grid-template-columns: 1fr;
  }
}

.rec-card-item {
  background: rgba(10, 15, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  position: relative;
}

.rec-card-item:hover {
  border-color: rgba(250, 204, 21, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.rec-card-header {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.rec-card-cover-wrap {
  flex-shrink: 0;
}

.rec-card-meta {
  flex: 1;
  min-width: 0;
}

.rec-card-pill-row {
  margin-bottom: 0.35rem;
}

.rec-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.2;
}

.rec-status-pill.pill-owned {
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: #fde047;
}

.rec-status-pill.pill-wishlist {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.rec-status-pill.pill-reading {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.rec-card-title {
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.rec-card-title a {
  color: #ffffff;
  text-decoration: none;
}

.rec-card-title a:hover {
  color: var(--color-primary);
}

.rec-card-author {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.rec-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 0.75rem;
}

.rec-rationale-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rec-rationale-tag {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0.06em;
}

.rec-rationale-block p {
  font-size: 0.8rem;
  color: #d1d5db;
  line-height: 1.4;
  margin: 0;
}

.rec-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.rec-actions-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-rec-action {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-rec-primary {
  background: var(--color-primary);
  color: #0b0f19;
  font-weight: 700;
}

.btn-rec-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.btn-rec-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-rec-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.rec-why-this-link {
  font-size: 0.75rem;
  color: #818cf8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.rec-why-this-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.rec-reject-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 999;
  background: #0f172a;
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 12px;
  padding: 8px;
  width: 170px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rec-reject-popover.hidden {
  display: none !important;
}

.popover-header {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
  padding: 0 4px;
}

.popover-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.75rem;
  padding: 5px 8px;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.popover-btn:hover {
  background: rgba(250, 204, 21, 0.15);
  color: #ffffff;
}

/* --- Reader DNA & Recommendations Independent Component Rules --- */
.what-to-read-next-section {
  margin-bottom: 2.5rem;
  width: 100%;
  box-sizing: border-box;
}

.dna-next-label-row {
  margin-bottom: 0.85rem;
}

.dna-metadata-groups {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.dna-meta-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dna-meta-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dna-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dna-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.3;
  word-break: break-word;
}

.chip-interest {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
}

.chip-overindexed {
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: #fde047;
}

.chip-gap {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* Recommendation Cards Responsive Horizontal Grid */
.rec-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) and (min-width: 651px) {
  .rec-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .rec-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Fixed Bottom Navigation Padding Protection */
@media (max-width: 899px) {
  body {
    padding-bottom: calc(85px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* --- Save All Button Styling --- */
#btn-save-all {
  background: var(--color-primary) !important;
  color: #0b0f19 !important;
  font-family: var(--font-header);
  font-weight: 700 !important;
  border-radius: 20px;
  height: 32px;
  padding: 0.4rem 0.95rem;
  font-size: 0.8rem;
  border: none;
  box-shadow: 0 4px 15px rgba(250, 204, 21, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

#btn-save-all:hover:not(:disabled) {
  background: var(--color-primary-hover) !important;
  color: #0b0f19 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(250, 204, 21, 0.5);
}

#btn-save-all:disabled {
  background: var(--color-success) !important;
  color: #0b0f19 !important;
  opacity: 0.95;
  cursor: default;
}

/* --- Add Owned Books / Build Your Library Dashboard Action Strip --- */
/* --- Add Owned Books / Build Your Library Dashboard Action Strip --- */
.owned-action-card {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 4px solid var(--y, #facc15);
  border-radius: 16px;
  background: #0c111c;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.owned-action-card:hover {
  border-color: rgba(250, 204, 21, 0.35);
  border-left-color: var(--y, #facc15);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.owned-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.25);
  color: var(--y, #facc15);
}

.owned-action-icon .material-symbols-outlined {
  font-size: 22px;
}

.owned-action-copy {
  min-width: 0;
}

.owned-action-copy .eyebrow-label {
  font-size: 10.5px;
  letter-spacing: .1em;
  margin-bottom: 3px;
  text-transform: uppercase;
  color: var(--y, #facc15);
  font-weight: 800;
}

.owned-action-copy h2 {
  margin: 0 0 3px;
  font: 700 18px/1.25 Sora, var(--font-header), sans-serif;
  letter-spacing: -.02em;
  color: #ffffff;
}

.owned-action-copy p {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.4;
}

.owned-card-action {
  flex-shrink: 0;
}

.btn-primary-owned {
  min-height: 42px;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  background: var(--y, #facc15);
  color: #0f172a;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.btn-primary-owned:hover {
  background: #eab308;
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(250, 204, 21, 0.25);
}

.btn-primary-owned:active {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .owned-action-card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
  }
  .owned-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  .owned-action-icon .material-symbols-outlined {
    font-size: 19px;
  }
  .owned-action-copy .eyebrow-label {
    font-size: 9.5px;
  }
  .owned-action-copy h2 {
    font-size: 15px;
  }
  .owned-action-copy p {
    font-size: 11.5px;
  }
  .btn-primary-owned {
    padding: 8px 12px;
    min-height: 36px;
    font-size: 12px;
    border-radius: 10px;
  }
}

/* Extractor Loading & Skeleton Pre-Hydration Utilities */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes skeletonPulse {
  0% { opacity: 0.35; }
  50% { opacity: 0.75; }
  100% { opacity: 0.35; }
}

.skeleton-text {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  animation: skeletonPulse 1.2s ease-in-out infinite;
  vertical-align: middle;
}

.extraction-progress-card {
  margin-bottom: 1.5rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 16px;
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

/* Global Loading Overlay (BUG-047) */
.global-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  opacity: 1;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.global-loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.global-loading-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(250, 204, 21, 0.2);
  border-top-color: var(--y, #facc15);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --- Animated 3D Book Page-Flip Progress Loader --- */
.book-flip-loader {
  width: 54px;
  height: 40px;
  position: relative;
  perspective: 160px;
  margin: 0 auto;
}

.book-flip-cover {
  width: 54px;
  height: 40px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  position: absolute;
  top: 0;
  left: 0;
}

.book-flip-spine {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: rgba(250, 204, 21, 0.45);
  z-index: 2;
}

.book-flip-page {
  width: 25px;
  height: 38px;
  position: absolute;
  top: 1px;
  right: 1px;
  background: #facc15;
  border-radius: 2px 5px 5px 2px;
  transform-origin: left center;
  animation: pageFlip 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  z-index: 3;
}

.book-flip-page:nth-child(2) {
  animation-delay: 0.3s;
}

.book-flip-page:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes pageFlip {
  0% {
    transform: rotateY(0deg);
    opacity: 1;
  }
  65% {
    transform: rotateY(-180deg);
    opacity: 0.95;
    background: #eab308;
  }
  100% {
    transform: rotateY(-180deg);
    opacity: 0;
  }
}

.global-loading-text {
  font-family: Sora, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--t, #f6f7fb);
  letter-spacing: -0.01em;
}

/* User Name Span Truncation (BUG-048) */
#user-name-span {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
  font-weight: 600 !important;
  color: #f6f7fb !important;
}

/* Symmetrical Modal Action Grid (BUG-055) */
.modal-actions-row {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px !important;
  margin-top: 22px !important;
}

.modal-actions-row button,
.modal-actions-row a {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--l, rgba(255, 255, 255, 0.1));
  background: #ffffff0a;
  color: var(--t, #f6f7fb);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.modal-actions-row .btn-find-book-primary {
  background: var(--y, #facc15) !important;
  color: #151515 !important;
  border-color: transparent !important;
  font-weight: 700 !important;
}

.modal-actions-row .btn-affiliate-buy {
  background: rgba(250, 204, 21, 0.15) !important;
  border: 1px solid var(--y, #facc15) !important;
  color: var(--y, #facc15) !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 9px 16px !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}

.modal-actions-row .btn-affiliate-buy:hover {
  background: var(--y, #facc15) !important;
  color: #111420 !important;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.35) !important;
  transform: translateY(-1px) !important;
}

/* User Profile Header Buttons (BUG-054) */
.user-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f6f7fb !important;
  font-size: 13px;
}

.icon-btn-header, #btn-logout, #btn-share-shelf {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #f6f7fb !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex: none !important;
  box-sizing: border-box !important;
  transition: all var(--transition-fast, 0.15s ease) !important;
}

.icon-btn-header span,
.icon-btn-header .material-symbols-outlined {
  color: #f6f7fb !important;
  font-size: 18px !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.icon-btn-header:hover {
  background: #ffffff14 !important;
  border-color: rgba(250, 204, 21, 0.4) !important;
  color: var(--y, #facc15) !important;
}

/* Smooth Multi-Page Transition & View Transitions API Support */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: 120ms ease-out cubic-bezier(0.4, 0, 1, 1) both fade-out;
}

::view-transition-new(root) {
  animation: 160ms ease-in cubic-bezier(0, 0, 0.2, 1) both fade-in;
}

@keyframes fade-out {
  to { opacity: 0; transform: scale(0.995); }
}

@keyframes fade-in {
  from { opacity: 0.88; transform: scale(1.002); }
  to { opacity: 1; transform: scale(1); }
}

/* Fallback Smooth Entrance for Standard Page Mount */
body {
  animation: pageSmoothEntrance 0.16s ease-out;
}

@keyframes pageSmoothEntrance {
  from { opacity: 0.88; }
  to { opacity: 1; }
}

/* ==========================================================================
   SPEC-005: In-App Navigation Guide & In-Shelf Feature Discoverability
   ========================================================================== */

/* In-Shelf Discovery Teaser Card */
.shelf-nudge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.08) 0%, rgba(26, 26, 30, 0.75) 100%);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 1.25rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.shelf-nudge-card:hover {
  transform: translateY(-1px);
  border-color: rgba(250, 204, 21, 0.5);
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.14) 0%, rgba(32, 32, 38, 0.85) 100%);
  box-shadow: 0 4px 16px rgba(250, 204, 21, 0.1);
}

.shelf-nudge-card .nudge-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shelf-nudge-card .nudge-icon {
  font-size: 20px;
  color: var(--y, #facc15);
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.4));
  flex-shrink: 0;
}

.shelf-nudge-card .nudge-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  flex-wrap: wrap;
}

.shelf-nudge-card .nudge-title {
  font-weight: 700;
  color: #ffffff;
}

.shelf-nudge-card .nudge-sub {
  color: var(--m, #9ca3af);
  font-style: italic;
}

.shelf-nudge-card .nudge-arrow {
  font-size: 18px;
  color: var(--y, #facc15);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.shelf-nudge-card:hover .nudge-arrow {
  transform: translateX(3px);
}

/* Navigation Guide Overlay & Spotlight */
.nav-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.nav-guide-overlay.hidden {
  display: none !important;
}

.nav-guide-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 12, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Focused Element Spotlight Glow */
.nav-guide-spotlight-active {
  position: relative !important;
  z-index: 1210 !important;
  outline: 2px solid var(--y, #facc15) !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.45) !important;
  transition: outline 0.25s ease, box-shadow 0.25s ease !important;
}

/* Glassmorphic Guide Card */
.nav-guide-card {
  position: relative;
  z-index: 1220;
  width: 90%;
  max-width: 440px;
  background: rgba(22, 22, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(250, 204, 21, 0.15);
  border-radius: 18px;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: navGuideCardPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes navGuideCardPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.nav-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.nav-guide-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--y, #facc15);
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.25);
  padding: 3px 10px;
  border-radius: 12px;
}

.nav-guide-skip-btn {
  background: transparent;
  border: none;
  color: var(--m, #9ca3af);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.nav-guide-skip-btn:hover {
  color: #ffffff;
}

.nav-guide-title {
  font-family: var(--font-header, Sora, sans-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
}

.nav-guide-desc {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
  margin: 0 0 1.5rem 0;
}

.nav-guide-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.nav-guide-actions .btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-guide-btn-prev {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

.nav-guide-btn-prev:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-guide-btn-next,
.nav-guide-btn-finish {
  background: var(--y, #facc15);
  border: 1px solid var(--y, #facc15);
  color: #121212;
  font-weight: 700;
}

.nav-guide-btn-next:hover,
.nav-guide-btn-finish:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}




