/*
 *= require_tree .
 *= require_self
 */

:root {
  --accent-primary: #6E8854;
  --accent-secondary: #3E4D30;
  --surface-primary: #F2F0E8;
  --surface-secondary: #E5E2D8;
  --foreground-primary: #2D3129;
  --foreground-secondary: #575C50;
  --foreground-muted: #888D82;
  --border-subtle: #D4D7CD;
  --white: #FFFFFF;
  --shadow-color: rgba(0, 0, 0, 0.07);
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-body);
  color: var(--foreground-primary);
  background-color: var(--surface-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  color: var(--accent-secondary);
}

/* Navbar */
.navbar {
  background: var(--surface-primary);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo .logo-link {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-secondary);
}

.navbar-logo .logo-link:hover {
  color: var(--accent-secondary);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground-secondary);
}

.nav-link:hover {
  color: var(--accent-primary);
}

.nav-link-active {
  color: var(--accent-primary);
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: var(--accent-primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

/* Profile Dropdown */
.profile-dropdown {
  position: relative;
}

.profile-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: var(--white);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 100;
  flex-direction: column;
}

.profile-dropdown.open .profile-dropdown-menu {
  display: flex;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground-primary);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
}

.profile-dropdown-item svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

.profile-dropdown-item:hover {
  background: var(--surface-secondary);
}

.profile-dropdown-item--danger {
  color: #D94444;
}

.profile-dropdown-item--danger svg {
  color: #D94444;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--accent-primary);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--accent-secondary);
  color: var(--white);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: var(--surface-secondary);
  color: var(--foreground-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s;
}

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

/* Flash messages */
.flash {
  max-width: 600px;
  margin: 16px auto;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
}

.flash-notice {
  background: #e8f0e0;
  color: var(--accent-secondary);
  border: 1px solid var(--accent-primary);
}

.flash-alert {
  background: #f0e0e0;
  color: #6b2c2c;
  border: 1px solid #c47070;
}

/* Auth pages */
.auth-container {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: 12px;
  padding: 48px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.03),
    0 12px 32px rgba(0, 0, 0, 0.06);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--foreground-primary);
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 15px;
  color: var(--foreground-secondary);
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground-secondary);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--foreground-primary);
  background: var(--surface-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(110, 136, 84, 0.15);
}

.field input::placeholder {
  color: var(--foreground-muted);
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
}

.field-checkbox label {
  font-size: 14px;
  color: var(--foreground-secondary);
}

.auth-submit {
  width: 100%;
  padding: 14px;
  background: var(--accent-primary);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.auth-submit:hover {
  background: var(--accent-secondary);
}

.auth-links {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-links a {
  font-size: 13px;
  color: var(--foreground-muted);
}

.auth-links a:hover {
  color: var(--accent-primary);
}

.auth-errors {
  background: #f0e0e0;
  border: 1px solid #c47070;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}

.auth-errors h3 {
  font-size: 14px;
  font-weight: 600;
  color: #6b2c2c;
  margin-bottom: 4px;
}

.auth-errors ul {
  list-style: none;
  font-size: 13px;
  color: #6b2c2c;
}

/* Minimum password hint */
.field-hint {
  font-size: 12px;
  color: var(--foreground-muted);
}

/* Page layout */
.page-header {
  padding: 40px 48px 0 48px;
  max-width: 1440px;
  margin: 0 auto;
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: var(--foreground-primary);
}

.page-header p {
  font-size: 16px;
  color: var(--foreground-secondary);
  margin-top: 4px;
}

/* Filter bar (legacy — used by connections page) */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  max-width: 1440px;
  margin: 0 auto;
}

.filter-bar.circle-bar {
  padding-top: 8px;
  padding-bottom: 24px;
}

.filter-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.filter-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 1;
}

/* Filter bar (new) */
.filter-bar-wrapper {
  padding: 16px 48px;
  max-width: 1440px;
  margin: 0 auto;
}

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

.filter-dropdowns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-dropdown {
  position: relative;
}

.filter-select {
  appearance: none;
  padding: 7px 34px 7px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground-secondary);
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888D82' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  white-space: nowrap;
}

.filter-select:hover {
  border-color: var(--accent-primary);
  color: var(--foreground-primary);
}

.filter-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(110, 136, 84, 0.12);
}

/* Multiselect dropdown */
.filter-multiselect {
  position: relative;
}

.filter-multiselect .filter-select {
  width: auto;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.filter-multiselect .filter-select.has-selection {
  color: var(--foreground-primary);
  border-color: var(--accent-primary);
}

.filter-multiselect-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  min-width: 200px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 4px 16px var(--shadow-color);
  padding: 6px 0;
}

.filter-multiselect-menu.open {
  display: block;
}

.filter-multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--foreground-secondary);
  cursor: pointer;
  transition: background 0.15s;
}

.filter-multiselect-option:hover {
  background: var(--surface-secondary);
}

.filter-multiselect-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground-muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-clear:hover {
  color: var(--foreground-primary);
  background: var(--surface-secondary);
  border-color: var(--border-subtle);
}

.filter-bar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.filter-count {
  font-size: 13px;
  color: var(--foreground-muted);
  white-space: nowrap;
}

/* Books grid */
.books-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px;
  padding: 0 48px 48px 48px;
  max-width: 1440px;
  margin: 0 auto;
}

/* Book card (matches Pencil Component/MyBookCard: 300px wide) */
.book-card {
  width: 300px;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.03),
    0 12px 32px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

.book-card-cover {
  width: 100%;
  height: 320px;
  background-color: var(--surface-secondary);
  border-radius: 12px 12px 0 0;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.book-card-cover-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
}

.book-card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-card-cover-placeholder span {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 700;
  color: var(--foreground-muted);
  opacity: 0.3;
}

.book-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.book-card-title-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.book-card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground-primary);
  line-height: 1.3;
}

.book-card-author {
  font-size: 13px;
  color: var(--foreground-muted);
}

.book-card-review {
  font-size: 13px;
  color: var(--foreground-secondary);
  line-height: 1.5;
}

.book-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.book-card-genre {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--foreground-muted);
  background: var(--surface-secondary);
  padding: 3px 10px;
  border-radius: 9999px;
}

.book-card-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: none;
  background: var(--surface-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--foreground-muted);
  transition: background 0.2s;
}

.book-card-action-btn:hover {
  background: var(--border-subtle);
}

/* Discover card extras */
.book-card-match {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.book-card-recommender {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.avatar-recommender {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.recommender-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recommender-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground-primary);
}

.recommender-date {
  font-size: 11px;
  color: var(--foreground-muted);
}

/* Book card popup menu (matches Pencil FAB Menu: W2lI8) */
.book-card-menu-wrap {
  position: relative;
}

.book-card-menu {
  display: none;
  position: absolute;
  bottom: 40px;
  right: 0;
  width: 200px;
  background: var(--white);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 10;
  flex-direction: column;
}

.book-card-menu-wrap.open .book-card-menu {
  display: flex;
}

.book-card-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.book-card-menu-item:hover {
  background: var(--surface-secondary);
}

.book-card-menu-item svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

.book-card-menu-item-danger {
  color: #8b3a3a;
}

.book-card-menu-item-danger svg {
  color: #8b3a3a;
}

.book-card-menu-item-danger:hover {
  background: #f5e8e8;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 80px 48px;
  text-align: center;
}

.empty-state-icon {
  color: var(--border-subtle);
}

.empty-state h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--foreground-primary);
}

.empty-state p {
  font-size: 15px;
  color: var(--foreground-secondary);
  line-height: 1.6;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 48px 48px 48px;
}

.pagination-info {
  font-size: 14px;
  color: var(--foreground-muted);
}

/* Book detail page (matches Pencil DnBF6) */
.book-detail-hero {
  display: flex;
  gap: 48px;
  padding: 48px 56px;
  max-width: 1440px;
  margin: 0 auto;
}

.book-detail-cover {
  width: 340px;
  height: 500px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-secondary);
  box-shadow:
    inset 0 3px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.book-detail-cover-img {
  max-width: 87%;
  max-height: 87%;
  object-fit: contain;
  border-radius: 4px;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.3));
}

.book-detail-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.book-detail-title {
  font-family: var(--font-heading);
  font-size: 42px;
  font-weight: 700;
  color: var(--foreground-primary);
  line-height: 1.15;
}

.book-detail-author {
  font-size: 18px;
  color: var(--foreground-secondary);
}

.book-detail-ratio {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ratio-icon {
  color: var(--accent-primary);
}

.ratio-pct {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-primary);
}

.ratio-divider {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
}

.ratio-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ratio-text {
  font-size: 13px;
  color: var(--foreground-secondary);
}

.ratio-bar {
  width: 140px;
  height: 5px;
  background: var(--surface-secondary);
  border-radius: 3px;
}

.ratio-bar-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 3px;
}

.book-detail-tags {
  display: flex;
  gap: 10px;
}

.book-detail-tag {
  padding: 6px 14px;
  background: var(--surface-secondary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground-secondary);
}

.book-detail-desc {
  font-size: 15px;
  color: var(--foreground-secondary);
  line-height: 1.6;
}

.book-detail-meta {
  font-size: 14px;
  color: var(--foreground-muted);
}

.book-detail-actions {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.book-detail-actions form {
  display: flex;
}

.btn-detail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-detail-primary {
  background: var(--accent-primary);
  color: var(--white);
  border: 1.5px solid var(--accent-primary);
}

.btn-detail-primary:hover {
  background: var(--accent-secondary);
}

.btn-detail-secondary {
  background: none;
  color: var(--foreground-muted);
  border: 1.5px solid var(--foreground-muted);
}

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

/* Book detail body (reviews) */
.book-detail-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  padding: 48px 120px;
  max-width: 1440px;
  margin: 0 auto;
}

.book-detail-section {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.book-detail-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.book-detail-section-header h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--foreground-primary);
}

.section-subtitle {
  font-size: 13px;
  color: var(--foreground-muted);
  margin-top: 4px;
  display: block;
}

/* Review cards */
.review-card {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.03),
    0 8px 24px rgba(0, 0, 0, 0.05);
}

.review-card-reviewer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-small {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.avatar-tiny {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.reviewer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.reviewer-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground-primary);
}

.reviewer-date {
  font-size: 12px;
  color: var(--foreground-muted);
}

.reviewer-rating {
  font-size: 13px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 9999px;
}

.reviewer-rating-like {
  color: var(--accent-primary);
  background: rgba(110, 136, 84, 0.1);
}

.reviewer-rating-dislike {
  color: var(--foreground-muted);
  background: var(--surface-secondary);
}

.review-card-body {
  font-size: 16px;
  color: var(--foreground-secondary);
  line-height: 1.6;
}

.review-card-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.review-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--foreground-muted);
  cursor: pointer;
}

.review-action:hover {
  color: var(--foreground-secondary);
}

/* Review comments thread */
.review-comments-thread {
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.review-comment {
  display: flex;
  gap: 10px;
  padding: 12px 0;
}

.review-comment + .review-comment {
  border-top: 1px solid var(--border-subtle);
}

.review-comment-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.review-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-comment-text {
  font-size: 15px;
  color: var(--foreground-secondary);
  line-height: 1.5;
}

/* Comment input */
.review-comment-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.review-comment-form {
  flex: 1;
}

.review-comment-field {
  width: 100%;
  height: 36px;
  border: none;
  outline: none;
  background: var(--surface-primary);
  border-radius: 9999px;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--foreground-primary);
}

.review-comment-field::placeholder {
  color: var(--foreground-muted);
}

/* Review form (new review) */
.review-form {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.03),
    0 8px 24px rgba(0, 0, 0, 0.05);
}

.review-form-input-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
}

.review-form-textarea {
  flex: 1;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--foreground-primary);
  background: var(--surface-primary);
  resize: vertical;
  outline: none;
}

.review-form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(110, 136, 84, 0.15);
}

.review-form-textarea::placeholder {
  color: var(--foreground-muted);
}

.book-card-cover-link {
  text-decoration: none;
  display: block;
}

/* Connections / My Circle */
.degree-section {
  padding: 0 48px;
  max-width: 1440px;
  margin: 0 auto 32px auto;
}

.degree-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.degree-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--foreground-primary);
  margin: 0;
}

.degree-subtitle {
  font-size: 14px;
  color: var(--foreground-muted);
}

.connections-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.connection-card-v2 {
  width: 200px;
  background: var(--white);
  border-radius: 12px;
  padding: 24px 20px 20px 20px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.03),
    0 12px 32px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.connection-card-v2-pending {
  opacity: 0.7;
}

.connection-card-v2-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.connection-card-v2 .avatar-circle {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

.avatar-degree-1 {
  background: var(--accent-primary);
}

.avatar-degree-2 {
  background: var(--foreground-secondary);
}

.avatar-degree-3 {
  background: var(--foreground-muted);
}

.avatar-pending {
  background: var(--surface-secondary) !important;
  color: var(--foreground-muted);
}

.connection-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground-primary);
  text-align: center;
}

.connection-meta {
  font-size: 13px;
  color: var(--foreground-muted);
}

.btn-disconnect {
  padding: 8px 16px;
  background: var(--surface-secondary);
  color: var(--foreground-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-disconnect:hover {
  background: #f5e8e8;
  color: #8b3a3a;
}

.connection-pending-badge {
  padding: 6px 14px;
  background: var(--surface-secondary);
  color: var(--foreground-muted);
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
}

/* Slot dots */
.slot-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.slot-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-subtle);
}

.slot-dot-filled {
  background: var(--accent-primary);
}

/* Edit book page */
.edit-book-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 48px 48px 48px;
}

.edit-book-form {
  margin-top: 24px;
}

.edit-book-columns {
  display: flex;
  gap: 48px;
}

.edit-book-cover-col {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edit-book-cover-preview {
  width: 240px;
  height: 320px;
  background: var(--surface-secondary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.edit-book-cover-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.edit-book-fields-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.edit-book-section h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground-primary);
  margin-bottom: 16px;
}

.edit-book-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edit-book-section .field {
  gap: 6px;
}

.edit-book-status-row {
  display: flex;
  gap: 16px;
}

.edit-book-status-row .field {
  flex: 1;
}

.edit-book-row {
  display: flex;
  gap: 16px;
}

.edit-book-row .field {
  flex: 1;
}

.edit-book-actions {
  display: flex;
  gap: 12px;
  padding-top: 8px;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--foreground-primary);
  background: var(--surface-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(110, 136, 84, 0.15);
}

.field-textarea {
  resize: vertical;
  line-height: 1.5;
}

.field-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23888D82' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* Search page */
.search-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 48px 48px 48px;
}

.search-form {
  margin-top: 24px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 6px 6px 6px 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s;
}

.search-input-wrap:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(110, 136, 84, 0.15);
}

.search-icon {
  color: var(--foreground-muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--foreground-primary);
  background: transparent;
}

.search-input::placeholder {
  color: var(--foreground-muted);
}

/* Search loading */
.search-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 0;
  font-size: 15px;
  color: var(--foreground-muted);
}

.search-loading.visible {
  display: flex;
}

.search-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Search results */
.search-results {
  margin-top: 32px;
}

.search-results-count {
  font-size: 13px;
  color: var(--foreground-muted);
  margin-bottom: 16px;
}

.search-result-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: var(--white);
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.03),
    0 12px 32px rgba(0, 0, 0, 0.06);
}

.search-result-cover {
  width: 64px;
  height: 96px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-secondary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-result-cover-text {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--foreground-muted);
  opacity: 0.3;
}

.search-result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground-primary);
}

.search-result-author {
  font-size: 13px;
  color: var(--foreground-muted);
}

.search-result-genre {
  font-size: 12px;
  color: var(--foreground-muted);
  margin-top: 4px;
}

.search-result-meta {
  font-size: 12px;
  color: var(--foreground-muted);
}

.search-result-actions {
  flex-shrink: 0;
}

.search-result-form {
  display: inline;
}

.search-result-added {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-primary);
}

.btn-small {
  padding: 8px 20px;
  font-size: 13px;
}

/* Manual add form */
.search-no-results {
  margin-top: 32px;
}

.search-no-results p {
  font-size: 14px;
  color: var(--foreground-secondary);
  margin-bottom: 20px;
}

.manual-add-section {
  max-width: 800px;
  margin: 32px auto 0;
}

.manual-add-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  padding: 12px 24px;
  background: none;
  border: 2px solid var(--border-subtle);
  border-radius: 9999px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground-secondary);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.manual-add-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.manual-add-toggle svg {
  flex-shrink: 0;
}

.manual-add-content {
  display: none;
  margin-top: 20px;
}

.manual-add-section.open .manual-add-content {
  display: block;
}

.manual-add-section.open .manual-add-toggle {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.manual-add-form {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.03),
    0 12px 32px rgba(0, 0, 0, 0.06);
}

.manual-add-row {
  display: flex;
  gap: 16px;
}

.manual-add-row .field {
  flex: 1;
}

/* Profile Page */
.profile-header {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 48px 48px;
  max-width: 1440px;
  margin: 0 auto;
}

.profile-avatar-large {
  width: 96px;
  height: 96px;
  min-width: 96px;
  border-radius: 9999px;
  background: var(--accent-primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  font-weight: 700;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.profile-name {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--foreground-primary);
  margin: 0;
}

.profile-stats {
  display: flex;
  gap: 24px;
}

.profile-stat {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground-muted);
}

.profile-connected-badge {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
  padding: 12px 28px;
  border: 2px solid var(--accent-primary);
  border-radius: 9999px;
  white-space: nowrap;
}

.profile-connect-btn {
  border-radius: 9999px;
  padding: 12px 28px;
  white-space: nowrap;
}

.profile-divider {
  height: 1px;
  background: var(--border-subtle);
  max-width: 1440px;
  margin: 0 auto;
}

.profile-shelf {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 48px;
  max-width: 1440px;
  margin: 0 auto;
}

.profile-shelf-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--foreground-primary);
  margin: 0;
}

.profile-books-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px;
}

/* Clickable avatar links */
a.avatar-link {
  text-decoration: none;
}

a.avatar-link .avatar-circle:hover {
  opacity: 0.85;
}
