.bookclub-page {
  padding-bottom: 20px;
}

.bookclub-list-head h1 {
  font-size: 32px;
  font-weight: 900;
  margin: 0 0 18px;
}

.bookclub-list-head-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: space-between;
  margin-bottom: 26px;
}

.bookclub-search {
  align-items: center;
  background: var(--book-panel-strong);
  border: 1px solid var(--book-line);
  border-radius: 12px;
  display: flex;
  flex: 1 1 260px;
  gap: 10px;
  height: 46px;
  max-width: 420px;
  min-width: 0;
  padding: 0 16px;
}

.bookclub-search i {
  color: var(--book-muted);
}

.bookclub-search input {
  background: transparent;
  border: 0;
  color: var(--book-ink);
  flex: 1;
  font: inherit;
  height: 100%;
  /* The theme's general input margin/padding pushed the text off-center. */
  margin: 0;
  min-height: 0;
  min-width: 0;
  outline: 0;
  padding: 0;
}

.bookclub-list-actions {
  display: flex;
  flex-shrink: 0;
  gap: 10px;
}

/* The clubs: cards like little posters — a cover in the club's color (its
   first genre's) with its genres as book spines, or its own picture. */
.bookclub-list {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.bookclub-card {
  background: #fff;
  border: 1px solid var(--book-line);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(40,36,31,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Same lift as .listing-card/.my-book-card/.book-category-tile. */
.bookclub-card:hover {
  box-shadow: 0 20px 40px rgba(42,38,34,0.16);
  transform: translateY(-3px);
}

.bookclub-card[data-open-url] {
  cursor: pointer;
}

.bookclub-card-cover {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,0.28), transparent 45%),
    linear-gradient(135deg, var(--club-tone, var(--book-teal)), color-mix(in srgb, var(--club-tone, var(--book-teal)) 55%, #17191d));
  overflow: hidden;
  position: relative;
}

.bookclub-card-cover.has-image {
  background: var(--book-line);
}

.bookclub-card-cover img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

/* A soft fade so the badges read on any picture. */
.bookclub-card-cover.has-image::after {
  background: linear-gradient(180deg, rgba(0,0,0,0.28), transparent 40%);
  content: '';
  inset: 0;
  position: absolute;
}

.bookclub-card-initial {
  color: rgba(255,255,255,0.92);
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 64px;
  font-weight: 700;
  left: 20px;
  line-height: 1;
  position: absolute;
  text-shadow: 0 6px 20px rgba(0,0,0,0.2);
  top: 46%;
  transform: translateY(-50%);
}

/* The club's genres, as spines standing on the cover's bottom edge. */
.bookclub-card-spines {
  align-items: flex-end;
  bottom: 0;
  display: flex;
  gap: 3px;
  position: absolute;
  right: 18px;
}

.bookclub-card-spines i {
  background: var(--spine);
  border-radius: 3px 3px 0 0;
  box-shadow: inset 2px 0 0 rgba(255,255,255,0.18), inset -2px 0 0 rgba(0,0,0,0.18), 0 0 0 1.5px rgba(255,255,255,0.65);
  display: block;
  height: var(--tall, 36px);
  width: 14px;
}

.bookclub-online-badge {
  align-items: center;
  backdrop-filter: blur(6px);
  background: rgba(23,25,29,0.45);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  gap: 6px;
  left: 12px;
  padding: 4px 10px;
  position: absolute;
  top: 12px;
  z-index: 2;
}

.bookclub-online-badge i {
  background: rgba(255,255,255,0.55);
  border-radius: 50%;
  height: 7px;
  width: 7px;
}

.bookclub-online-badge.is-live i {
  background: #43d17a;
  box-shadow: 0 0 0 3px rgba(67,209,122,0.3);
}

.bookclub-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  gap: 5px;
  padding: 4px 10px;
}

.bookclub-card-cover .bookclub-badge {
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,0.88);
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
}

.bookclub-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px 6px;
}

.bookclub-card-title {
  color: var(--book-ink);
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.bookclub-card-creator {
  color: var(--book-muted);
  font-size: 13px;
  margin: 0;
}

.bookclub-card-desc {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--book-ink);
  display: -webkit-box;
  font-size: 14px;
  line-height: 1.45;
  margin: 2px 0;
  overflow: hidden;
}

.bookclub-card-foot {
  align-items: center;
  border-top: 1px solid var(--book-line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: 10px;
  padding: 12px 18px 14px;
}

.bookclub-card-members {
  align-items: center;
  white-space: nowrap;
  color: var(--book-muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.bookclub-card-members i {
  color: var(--club-tone, var(--book-teal));
}

.bookclub-card-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.bookclub-card-actions form {
  margin: 0;
}

/* (Its own display rules mustn't bring hidden ones back — "Requested" or
   the request form, whichever isn't the case.) */
.bookclub-card-actions [hidden] {
  display: none !important;
}

.bookclub-card-actions .btn {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-height: 0;
  padding: 9px 16px;
}

.bookclub-badge-public {
  color: var(--book-teal);
}

.bookclub-badge-private {
  color: var(--book-ink);
}

.genre-tags .genre-tags-more {
  color: var(--book-muted);
}

.genre-tags .genre-tags-more::before {
  display: none;
}

/* Phones: search on its own line, the two buttons sharing the next. */
@media (max-width: 640px) {
  .bookclub-list-head h1 {
    font-size: 28px;
  }

  .bookclub-search {
    flex-basis: 100%;
    max-width: none;
  }

  .bookclub-list-actions {
    flex: 1 1 100%;
  }

  .bookclub-card-cover {
    aspect-ratio: 2.2 / 1;
  }

  .bookclub-card-initial {
    font-size: 52px;
  }

  .bookclub-list-actions .btn {
    flex: 1;
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
    text-align: center;
  }
}

.bookclub-btn-disabled {
  background: var(--book-line);
  color: var(--book-muted);
  cursor: default;
}

.bookclub-back {
  color: var(--book-ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  margin-bottom: 18px;
}

.bookclub-info-card {
  background: var(--book-panel-strong);
  border: 1px solid var(--book-line);
  border-radius: 16px;
  box-shadow: var(--book-shadow);
  padding: 24px;
}

.bookclub-info-cover {
  height: 200px;
  margin-bottom: 16px;
  width: 200px;
}

.bookclub-chat {
  background: var(--book-panel);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 20px;
  box-shadow: var(--book-shadow);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  min-height: 480px;
  overflow: hidden;
}

.bookclub-chat-header {
  align-items: center;
  border-bottom: 1px solid var(--book-line);
  display: flex;
  gap: 14px;
  padding: 16px 22px;
}

.bookclub-avatar-lg {
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 50%;
  height: 48px;
  object-fit: cover;
  width: 48px;
}

.bookclub-chat-name {
  font-weight: 900;
}

.bookclub-chat-meta {
  color: var(--book-muted);
  font-size: 13px;
}

.bookclub-leave-form {
  margin-left: auto;
}

.bookclub-leave-btn {
  align-items: center;
  background: rgba(181,73,91,0.1);
  border: 1px solid rgba(181,73,91,0.24);
  border-radius: 999px;
  color: var(--book-danger);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  padding: 9px 16px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.bookclub-leave-btn i {
  font-size: 12px;
}

.bookclub-leave-btn:hover {
  background: rgba(181,73,91,0.18);
  border-color: rgba(181,73,91,0.4);
}

.bookclub-messages {
  flex: 1;
}

.bookclub-bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 60%;
}

/* .chat-bubble already caps itself at max-width:60% for chat.php's flat
   (non-wrapped) bubbles. Nested inside .bookclub-bubble-wrap that second
   percentage compounds against an indeterminate shrink-to-fit box, which
   let long messages escape their column and get clipped by .bookclub-chat's
   overflow:hidden — so here the wrap, not the bubble, owns the 60% cap. */
.bookclub-bubble-wrap .chat-bubble {
  max-width: 100%;
}

.bookclub-bubble-author {
  color: var(--book-muted);
  font-size: 12px;
  font-weight: 700;
  padding-left: 4px;
}

.bookclub-messages .chat-bubble-row.theirs .chat-bubble {
  background: var(--bubble-color, var(--book-panel-strong));
  color: #fff;
}

/* .chat-bubble-time normally uses a muted grey/brown tuned for the neutral
   grey "theirs" bubble in 1:1 chat — against a random member color here it
   can clash or lose contrast entirely, so bookclub bubbles get the same
   semi-transparent-white treatment as "mine" bubbles instead, which reads
   fine against any bubble color without touching the random colors themselves. */
.bookclub-messages .chat-bubble-row.theirs .chat-bubble-time {
  color: rgba(255,255,255,0.75);
}

.bookclub-messages .chat-bubble-row.theirs .bookclub-bubble-author {
  color: var(--bubble-color, var(--book-muted));
}

.bookclub-messages .chat-bubble-row.mine {
  padding-right: 16px;
}

.bookclub-messages .chat-bubble-row.mine .chat-bubble {
  background: var(--book-midnight);
}

.bookclub-request-bubble-row .bookclub-bubble-wrap {
  max-width: 420px;
}

.bookclub-request-bubble {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bookclub-request-bubble p {
  margin: 0;
}

.bookclub-request-bubble-date {
  color: var(--book-muted);
  font-size: 12px;
}

.bookclub-create-page .photo-upload-section {
  margin-top: 0;
}

.bookclub-cover-upload {
  align-items: center;
  background: rgba(255,255,255,0.4);
  border: 2px dashed var(--book-line);
  border-radius: 16px;
  display: flex;
  justify-content: center;
  padding: 24px;
}

.bookclub-cover-upload-btn {
  cursor: pointer;
  margin: 0;
}

.bookclub-cover-upload input[type="file"] {
  display: none;
}

.bookclub-privacy-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bookclub-privacy-choice label {
  align-items: center;
  display: flex;
  gap: 8px;
  font-weight: 400;
}

.bookclub-mine-page h1 {
  font-size: 28px;
  font-weight: 900;
  margin: 0 0 18px;
}

.bookclub-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bookclub-card-suffix {
  color: var(--book-orange);
  font-size: 13px;
  font-weight: 800;
}

.bookclub-empty-state {
  align-items: center;
  background: var(--book-panel-strong);
  border: 1px dashed var(--book-line);
  border-radius: 16px;
  color: var(--book-muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 44px 24px;
  text-align: center;
}

.bookclub-empty-state i {
  color: var(--book-orange);
  font-size: 32px;
}

.bookclub-empty-state p {
  font-size: 14px;
  margin: 0;
}

/*
 * Members panel (club chat): reuses the segmented tabs, member rows and
 * moderation buttons that used to live in the separate creator chat.
 */
.bookclub-mod-tabs {
  background: rgba(27,29,34,0.05);
  border-radius: 999px;
  display: flex;
  gap: 4px;
  margin: 14px 22px 4px;
  padding: 4px;
}

.bookclub-mod-tab {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--book-muted);
  cursor: pointer;
  display: flex;
  flex: 1;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  padding: 9px 12px;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.bookclub-mod-tab:hover {
  color: var(--book-ink);
}

.bookclub-mod-tab.is-active {
  background: #fff;
  box-shadow: 0 4px 14px rgba(40,36,31,0.1);
  color: var(--book-ink);
}

.bookclub-mod-count {
  background: var(--book-line);
  border-radius: 999px;
  color: var(--book-ink);
  font-size: 11px;
  min-width: 20px;
  padding: 2px 7px;
  text-align: center;
}

.bookclub-mod-count.is-alert {
  background: var(--book-orange);
  color: #fff;
}

.bookclub-mod-pane[hidden] {
  display: none;
}

/* Members / Banned / Requests lists */
.bookclub-mod-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.bookclub-mod-member {
  align-items: center;
  background: var(--book-panel-strong);
  border: 1px solid var(--book-line);
  border-radius: 16px;
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  transition: box-shadow 0.2s ease;
}

.bookclub-mod-member:hover {
  box-shadow: 0 10px 24px rgba(42,38,34,0.1);
}

.bookclub-mod-member.is-owner {
  background: linear-gradient(90deg, rgba(217,185,138,0.22), var(--book-panel-strong) 60%);
}

.bookclub-mod-member.is-banned {
  border-left: 3px solid var(--book-red);
}

.bookclub-mod-member.is-banned .bookclub-mod-avatar {
  filter: grayscale(0.8);
  opacity: 0.7;
}

.bookclub-mod-avatar {
  background: var(--book-line);
  border-radius: 50%;
  height: 44px;
  object-fit: cover;
  width: 44px;
}

.bookclub-mod-member-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bookclub-mod-member-name {
  color: var(--book-ink);
  font-weight: 800;
}

.bookclub-mod-member-meta {
  align-items: center;
  color: var(--book-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 8px;
}

.bookclub-mod-chip {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  gap: 5px;
  padding: 2px 9px;
}

.bookclub-mod-chip.is-owner {
  background: rgba(217,185,138,0.35);
  color: #8a6420;
}

.bookclub-mod-chip.is-warn {
  background: rgba(201,138,18,0.14);
  color: #c98a12;
}

.bookclub-mod-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.bookclub-mod-btn {
  --tone: var(--book-muted);
  --tone-rgb: 27,29,34;
  align-items: center;
  background: rgba(var(--tone-rgb),0.08);
  border: 1px solid rgba(var(--tone-rgb),0.22);
  border-radius: 999px;
  color: var(--tone);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  padding: 7px 12px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bookclub-mod-btn:hover {
  background: var(--tone);
  border-color: var(--tone);
  color: #fff;
}

.bookclub-mod-btn.is-warn { --tone: #c98a12; --tone-rgb: 201,138,18; }
.bookclub-mod-btn.is-kick { --tone: var(--book-orange); --tone-rgb: 215,111,53; }
.bookclub-mod-btn.is-ban { --tone: var(--book-red); --tone-rgb: 224,48,63; }
.bookclub-mod-btn.is-unban { --tone: var(--book-teal); --tone-rgb: 30,105,104; }

/* Warn / remove / ban dialog */
.bookclub-mod-modal-box {
  --tone: var(--book-muted);
  --tone-bg: rgba(27,29,34,0.06);
  max-width: 440px;
  text-align: left;
}

#bookclub-mod-modal[data-action="warn"] .bookclub-mod-modal-box { --tone: #c98a12; --tone-bg: rgba(201,138,18,0.14); }
#bookclub-mod-modal[data-action="kick"] .bookclub-mod-modal-box { --tone: var(--book-orange); --tone-bg: rgba(215,111,53,0.14); }
#bookclub-mod-modal[data-action="ban"] .bookclub-mod-modal-box { --tone: var(--book-red); --tone-bg: rgba(224,48,63,0.12); }

.bookclub-mod-modal-icon {
  align-items: center;
  animation: bookclub-mod-pop 0.3s ease;
  background: var(--tone-bg);
  border-radius: 50%;
  color: var(--tone);
  display: flex;
  font-size: 20px;
  height: 52px;
  justify-content: center;
  margin-bottom: 12px;
  width: 52px;
}

.bookclub-mod-modal-title {
  font-size: 19px;
  font-weight: 900;
  margin: 0 0 6px;
}

.bookclub-mod-modal-text {
  color: var(--book-muted);
  font-size: 14px;
  margin: 0 0 16px;
}

.bookclub-mod-modal-box textarea {
  min-height: 84px;
}

.bookclub-mod-modal-submit {
  background: var(--tone);
  color: #fff;
}

.bookclub-mod-modal-submit:hover {
  filter: brightness(0.92);
}

@keyframes bookclub-mod-pop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

/* Member side: warnings inline in the club chat (everyone sees them; the
   warned member's own one is filled amber and pulses until acknowledged),
   removed/banned notice on the club page. */
.bookclub-chat-warning {
  align-items: center;
  align-self: center;
  background: rgba(201,138,18,0.08);
  border: 1px dashed rgba(201,138,18,0.45);
  border-radius: 14px;
  color: var(--book-ink);
  display: flex;
  gap: 10px;
  max-width: 520px;
  padding: 8px 14px 8px 8px;
  width: 100%;
}

.bookclub-chat-warning-icon {
  align-items: center;
  background: rgba(201,138,18,0.16);
  border-radius: 50%;
  color: #c98a12;
  display: flex;
  flex-shrink: 0;
  font-size: 12px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.bookclub-chat-warning-body {
  flex: 1;
  font-size: 13px;
  min-width: 0;
}

.bookclub-chat-warning-body p {
  margin: 0;
}

.bookclub-chat-warning-body p a {
  color: var(--book-ink);
}

.bookclub-chat-warning-body q {
  color: var(--book-muted);
  display: block;
  font-style: italic;
  quotes: "„" "“";
}

.bookclub-chat-warning-time {
  color: var(--book-muted);
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}

.bookclub-chat-warning.is-me {
  background: linear-gradient(135deg, #d99a1e, #c27d0c);
  border: 0;
  box-shadow: 0 10px 26px rgba(201,138,18,0.35);
  color: #fff;
  padding: 12px 16px 12px 12px;
}

.bookclub-chat-warning.is-me .bookclub-chat-warning-icon {
  background: #fff;
  color: #c27d0c;
  font-size: 15px;
  height: 36px;
  width: 36px;
}

.bookclub-chat-warning.is-me .bookclub-chat-warning-body {
  font-size: 14px;
}

.bookclub-chat-warning.is-me .bookclub-chat-warning-body q,
.bookclub-chat-warning.is-me .bookclub-chat-warning-time {
  color: rgba(255,255,255,0.88);
}

.bookclub-chat-warning.is-unseen {
  animation: bookclub-warning-pulse 2s ease-in-out infinite;
}

.bookclub-chat-warning-ack button {
  background: #fff;
  border: 0;
  border-radius: 999px;
  color: #c27d0c;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 14px;
}

.bookclub-chat-warning-ack button:hover {
  background: rgba(255,255,255,0.85);
}

@keyframes bookclub-warning-pulse {
  0%, 100% { box-shadow: 0 10px 26px rgba(201,138,18,0.35), 0 0 0 0 rgba(201,138,18,0.45); }
  50% { box-shadow: 0 10px 26px rgba(201,138,18,0.35), 0 0 0 8px rgba(201,138,18,0); }
}

.bookclub-mod-notice {
  --tone: var(--book-orange);
  --tone-bg: rgba(215,111,53,0.1);
  align-items: flex-start;
  background: var(--tone-bg);
  border: 1px solid var(--tone);
  border-radius: 14px;
  display: flex;
  gap: 12px;
  margin: 4px 0 16px;
  padding: 12px 14px;
}

.bookclub-mod-notice.is-ban {
  --tone: var(--book-red);
  --tone-bg: rgba(224,48,63,0.08);
}

.bookclub-mod-notice > i {
  color: var(--tone);
  font-size: 18px;
  margin-top: 2px;
}

.bookclub-mod-notice div {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  gap: 3px;
}

.bookclub-mod-notice q {
  font-style: italic;
  quotes: "„" "“";
}

.bookclub-mod-notice span {
  color: var(--book-muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .bookclub-mod-btn span {
    display: none;
  }

  .bookclub-mod-tabs {
    margin: 12px 14px 4px;
  }

  .bookclub-mod-tab {
    font-size: 12px;
    gap: 5px;
    padding: 8px 6px;
  }

  .bookclub-mod-member {
    gap: 10px;
    padding: 10px;
  }
}

/*
 * Club owner's member menu in the club chat (right-click / long-press a
 * member's avatar or name). Floats next to the cursor on desktop; on touch
 * it slides up from the bottom as a sheet over a dimmed backdrop.
 */
.bookclub-chat [data-mod-user] {
  cursor: context-menu;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.bookclub-member-menu {
  background: var(--book-panel-strong);
  backdrop-filter: blur(14px);
  border: 1px solid var(--book-line);
  border-radius: 16px;
  box-shadow: 0 22px 50px rgba(40,36,31,0.22);
  display: flex;
  flex-direction: column;
  min-width: 240px;
  opacity: 0;
  padding: 6px;
  position: fixed;
  transform: scale(0.94);
  transform-origin: top left;
  transition: opacity 0.14s ease, transform 0.14s ease;
  /* Above the app top bar (80), below the confirm/moderation modals (100). */
  z-index: 91;
}

.bookclub-member-menu[hidden] {
  display: none;
}

.bookclub-member-menu.is-open {
  opacity: 1;
  transform: scale(1);
}

.bookclub-member-menu-grip {
  display: none;
}

.bookclub-member-menu-head {
  align-items: center;
  border-bottom: 1px solid var(--book-line);
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
  padding: 8px 10px 10px;
}

.bookclub-member-menu-avatar {
  background: var(--book-line);
  border-radius: 50%;
  height: 36px;
  object-fit: cover;
  width: 36px;
}

.bookclub-member-menu-head div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bookclub-member-menu-name {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookclub-member-menu-meta {
  color: var(--book-muted);
  font-size: 12px;
}

.bookclub-member-menu-meta.is-banned {
  color: var(--book-red);
  font-weight: 700;
}

.bookclub-member-menu-item {
  --tone: var(--book-ink);
  align-items: center;
  background: none;
  border: 0;
  border-radius: 10px;
  color: var(--tone);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  gap: 12px;
  justify-content: flex-start;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.bookclub-member-menu-item i {
  color: var(--tone);
  opacity: 0.85;
  text-align: center;
  width: 16px;
}

.bookclub-member-menu-item:hover,
.bookclub-member-menu-item:focus-visible {
  background: var(--book-line);
  color: var(--tone);
  outline: 0;
}

.bookclub-member-menu-item.is-warn { --tone: #c98a12; }
.bookclub-member-menu-item.is-kick { --tone: var(--book-orange); }
.bookclub-member-menu-item.is-ban { --tone: var(--book-red); }
.bookclub-member-menu-item.is-unban { --tone: var(--book-teal); }

.bookclub-member-menu-backdrop {
  background: rgba(23,25,29,0.35);
  inset: 0;
  position: fixed;
  z-index: 90;
}

.bookclub-member-menu-backdrop[hidden] {
  display: none;
}

.bookclub-member-menu.is-sheet {
  border-radius: 22px 22px 0 0;
  bottom: 0;
  left: 0;
  max-width: none;
  padding: 8px 10px calc(14px + env(safe-area-inset-bottom));
  right: 0;
  top: auto;
  transform: translateY(100%);
  transition: opacity 0.2s ease, transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.bookclub-member-menu.is-sheet.is-open {
  transform: translateY(0);
}

.bookclub-member-menu.is-sheet .bookclub-member-menu-grip {
  align-self: center;
  background: var(--book-line);
  border-radius: 999px;
  display: block;
  height: 5px;
  margin: 2px 0 8px;
  width: 42px;
}

.bookclub-member-menu.is-sheet .bookclub-member-menu-item {
  font-size: 16px;
  padding: 14px 12px;
}

/* Club chat: messages area + floating "@" button share this wrapper. */
.bookclub-chat-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.bookclub-chat-body .chat-messages {
  flex: 1;
  min-height: 0;
}

/* Header "Members" button (badge = open join requests, owner only). */
.bookclub-members-btn {
  align-items: center;
  background: rgba(30,105,104,0.1);
  border: 1px solid rgba(30,105,104,0.22);
  border-radius: 999px;
  color: var(--book-teal);
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  margin-left: auto;
  padding: 9px 16px;
  position: relative;
  transition: background 0.15s ease;
}

.bookclub-members-btn:hover {
  background: rgba(30,105,104,0.18);
}

.bookclub-members-btn + .bookclub-leave-form {
  margin-left: 0;
}

.bookclub-members-btn-badge {
  background: var(--book-orange);
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  min-width: 20px;
  padding: 1px 6px;
  position: absolute;
  right: -6px;
  text-align: center;
  top: -8px;
}

/* @mentions inside messages: just the name in bold, like WhatsApp — the
   message itself looks like any other one. */
.bookclub-mention {
  font-weight: 800;
}

.bookclub-chat-warning .bookclub-mention {
  color: var(--book-teal);
}

.bookclub-chat-warning.is-me .bookclub-mention {
  color: #fff;
}

/* Where a jump (the "@" button, "Show warning") lands. */
.chat-bubble-row.is-flash .chat-bubble,
.bookclub-chat-warning.is-flash {
  animation: bookclub-flash 1.4s ease;
}

@keyframes bookclub-flash {
  0%, 100% { filter: none; }
  20%, 60% { filter: brightness(0.9); }
}
/* "@" button, bottom right of the chat — small, light and still, like
   WhatsApp's mention button. */
.bookclub-mention-jump {
  align-items: center;
  background: #fff;
  border: 1px solid var(--book-line);
  border-radius: 50%;
  bottom: 14px;
  box-shadow: 0 2px 8px rgba(40,36,31,0.16);
  color: var(--book-teal);
  cursor: pointer;
  display: flex;
  height: 42px;
  justify-content: center;
  position: absolute;
  right: 20px;
  transition: opacity 0.2s ease, background 0.15s ease;
  width: 42px;
  z-index: 5;
}

.bookclub-mention-jump[hidden] {
  display: none;
}

.bookclub-mention-jump:hover {
  background: #f6f6f4;
}

.bookclub-mention-jump.is-leaving {
  opacity: 0;
}

.bookclub-mention-jump-at {
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  margin-top: -2px;
}

.bookclub-mention-jump-count {
  background: var(--book-teal);
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  min-width: 18px;
  padding: 4px 5px;
  position: absolute;
  right: -4px;
  text-align: center;
  top: -6px;
}

/* Composer locked until a warning is acknowledged */
.chat-input-bar {
  position: relative;
}

.bookclub-composer-lock {
  align-items: center;
  background: linear-gradient(90deg, rgba(201,138,18,0.16), rgba(201,138,18,0.05));
  border: 1px solid rgba(201,138,18,0.32);
  border-radius: 14px;
  display: flex;
  flex-basis: 100%;
  font-size: 13px;
  font-weight: 700;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 8px 8px 10px;
}

.bookclub-composer-lock > span:nth-child(2) {
  flex: 1;
}

.bookclub-composer-lock-icon {
  align-items: center;
  background: #c98a12;
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex-shrink: 0;
  font-size: 12px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.bookclub-composer-lock-jump {
  background: #c98a12;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 12px;
}

.chat-input-bar.is-locked .chat-input-field {
  background: rgba(27,29,34,0.04);
  opacity: 0.55;
}

.chat-input-bar.is-locked .chat-send-btn {
  background: var(--book-line);
  color: var(--book-muted);
  cursor: not-allowed;
}

/* "@" mention picker above the composer */
.bookclub-mention-picker {
  background: var(--book-panel-strong);
  backdrop-filter: blur(14px);
  border: 1px solid var(--book-line);
  border-radius: 18px;
  bottom: calc(100% - 6px);
  box-shadow: 0 -10px 40px rgba(40,36,31,0.18);
  left: 22px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  transform: translateY(8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  width: min(360px, calc(100% - 44px));
  z-index: 6;
}

.bookclub-mention-picker[hidden] {
  display: none;
}

.bookclub-mention-picker.is-open {
  opacity: 1;
  transform: translateY(0);
}

.bookclub-mention-picker-head {
  align-items: center;
  border-bottom: 1px solid var(--book-line);
  display: flex;
  gap: 10px;
  padding: 10px 12px;
}

.bookclub-mention-picker-at {
  align-items: center;
  background: linear-gradient(140deg, var(--book-teal), var(--book-midnight));
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex-shrink: 0;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.bookclub-mention-picker-head input[type="text"] {
  background: transparent;
  border: 0;
  margin: 0;
  min-height: 30px;
  padding: 4px 0;
}

.bookclub-mention-picker-list {
  list-style: none;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
}

.bookclub-mention-picker-item {
  align-items: center;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 7px 10px;
}

.bookclub-mention-picker-item.is-active {
  background: rgba(30,105,104,0.1);
}

.bookclub-mention-picker-item img {
  background: var(--book-line);
  border-radius: 50%;
  height: 30px;
  object-fit: cover;
  width: 30px;
}

.bookclub-mention-picker-name {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
}

.bookclub-mention-picker-name mark {
  background: none;
  color: var(--book-teal);
  font-weight: 900;
}

.bookclub-mention-picker-owner {
  color: #b8893a;
  font-size: 12px;
}

.bookclub-mention-picker-empty {
  color: var(--book-muted);
  font-size: 13px;
  margin: 0;
  padding: 12px 16px 16px;
}

/* Members panel: drawer from the right, bottom sheet on phones */
.bookclub-panel-backdrop {
  background: rgba(23,25,29,0.35);
  inset: 0;
  opacity: 0;
  position: fixed;
  transition: opacity 0.25s ease;
  z-index: 88;
}

.bookclub-panel-backdrop.is-open {
  opacity: 1;
}

.bookclub-panel-backdrop[hidden],
.bookclub-panel[hidden] {
  display: none;
}

.bookclub-panel {
  background: var(--book-panel-strong);
  backdrop-filter: blur(18px);
  bottom: 0;
  box-shadow: -20px 0 60px rgba(40,36,31,0.2);
  display: flex;
  flex-direction: column;
  max-width: 100%;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  width: 420px;
  z-index: 89;
}

.bookclub-panel.is-open {
  transform: translateX(0);
}

.bookclub-panel-head {
  align-items: center;
  border-bottom: 1px solid var(--book-line);
  display: flex;
  gap: 10px;
  padding: 18px 20px;
}

.bookclub-panel-head h2 {
  align-items: center;
  display: flex;
  flex: 1;
  font-size: 18px;
  font-weight: 900;
  gap: 10px;
  margin: 0;
  min-width: 0;
}

.bookclub-panel-head h2 i {
  color: var(--book-teal);
}

.bookclub-panel-grip {
  display: none;
}

.bookclub-panel-close {
  align-items: center;
  background: var(--book-line);
  border: 0;
  border-radius: 50%;
  color: var(--book-ink);
  cursor: pointer;
  display: flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.bookclub-panel .bookclub-mod-tabs {
  margin: 14px 20px 4px;
}

.bookclub-panel-pane {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px 24px;
}

.bookclub-panel-pane[hidden] {
  display: none;
}

.bookclub-panel-you {
  color: var(--book-muted);
  font-weight: 600;
}

.bookclub-card-requests {
  align-items: center;
  align-self: flex-start;
  background: rgba(215,111,53,0.12);
  border-radius: 999px;
  color: var(--book-orange);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  margin-top: 4px;
  padding: 4px 10px;
}

@media (max-width: 640px) {
  .bookclub-members-btn span,
  .bookclub-leave-btn span {
    display: none;
  }

  .bookclub-members-btn,
  .bookclub-leave-btn {
    padding: 10px 12px;
  }

  .bookclub-panel {
    border-radius: 22px 22px 0 0;
    height: 84vh;
    left: 0;
    top: auto;
    transform: translateY(100%);
    width: auto;
  }

  .bookclub-panel.is-open {
    transform: translateY(0);
  }

  .bookclub-panel-head {
    flex-wrap: wrap;
    padding: 8px 16px 14px;
  }

  .bookclub-panel-grip {
    background: var(--book-line);
    border-radius: 999px;
    display: block;
    height: 5px;
    margin: 0 auto 6px;
    width: 42px;
    flex-basis: 42px;
  }

  .bookclub-panel-head h2 {
    flex-basis: calc(100% - 50px);
  }

  .bookclub-panel .bookclub-mod-tabs {
    margin: 12px 14px 4px;
  }

  .bookclub-panel-pane {
    padding: 12px 14px 20px;
  }

  .bookclub-mention-picker {
    left: 14px;
    width: calc(100% - 28px);
  }

  .bookclub-mention-jump {
    right: 14px;
  }
}

/*
 * Owner's moderation view inside the club (Chat | Moderation switch in the
 * header) — same look as the former standalone creator chat: activity
 * timeline, member rows with warn / remove / ban, requests and bans.
 */
.bookclub-view-toggle {
  background: rgba(27,29,34,0.06);
  border-radius: 999px;
  display: inline-flex;
  flex-shrink: 0;
  gap: 2px;
  margin-left: auto;
  padding: 3px;
  position: relative;
}

/* The white pill that glides under the active button (bookclub.js sets its
   width and position), with a little overshoot at the end. */
.bookclub-view-toggle-pill {
  background: #fff;
  border-radius: 999px;
  bottom: 3px;
  box-shadow: 0 4px 14px rgba(40,36,31,0.12);
  left: 0;
  position: absolute;
  top: 3px;
  transition: transform 0.42s cubic-bezier(0.34, 1.45, 0.5, 1), width 0.42s cubic-bezier(0.34, 1.45, 0.5, 1);
  width: 0;
}

.bookclub-view-toggle-pill.no-transition {
  transition: none;
}

.bookclub-view-toggle button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--book-muted);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
  padding: 8px 14px;
  position: relative;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.bookclub-view-toggle button {
  z-index: 1;
}

.bookclub-view-toggle button.is-active {
  color: var(--book-ink);
}

.bookclub-view-toggle button i {
  transition: color 0.25s ease;
}

.bookclub-view-toggle button i.is-popping {
  animation: bookclub-icon-pop 0.5s cubic-bezier(0.34, 1.6, 0.5, 1);
}

/* Chat icon: the speech bubbles hop up and wobble, like a message landing. */
.bookclub-view-toggle button[data-view="chat"] i.is-popping {
  animation: bookclub-chat-icon-pop 0.6s cubic-bezier(0.34, 1.5, 0.5, 1);
  transform-origin: 50% 80%;
}

.bookclub-view-toggle button[data-view="chat"].is-active i {
  color: var(--book-teal);
}

.bookclub-view-toggle button[data-view="moderation"].is-active i {
  color: var(--book-teal);
}

.bookclub-view-toggle + .bookclub-leave-form {
  margin-left: 0;
}

.bookclub-chat-view,
.bookclub-mod-view {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.bookclub-chat-view[hidden],
.bookclub-mod-view[hidden] {
  display: none;
}

.bookclub-mod-view .bookclub-mod-pane {
  flex: 1;
  min-height: 0;
}

/* Timeline events */
.bookclub-event {
  --tone: var(--book-muted);
  --tone-bg: rgba(27,29,34,0.05);
  align-items: flex-start;
  align-self: center;
  background: var(--book-panel-strong);
  border: 1px solid var(--book-line);
  border-left: 3px solid var(--tone);
  border-radius: 14px;
  display: flex;
  gap: 12px;
  max-width: 560px;
  padding: 10px 14px 10px 10px;
  width: 100%;
}

.bookclub-event-teal { --tone: var(--book-teal); --tone-bg: rgba(30,105,104,0.12); }
.bookclub-event-amber { --tone: #c98a12; --tone-bg: rgba(201,138,18,0.14); }
.bookclub-event-orange { --tone: var(--book-orange); --tone-bg: rgba(215,111,53,0.14); }
.bookclub-event-red { --tone: var(--book-red); --tone-bg: rgba(224,48,63,0.12); }

.bookclub-event-icon {
  align-items: center;
  background: var(--tone-bg);
  border-radius: 50%;
  color: var(--tone);
  display: flex;
  flex-shrink: 0;
  font-size: 13px;
  height: 32px;
  justify-content: center;
  width: 32px;
}

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

.bookclub-event-body p {
  font-size: 14px;
  line-height: 32px;
  margin: 0;
}

.bookclub-event-body p a {
  color: var(--book-ink);
}

.bookclub-event-note {
  border-left: 2px solid var(--tone, var(--book-line));
  color: var(--book-muted);
  display: block;
  font-size: 13px;
  font-style: italic;
  margin: 2px 0 4px;
  padding-left: 10px;
  quotes: "„" "“";
}

.bookclub-event-time {
  color: var(--book-muted);
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 32px;
}

.bookclub-mod-list-pane {
  flex: 1;
  overflow-y: auto;
  padding: 14px 22px 22px;
}

.bookclub-mod-divider span i {
  color: var(--book-orange);
  margin-right: 4px;
}

@media (max-width: 640px) {
  .bookclub-view-toggle button span {
    display: none;
  }

  /* Four tabs don't fit with icons on a phone — labels and counts only. */
  .bookclub-mod-view .bookclub-mod-tabs {
    gap: 2px;
    margin: 12px 10px 4px;
  }

  .bookclub-mod-view .bookclub-mod-tab {
    font-size: 11px;
    gap: 4px;
    min-width: 0;
    padding: 8px 4px;
  }

  .bookclub-mod-view .bookclub-mod-tab i {
    display: none;
  }

  .bookclub-mod-view .bookclub-mod-count {
    font-size: 10px;
    min-width: 16px;
    padding: 1px 5px;
  }

  .bookclub-view-toggle button {
    padding: 9px 12px;
  }

  .bookclub-mod-list-pane {
    padding: 12px 14px 18px;
  }
}

/* Chat <-> Moderation view switch: the outgoing view drifts away and fades,
   the incoming one slides in from the opposite side, then its rows
   cascade in (--stagger set per row by bookclub.js). */
.bookclub-chat-view.is-view-out-left,
.bookclub-mod-view.is-view-out-left {
  animation: bookclub-view-out-left 0.16s ease-in forwards;
}

.bookclub-chat-view.is-view-out-right,
.bookclub-mod-view.is-view-out-right {
  animation: bookclub-view-out-right 0.16s ease-in forwards;
}

.bookclub-chat-view.is-view-in-right,
.bookclub-mod-view.is-view-in-right {
  animation: bookclub-view-in-right 0.38s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.bookclub-chat-view.is-view-in-left,
.bookclub-mod-view.is-view-in-left {
  animation: bookclub-view-in-left 0.38s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.bookclub-mod-member.is-staggered,
.bookclub-event.is-staggered {
  animation: bookclub-row-in 0.42s cubic-bezier(0.2, 0.9, 0.3, 1) backwards;
  animation-delay: var(--stagger, 0ms);
}

@keyframes bookclub-view-out-left {
  to { opacity: 0; transform: translateX(-28px) scale(0.98); filter: blur(2px); }
}

@keyframes bookclub-view-out-right {
  to { opacity: 0; transform: translateX(28px) scale(0.98); filter: blur(2px); }
}

@keyframes bookclub-view-in-right {
  from { opacity: 0; transform: translateX(40px) scale(0.98); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes bookclub-view-in-left {
  from { opacity: 0; transform: translateX(-40px) scale(0.98); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes bookclub-row-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes bookclub-chat-icon-pop {
  0% { transform: translateY(0) scale(1) rotate(0deg); }
  30% { transform: translateY(-5px) scale(1.35) rotate(-10deg); }
  50% { transform: translateY(0) scale(0.92) rotate(8deg); }
  70% { transform: translateY(-2px) scale(1.08) rotate(-4deg); }
  100% { transform: translateY(0) scale(1) rotate(0deg); }
}

@keyframes bookclub-icon-pop {
  0% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(1.45) rotate(-12deg); }
  70% { transform: scale(0.9) rotate(6deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .bookclub-view-toggle-pill {
    transition: none;
  }

  .bookclub-chat-view,
  .bookclub-mod-view,
  .bookclub-mod-member.is-staggered,
  .bookclub-event.is-staggered,
  .bookclub-view-toggle button i.is-popping {
    animation: none !important;
  }
}

/* "Show" in the activity's "N open join requests" line — a text link, not a button. */
.bookclub-mod-divider-link {
  background: none;
  border: 0;
  color: var(--book-teal);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bookclub-mod-divider-link:hover {
  background: none;
  color: var(--book-ink);
}

/* "X joined the club" — a quiet centered system line in the club chat,
   like WhatsApp's. */
.bookclub-chat-system {
  align-self: center;
  display: flex;
  justify-content: center;
  max-width: 100%;
}

.bookclub-chat-system span {
  background: rgba(30,105,104,0.08);
  border-radius: 999px;
  color: var(--book-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  text-align: center;
}

.bookclub-chat-system i {
  color: var(--book-teal);
  margin-right: 4px;
}

.bookclub-chat-system a {
  color: var(--book-ink);
}

/* ---------------- Genre picker (create a club, wander shelf genres) ---------------- */

.genre-picker {
  display: grid;
  gap: 14px;
}

/* A little shelf: five slots that fill with a spine per picked genre. */
.genre-shelf {
  background: linear-gradient(180deg, #f7f2ea 0%, #efe6d9 100%);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), inset 0 -18px 30px -24px rgba(90,60,30,0.25);
  overflow: hidden;
  padding: 18px 18px 0;
}

.genre-shelf-books {
  align-items: flex-end;
  display: flex;
  gap: 7px;
  min-height: 96px;
  padding: 0 4px;
}

.genre-spine {
  align-items: center;
  background-color: var(--spine, var(--book-teal));
  background-image: linear-gradient(180deg, transparent 9px, rgba(255,255,255,0.28) 9px, rgba(255,255,255,0.28) 11px, transparent 11px, transparent calc(100% - 11px), rgba(255,255,255,0.28) calc(100% - 11px), rgba(255,255,255,0.28) calc(100% - 9px), transparent calc(100% - 9px));
  border: 0;
  border-radius: 4px 4px 2px 2px;
  box-shadow: inset 4px 0 0 rgba(255,255,255,0.12), inset -4px 0 0 rgba(0,0,0,0.16), 0 4px 10px rgba(40,30,20,0.18);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  height: var(--tall, 84px);
  justify-content: center;
  padding: 14px 0;
  transform-origin: bottom center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 40px;
}

.genre-spine span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  max-height: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: rotate(180deg);
  white-space: nowrap;
  writing-mode: vertical-rl;
}

.genre-spine[data-genre]:hover,
.genre-spine[data-genre]:focus-visible {
  box-shadow: inset 4px 0 0 rgba(255,255,255,0.12), inset -4px 0 0 rgba(0,0,0,0.16), 0 10px 18px rgba(40,30,20,0.25);
  outline: none;
  transform: translateY(-6px) rotate(-3deg);
}

.genre-spine.is-empty {
  background: transparent;
  border: 2px dashed rgba(23,25,29,0.16);
  box-shadow: none;
  color: rgba(23,25,29,0.22);
  cursor: default;
  font-size: 12px;
  height: 58px;
  padding: 0;
}

.genre-spine.is-new {
  animation: genre-spine-in 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes genre-spine-in {
  from {
    opacity: 0;
    transform: translateY(-26px) rotate(6deg);
  }
}

.genre-shelf-board {
  background: linear-gradient(180deg, #d9b98a 0%, #b88d58 100%);
  box-shadow: 0 6px 10px -4px rgba(90,60,30,0.35);
  height: 12px;
  margin: 0 -18px;
}

.genre-picker-status {
  align-items: center;
  display: flex;
  gap: 10px;
  margin: 0;
}

.genre-picker-count {
  background: var(--book-ink);
  border-radius: 999px;
  color: #fff;
  flex-shrink: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  padding: 4px 11px;
  transition: background 0.2s ease;
}

.genre-picker.is-full .genre-picker-count {
  background: var(--book-teal);
}

.genre-picker-count.is-nudged {
  animation: genre-count-nudge 0.4s ease;
}

@keyframes genre-count-nudge {
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.genre-picker-hint {
  color: var(--book-muted);
  font-size: 13px;
  line-height: 1.4;
}

.genre-picker-error {
  color: var(--book-error);
  font-size: 13px;
  font-weight: 700;
  margin: 8px 0 0;
}

.genre-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-chip {
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--book-line);
  border-radius: 999px;
  color: var(--book-ink);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  margin: 0;
  padding: 6px 13px 6px 7px;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.genre-chip input {
  height: 1px;
  margin: 0;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.genre-chip-mark {
  align-items: center;
  border: 2px solid var(--spine, var(--book-teal));
  border-radius: 50%;
  color: transparent;
  display: flex;
  flex-shrink: 0;
  font-size: 9px;
  height: 18px;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  width: 18px;
}

.genre-chip:hover {
  border-color: var(--spine, var(--book-teal));
}

.genre-chip:active {
  transform: scale(0.97);
}

.genre-chip:has(input:checked) {
  background: color-mix(in srgb, var(--spine, var(--book-teal)) 10%, #fff);
  border-color: var(--spine, var(--book-teal));
}

.genre-chip input:checked ~ .genre-chip-mark {
  background: var(--spine, var(--book-teal));
  color: #fff;
}

.genre-chip input:focus-visible ~ .genre-chip-mark {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--spine, var(--book-teal)) 35%, transparent);
}

.genre-chip:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.4;
}

.genre-chip:has(input:disabled):hover {
  border-color: var(--book-line);
}

/* A club's genres as small tags (club cards, the wander shelf). */
.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.genre-tags li {
  align-items: center;
  background: color-mix(in srgb, var(--spine, var(--book-teal)) 12%, transparent);
  border-radius: 999px;
  color: var(--spine, var(--book-teal));
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  gap: 5px;
  padding: 3px 9px 3px 7px;
}

.genre-tags li::before {
  background: var(--spine, var(--book-teal));
  border-radius: 2px;
  content: '';
  height: 10px;
  width: 4px;
}

.bookclub-card-genres {
  margin: 4px 0 2px;
}

@media (max-width: 520px) {
  .genre-shelf {
    padding: 14px 12px 0;
  }

  .genre-shelf-books {
    gap: 5px;
    justify-content: center;
  }

  .genre-spine {
    width: 36px;
  }

  .genre-shelf-board {
    margin: 0 -12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .genre-spine,
  .genre-chip {
    transition: none;
  }

  .genre-spine.is-new,
  .genre-picker-count.is-nudged {
    animation: none;
  }
}
