@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

:root {
  --primary: #E0F7FA;
  --primary-mid: #B2EBF2;
  --secondary: #80DEEA;
  --light: #4DD0E1;
  --lighter: #00838F;
  --bg: #ECEEF8;
  --bg-card: #FFFFFF;
  --bg-input: #F5F6FB;
  --text-primary: #1A237E;
  --text-body: #37474F;
  --text-muted: #78909C;
  --text-light: #B0BEC5;
  --border: #D1D5E8;
  --success: #2E7D32;
  --danger: #C62828;
  --shadow-sm: 0 1px 3px rgba(26, 35, 126, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 35, 126, 0.08);
  --shadow-lg: 0 8px 24px rgba(26, 35, 126, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

::selection {
  background: var(--lighter);
  color: var(--primary);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-container {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 60%, var(--secondary) 100%);
  padding: 2rem 1.5rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.header-content {
  position: relative;
  z-index: 1;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.logo-icon {
  font-size: 1.75rem;
}

.app-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.app-subtitle {
  font-size: 0.85rem;
  color: var(--lighter);
  font-weight: 400;
  font-style: italic;
  font-family: 'Libre Baskerville', serif;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.tab-btn {
  flex: 1;
  padding: 0.85rem 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
  position: relative;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--secondary);
  border-radius: 3px 3px 0 0;
}

.tab-icon {
  font-size: 1.2rem;
}

.tab-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 1.25rem;
}

/* Shared Styles */
.view-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.35rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.view-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

/* Loading */
.loading-container {
  padding: 2rem 0;
}

.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.skeleton-line {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--lighter) 25%, var(--bg) 50%, var(--lighter) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 0.75rem;
}

.skeleton-line.wide { width: 80%; }
.skeleton-line.medium { width: 60%; }
.skeleton-line.narrow { width: 40%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.empty-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Current Book View */
.book-hero {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  gap: 1.25rem;
  box-shadow: var(--shadow-md);
  border-top: 4px solid var(--secondary);
  margin-bottom: 1.25rem;
  animation: fadeInUp 0.4s ease both;
}

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

.book-cover-placeholder {
  width: 80px;
  height: 110px;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-mid) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 3px 3px 12px rgba(26, 35, 126, 0.2);
}

.book-emoji {
  font-size: 2rem;
}

.book-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.book-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.2rem;
  color: var(--text-primary);
  line-height: 1.3;
}

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

.book-genre-tag {
  display: inline-block;
  background: var(--lighter);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Progress Section */
.progress-section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.08s;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.progress-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--secondary);
}

.progress-bar-track {
  height: 10px;
  background: var(--lighter);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-mid), var(--secondary));
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 4px;
}

.progress-detail {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Description */
.description-section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.16s;
}

.book-description {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-body);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.24s;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--light);
}

.stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--primary);
  font-family: 'Libre Baskerville', serif;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
}

/* Chapter Grid */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.chapter-btn {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: 'DM Sans', sans-serif;
}

.chapter-btn:hover {
  border-color: var(--light);
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

.chapter-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.chapter-btn.selected .chapter-num {
  color: #fff;
}

.chapter-btn.has-notes {
  border-color: var(--light);
  background: var(--bg-input);
}

.chapter-num {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-body);
}

.note-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  background: var(--secondary);
  border-radius: 50%;
}

.chapter-btn.selected .note-dot {
  background: var(--lighter);
}

/* Notes Section */
.chapter-notes-section {
  animation: fadeInUp 0.3s ease both;
}

.chapter-heading {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--lighter);
}

/* Input Areas */
.note-input-area,
.comment-input-section {
  margin-bottom: 1.25rem;
}

.note-textarea,
.comment-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  resize: vertical;
  background: var(--bg-card);
  color: var(--text-body);
  transition: border-color 0.2s ease;
  margin-bottom: 0.6rem;
}

.note-textarea:focus,
.comment-textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.12);
}

/* Buttons */
.btn-primary {
  padding: 0.7rem 1.4rem;
  background: linear-gradient(135deg, var(--primary-mid), var(--secondary));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 0.55rem 1rem;
  background: var(--bg-input);
  color: var(--text-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--lighter);
}

.btn-accent {
  padding: 0.65rem 1.2rem;
  background: linear-gradient(135deg, var(--light), var(--secondary));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  margin-top: 0.75rem;
}

.btn-accent:hover:not(:disabled) {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-accent:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.3rem;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.btn-icon:hover {
  background: var(--bg-input);
}

.btn-icon-small {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.2rem;
  opacity: 0.4;
  transition: opacity 0.15s ease;
}

.btn-icon-small:hover {
  opacity: 1;
}

.full-width {
  width: 100%;
}

/* Notes List */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.note-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--light);
  animation: fadeInUp 0.3s ease both;
}

.note-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-body);
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.note-date {
  font-size: 0.72rem;
  color: var(--text-light);
}

.note-actions {
  display: flex;
  gap: 0.25rem;
}

.note-edit-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.note-edit-actions {
  display: flex;
  gap: 0.5rem;
}

.empty-notes {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border);
}

/* Discussion View */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.filter-select {
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  background: var(--bg-card);
  color: var(--text-body);
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--secondary);
}

.comment-input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comment-hint {
  font-size: 0.72rem;
  color: var(--text-light);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.3s ease both;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.comment-chapter-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  background: var(--lighter);
  color: var(--primary);
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comment-general-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  background: var(--bg-input);
  color: var(--text-muted);
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comment-date {
  font-size: 0.72rem;
  color: var(--text-light);
}

.comment-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-body);
  white-space: pre-wrap;
}

.comment-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.4rem;
}

.empty-comments {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.empty-icon-small {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

/* Manage View */
.manage-view {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.manage-book-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--secondary);
}

.manage-book-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.manage-book-emoji {
  font-size: 1.6rem;
}

.manage-book-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1rem;
  color: var(--text-primary);
}

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

.progress-update-section {
  margin-bottom: 0.5rem;
}

.progress-update-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.progress-of {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Forms */
.book-form {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 0.75rem;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.3s ease both;
}

.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.input-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-field {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  background: var(--bg-input);
  color: var(--text-body);
  transition: border-color 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.12);
}

.input-field.textarea {
  resize: vertical;
}

.small-input {
  width: 80px;
  text-align: center;
}

/* AI Summary */
.ai-summary-card {
  margin-top: 0.75rem;
  background: linear-gradient(135deg, rgba(26, 35, 126, 0.04), rgba(63, 81, 181, 0.06));
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid var(--lighter);
  animation: fadeInUp 0.3s ease both;
}

.ai-summary-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 0.4rem;
}

.ai-summary-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-body);
  font-style: italic;
}

/* History */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.history-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fadeInUp 0.3s ease both;
}

.history-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.88rem;
  color: var(--text-primary);
}

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

.history-meta {
  text-align: right;
  flex-shrink: 0;
}

.history-progress {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--light);
}

.history-date {
  display: block;
  font-size: 0.7rem;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 640px) {
  .app-header {
    padding: 1.5rem 1rem 1.25rem;
  }

  .app-title {
    font-size: 1.35rem;
  }

  .main-content {
    padding: 1rem;
  }

  .tab-label {
    font-size: 0.62rem;
  }

  .book-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .book-genre-tag {
    margin: 0 auto;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .comment-input-footer {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .comment-hint {
    text-align: center;
  }

  .history-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .history-meta {
    text-align: left;
  }

  .chapter-grid {
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  }
}


<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to your Book Club app! This is your personal reading companion where you can track books, take chapter notes, and journal your thoughts.", "view": "default", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "The Current Book tab shows your active read with a visual progress bar and chapter stats. Right now it's empty — let's set up your first book.", "view": "default", "highlight_selector": ".tab-btn:first-child", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Head to the Manage tab to add your current book. Enter the title, author, genre, and number of chapters.", "view": "default", "highlight_selector": ".tab-btn:nth-child(4)", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Once your book is set, click 'AI Book Summary' to get an instant AI-generated overview and reading guide for your book.", "view": "default", "highlight_selector": ".btn-accent", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "Use the My Notes tab to select any chapter and jot down your thoughts, favorite quotes, or reflections. Your progress updates automatically as you add notes.", "view": "default", "highlight_selector": ".tab-btn:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 6, "narration": "The Discussion tab is your reading journal — post general thoughts or tag comments to specific chapters. Filter by chapter to review your notes.", "view": "default", "highlight_selector": ".tab-btn:nth-child(3)", "wait_for": "tap_to_continue"},
  {"step": 7, "narration": "When you finish a book, go to Manage and set a new one. Your previous book moves to the 'Previously Read' history. Happy reading!", "view": "default", "highlight_selector": ".main-content", "wait_for": "tap_to_continue"}
]
-->

.member-auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
}

.member-auth-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.member-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-auth-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.member-auth-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-word;
}

.member-auth-empty {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.auth-message,
.member-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}

.member-hint {
  margin-top: 0.75rem;
}

@media (max-width: 640px) {
  .member-auth-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

.presence-panel {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
  animation: fadeInUp 0.3s ease both;
}

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

.presence-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.98rem;
  color: var(--text-primary);
}

.presence-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary);
  background: var(--bg-input);
  border-radius: 100px;
  padding: 0.2rem 0.55rem;
}

.presence-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.presence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.presence-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
}

.presence-dot {
  width: 9px;
  height: 9px;
  margin-top: 0.3rem;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.16);
  flex-shrink: 0;
}

.presence-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.presence-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.presence-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .presence-header {
    align-items: flex-start;
    gap: 0.5rem;
    flex-direction: column;
  }

  .presence-chip {
    width: 100%;
    border-radius: var(--radius-md);
  }
}

.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-input);
  color: var(--text-body);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reaction-btn:hover {
  border-color: var(--light);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.reaction-emoji {
  font-size: 0.95rem;
  line-height: 1;
}

.reaction-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 0.7rem;
}

.vote-panel {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.vote-form {
  margin-top: 0.75rem;
}

.vote-standing-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
}

.vote-dot {
  background: var(--secondary);
  box-shadow: 0 0 0 4px rgba(63, 81, 181, 0.16);
}

.vote-leader {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .vote-standing-chip {
    width: 100%;
    border-radius: var(--radius-md);
  }
}

.discussion-view {
  margin-top: 1.5rem;
}

.discussion-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.discussion-actions-inline {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.discussion-questions-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.discussion-question-list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.discussion-question-item {
  line-height: 1.5;
}

.current-book-view {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pace-chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.pace-chart-header {
  margin-bottom: 0.85rem;
}

.pace-chart-canvas {
  width: 100%;
  min-height: 220px;
  display: block;
}

@media (max-width: 640px) {
  .pace-chart-card {
    padding: 1rem;
  }

  .pace-chart-canvas {
    min-height: 190px;
  }
}
