/* Additive styles for novel cards + the novel detail page.
   Kept in a separate file so it doesn't collide with your existing
   styles.css -- link it alongside styles.css on any page that needs it. */

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

.book-card-link:hover .book-card,
.book-card-link:focus-visible .book-card {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.novel-detail {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 2rem 0 5rem;
}

.novel-back-link {
  align-self: flex-start;
}

.novel-hero {
  display: flex;
  gap: clamp(2rem, 3vw, 3rem);
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 350px;
}

.novel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
  align-items: start;
  gap: clamp(2.5rem, 5vw, 5rem);
}

.novel-primary {
  min-width: 0;
}

.novel-heading h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(3.5rem, 4.6vw, 5.6rem);
  line-height: 0.94;
  text-wrap: balance;
}

.novel-heading h1.is-long-title {
  font-size: clamp(3.2rem, 4.6vw, 5.25rem);
}

.novel-heading h1.is-very-long-title {
  font-size: clamp(2.75rem, 3.8vw, 4.35rem);
}

.novel-synopsis-section {
  min-width: 0;
  margin-top: 0;
}

.novel-meta-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  width: min(100%, 760px);
  margin-top: 1.5rem;
}

.novel-metadata {
  min-width: 0;
}

.novel-analysis {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(14, 7, 25, 0.66);
  padding: 1.7rem 1.5rem 1.55rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

.profile-section h2 {
  font-size: 1.55rem;
}

.novel-cover {
  width: 230px;
  height: 336px;
  flex-shrink: 0;
  border-radius: 0.5rem;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  font-weight: 600;
  overflow: hidden;
}

.novel-cover-column {
  width: 230px;
  flex-shrink: 0;
}

.novel-cover-column .novel-reading-links {
  margin-top: 0.9rem;
  width: 100%;
  flex-direction: column;
  gap: 0.5rem;
}

.novel-cover-column .reading-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}


.novel-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.novel-heading {
  flex: 1;
  min-width: 240px;
}

.novel-author {
  opacity: 0.7;
  margin-top: 0.25rem;
}

.novel-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 0;
  margin-top: 0.6rem;
}

.novel-stat-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.novel-status-badge {
  display: inline-block;
  text-transform: capitalize;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  margin-top: 0;
}

.novel-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: center;
  justify-content: flex-start;
  margin-top: 0.9rem;
}

.genre-tag {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.15);
}

.novel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: center;
  justify-content: flex-start;
  margin-top: 0.6rem;
}

.story-tag-chip {
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px dashed var(--line);
  color: var(--dim);
}

.novel-reading-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-width: 0;
  width: auto;
  margin-top: 0;
}

.reading-link {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.4rem;
  border: 1px solid currentColor;
  text-decoration: none;
  color: inherit;
}

.novel-reading-list {
  width: 100%;
}

.reading-list-controls {
  width: 100%;
}

.reading-list-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.08);
  padding: 0.7rem 1rem;
}

.reading-list-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.reading-list-status a {
  color: var(--focus);
  font-weight: 700;
  /* text-decoration: underline; */
  text-decoration-thickness: 1.5px;
  /* text-underline-offset: 3px; */
  transition:
    color 160ms ease,
    text-decoration-thickness 160ms ease,
    opacity 160ms ease;
}

.reading-list-status a:hover {
  color: var(--ink);
  text-decoration-thickness: 2px;
}

.reading-list-status a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}


.reading-list-login-prompt {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.reading-list-select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 1, 8, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 0 10px;
}

.reading-list-select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.2);
  outline: none;
}

.reading-list-remove-button {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.85rem;
}

.novel-synopsis-wrapper {
  margin-top: 0.5rem;
}

.novel-synopsis-container {
  position: relative;
}

.novel-synopsis {
  line-height: 1.6;
  white-space: pre-line;
  margin: 0;
}

.novel-synopsis.is-collapsed {
  height: 16em; /* 10 lines × 1.6em */
  overflow: hidden;
}

/*
 * The novel detail page has a transparent, multi-colour background, so an
 * opaque fade cannot blend into it reliably. Keep the collapsed copy clean
 * and let the Read More control communicate that more text is available.
 */
.novel-synopsis-fade {
  display: none;
}

.novel-synopsis-wrapper.is-expanded .novel-synopsis-fade {
  opacity: 0;
}

.novel-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.8rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 160ms ease;
}

.novel-read-more:hover {
  opacity: 1;
}

.novel-read-more:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 0.2rem;
}

.novel-read-more::after {
  content: "\2193";
  font-size: 0.9em;
}

.novel-synopsis-wrapper.is-expanded .novel-read-more::after {
  content: "\2191";
}

.profile-section h2 {
  margin-bottom: 0;
}

.profile-section .profile-heading-row {
  align-items: center;
  margin-bottom: 1.2rem;
}

.profile-section-description {
  opacity: 0.7;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

#protagonist-profile {
  display: grid;
  gap: 0.78rem;
}

#protagonist-profile > .trait-row,
#protagonist-profile > .trait-with-poles {
  margin-bottom: 0;
}

#protagonist-profile .trait-row {
  gap: 0.95rem;
}

#protagonist-profile .trait-label {
  font-size: 0.9rem;
  line-height: 1.25;
}

#protagonist-profile .trait-bar-track {
  height: 9px;
}

.trait-row {
  display: grid;
  grid-template-columns: minmax(155px, 0.9fr) minmax(130px, 1.5fr) 2.5rem;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.trait-label {
  font-size: 0.85rem;
}

.trait-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.2);
  overflow: hidden;
}

.trait-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: currentColor;
}

.trait-score {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  opacity: 0.8;
}

.search-results-page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.search-results-heading {
  margin-bottom: 34px;
}

.search-results-heading h1 {
  margin-bottom: 16px;
  font-size: clamp(2.8rem, 6vw, 5rem);
}

.search-results-heading > p:last-child {
  color: var(--muted);
  font-size: 1.05rem;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 24px;
}

.search-empty {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 30px;
}

.trait-composite {
  margin: 0.25rem 0 0.75rem;
  border-radius: 0.5rem;
}

.trait-composite-summary {
  position: relative;
  cursor: pointer;
  list-style: none;
  padding-left: 1.5rem;
}

.trait-composite-summary::-webkit-details-marker {
  display: none;
}

.trait-composite-summary::before {
  position: absolute;
  top: 0.15rem;
  left: 0.1rem;
  content: "\25B6";
  font-size: 0.75rem;
  opacity: 0.7;
  transition: transform 140ms ease;
}

.trait-composite[open] > .trait-composite-summary::before {
  transform: rotate(90deg);
}

.trait-composite-summary .trait-row {
  width: 100%;
  margin-bottom: 0;
}

.trait-composite-summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.trait-subfactors {
  margin: 0.75rem 0 1rem 1.5rem;
  padding: 0.7rem 0 0.1rem 1.5rem;
  border-left: 2px solid rgba(127, 127, 127, 0.25);
}

.trait-subfactors .trait-label {
  opacity: 0.85;
}

.trait-with-poles {
  margin-bottom: 0.9rem;
}

.trait-with-poles .trait-row {
  margin-bottom: 0.2rem;
}

.trait-poles {
  display: flex;
  justify-content: space-between;
  margin-left: max(155px, 37%);
  padding: 0 3.25rem 0 0.75rem;
  font-size: 0.72rem;
  opacity: 0.65;
}

@media (max-width: 1050px) {
  .novel-layout {
    grid-template-columns: 1fr;
  }

  .novel-analysis {
    display: block;
  }

  .profile-section:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .novel-detail {
    width: min(100% - 32px, 640px);
    padding-top: 1.25rem;
  }

  .novel-analysis {
    display: flex;
  }

  .novel-hero {
    align-items: flex-start;
    min-height: 0;
    flex-wrap: wrap;
  }

  .novel-cover {
    width: 200px;
    height: 292px;
  }

  .novel-cover-column {
    width: 200px;
  }

  .novel-meta-actions {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .novel-genres {
    margin-top: 0.9rem;
  }

  .novel-reading-links {
    min-width: 0;
    max-width: none;
  }

  .novel-heading h1 {
    max-width: 11ch;
    font-size: clamp(2.75rem, 15vw, 4.5rem);
  }
}

.is-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* My Lists nav link (added next to the greeting when logged in) */
.my-lists-link {
  color: var(--ink);
  font-weight: 750;
}

/* Reading lists overview page (lists.html) */
.reading-lists-page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.reading-lists-summary {
  color: var(--muted);
  font-size: 1.05rem;
}

body.modal-open { overflow:hidden; }

.reading-list-card.create-list-card {
  min-height:278px;
  border:1px dashed rgba(216,180,254,.34);
  align-items:stretch;
  justify-content:flex-start;
  gap:0;
  background:rgba(168,85,247,.025);
  box-shadow:none;
  color:var(--muted);
  cursor:pointer;
  padding:18px;
  text-align:left;
  transition:border-color .18s ease,background .18s ease,transform .18s ease;
}
.reading-list-card.create-list-card:hover { border-color:var(--focus); background:rgba(168,85,247,.075); transform:translateY(-2px); }
.reading-list-card.create-list-card:focus-visible { outline:3px solid rgba(168,85,247,.28); outline-offset:3px; }
.create-list-preview {
  position:relative;
  height:154px;
  border:1px dashed rgba(216,180,254,.28);
  border-radius:8px;
  display:grid;
  place-items:center;
  background:radial-gradient(circle at 50% 50%,rgba(168,85,247,.12),transparent 56%),rgba(4,2,9,.45);
  overflow:hidden;
}
.create-list-ghost-books { position:absolute; inset:0; opacity:.42; }
.create-list-ghost-books::after { position:absolute; right:13%; bottom:15px; left:13%; height:14px; border-radius:50%; background:rgba(0,0,0,.58); content:""; filter:blur(5px); }
.create-list-ghost-book { position:absolute; bottom:23px; width:68px; height:98px; border:1px dashed rgba(216,180,254,.28); border-radius:5px 8px 4px 4px; background:linear-gradient(145deg,rgba(92,76,107,.42),rgba(21,17,27,.8)); box-shadow:5px 7px 14px rgba(0,0,0,.34),inset -5px 0 9px rgba(0,0,0,.28); transform-origin:center bottom; }
.create-list-ghost-book::after { position:absolute; top:13px; right:10px; bottom:13px; width:1px; background:rgba(216,180,254,.12); content:""; }
.create-list-ghost-book:nth-child(1) { z-index:3; left:calc(50% - 75px); height:104px; transform:translateY(-3px) rotate(-5deg); }
.create-list-ghost-book:nth-child(2) { z-index:2; left:calc(50% - 29px); transform:rotate(1deg); }
.create-list-ghost-book:nth-child(3) { z-index:1; left:calc(50% + 16px); height:94px; transform:translateY(4px) rotate(6deg); }
.create-list-plus { position:relative; z-index:5; width:52px; height:52px; border:1px solid rgba(216,180,254,.5); border-radius:50%; display:grid; place-items:center; background:rgba(22,10,37,.9); box-shadow:0 8px 25px rgba(0,0,0,.45),0 0 0 6px rgba(168,85,247,.08); color:var(--focus); font-size:2rem; font-weight:300; line-height:1; transition:transform .18s ease,background .18s ease; }
.reading-list-card.create-list-card:hover .create-list-plus { background:rgba(168,85,247,.28); transform:scale(1.06); }
.create-list-card strong { margin-top:16px; color:var(--ink); font-family:Georgia,"Times New Roman",serif; font-size:1.4rem; }
.create-list-card small { margin-top:6px; color:var(--muted); font-size:.9rem; }

.create-list-modal { position:relative; }
.create-list-modal .eyebrow { margin:0 0 6px; color:var(--focus); font-size:.7rem; }
.create-list-modal h2 { margin:0 34px 22px 0; font-family:Georgia,"Times New Roman",serif; font-size:1.75rem; }
.create-list-modal label { display:block; margin-bottom:8px; color:var(--dim); font-size:.76rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.create-list-modal > input { width:100%; height:48px; border:1px solid var(--line); border-radius:7px; background:rgba(3,1,8,.78); color:var(--ink); font:inherit; padding:0 13px; }
.create-list-modal > input:focus { border-color:var(--focus); outline:3px solid rgba(168,85,247,.14); }
.create-list-modal .modal-actions { margin-top:22px; }
.create-list-close { position:absolute; top:15px; right:15px; width:34px; min-height:34px; border:0; border-radius:50%; background:transparent; box-shadow:none; color:var(--muted); font-size:1.45rem; padding:0; }
.create-list-close:hover { background:rgba(168,85,247,.1); color:var(--ink); }

.reading-lists-toolbar {
  margin-bottom: 34px;
}

.new-list-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  max-width: 480px;
  padding: 18px;
}

.new-list-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--focus);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reading-lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.reading-list-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 6, 22, 0.74);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.26);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reading-list-card-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.reading-list-card-link:hover h3 {
  color: var(--focus);
}

.reading-list-card-link h3 {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
}

.reading-list-card-link p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.reading-list-card-actions {
  display: flex;
  gap: 10px;
}

.reading-list-action {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.85rem;
}

/* Single reading list page (list.html) */
.reading-list-heading {
  margin-top: 0;
  margin-bottom: 34px;
}

.reading-lists-page > .novel-back-link {
  display: inline-flex;
  margin-bottom: 28px;
}

.reading-list-heading .eyebrow {
  margin-top: 0;
}

.list-novel-item {
  position: relative;
}

.list-novel-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: auto;
  min-height: 32px;
  padding: 4px 12px;
  font-size: 0.78rem;
  border-radius: 999px;
  background: rgba(5, 2, 10, 0.72);
}

/* Shared yes/no confirmation modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 1, 8, 0.72);
  backdrop-filter: blur(4px);
  padding: 20px;
}

.modal-overlay.is-hidden {
  display: none;
}

.modal-card {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
  padding: 26px;
}

.modal-card p {
  margin: 0 0 22px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-actions button {
  width: auto;
  min-height: 42px;
  padding: 0 20px;
}

@media (max-width: 520px) {
  .trait-row {
    grid-template-columns: minmax(125px, 1fr) minmax(100px, 1.4fr) 2rem;
  }

  .trait-poles {
    margin-left: 125px;
    padding-right: 2.75rem;
  }

  .trait-subfactors {
    margin-left: 0.75rem;
    padding-left: 0.75rem;
  }
}

/* Compact novel identity and seamless reading-list picker. */
.novel-heading h1 { max-width:none; font-size:clamp(2.25rem,3vw,3.35rem); line-height:1.02; overflow-wrap:normal; word-break:normal; hyphens:none; text-wrap:pretty; }
.novel-heading h1.is-long-title { max-width:none; font-size:clamp(2.05rem,2.55vw,2.8rem); line-height:1.04; }
.novel-heading h1.is-very-long-title { max-width:none; font-size:clamp(1.85rem,2.15vw,2.35rem); line-height:1.06; text-wrap:pretty; }
.novel-heading h1.is-ultra-long-title { max-width:none; font-size:clamp(1.65rem,1.9vw,2.05rem); line-height:1.08; text-wrap:pretty; }
.genre-tag.is-extra-tag { display:none; }
.novel-genres.is-expanded .genre-tag.is-extra-tag { display:inline-flex; }
.story-tag-chip.is-extra-tag { display:none; }
.novel-tags.is-expanded .story-tag-chip.is-extra-tag { display:inline-flex; }
.genre-toggle { width:auto; min-height:27px; border:1px dashed var(--line); border-radius:999px; background:transparent; box-shadow:none; color:var(--focus); font-size:.75rem; padding:0 .65rem; }
.reading-list-controls { position:relative; width:auto; }
.reading-list-picker { position:relative; width:max-content; max-width:100%; }
.reading-list-trigger { min-height:44px; border:1px solid rgba(216,180,254,.38); border-radius:8px; display:inline-flex; align-items:center; gap:7px; overflow:hidden; background:linear-gradient(135deg,var(--accent),var(--accent-strong)); box-shadow:0 12px 28px rgba(124,58,237,.22); color:#fff; cursor:pointer; font-weight:850; list-style:none; max-width:100%; padding:0 16px; text-overflow:ellipsis; white-space:nowrap; }
.reading-list-trigger::-webkit-details-marker { display:none; }
.reading-list-trigger::after { content:"⌄"; margin-left:4px; font-size:.8rem; }
.reading-list-picker[open] .reading-list-trigger::after { transform:rotate(180deg); }
.reading-list-menu { position:absolute; z-index:15; top:calc(100% + 8px); left:0; width:260px; border:1px solid var(--line); border-radius:9px; display:grid; overflow:hidden; background:#11081e; box-shadow:0 22px 55px rgba(0,0,0,.5); padding:8px; }
.reading-list-menu > strong { color:var(--dim); font-size:.7rem; letter-spacing:.08em; padding:8px 9px; text-transform:uppercase; }
.reading-list-option,.reading-list-remove-button { width:100%; min-height:39px; border:0; border-radius:6px; justify-content:flex-start; background:transparent; box-shadow:none; color:var(--ink); font-size:.84rem; padding:0 9px; }
.reading-list-option:hover { background:var(--accent-soft); }
.reading-list-manage { border-top:1px solid var(--line); margin-top:5px; color:var(--focus); font-size:.8rem; padding:11px 9px 6px; }
.reading-list-remove-button { color:#fda4af; }
.reading-list-remove-button:hover { background:rgba(190,24,93,.16); }
.reading-list-empty { margin:0; color:var(--muted); font-size:.8rem; padding:7px 9px 10px; }

/* Three-volume collection preview for reading-list cards. overflow stays
   visible (not hidden): the visibility popover below needs to extend past
   the card's edge, and .list-bookcase / .list-preview-book already clip
   their own corners, so this doesn't change how the artwork looks. */
.reading-list-card { padding:0; }
.reading-list-card-link { padding:18px 18px 0; }
.reading-list-card-link h3 { margin-top:16px; }
.reading-list-card-actions { padding:0 18px 18px; }
.list-bookcase {
  position:relative;
  height:156px;
  border:1px solid rgba(216,180,254,.18);
  border-radius:8px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  gap:8px;
  overflow:hidden;
  background:radial-gradient(circle at 50% 0,rgba(168,85,247,.16),transparent 58%),rgba(4,2,9,.75);
  padding:14px 14px 20px;
}
.list-bookcase::after {
  position:absolute;
  right:8px;
  bottom:11px;
  left:8px;
  height:8px;
  border:1px solid rgba(216,180,254,.26);
  border-radius:3px;
  content:"";
  background:linear-gradient(180deg,#3d2452,#1b1026);
  box-shadow:0 8px 18px rgba(0,0,0,.65);
}
.list-preview-book {
  position:relative;
  z-index:1;
  width:64px;
  height:112px;
  border:1px solid rgba(255,255,255,.2);
  border-radius:4px 7px 3px 3px;
  display:flex;
  align-items:flex-end;
  overflow:hidden;
  background:linear-gradient(150deg,#3b1760,#7c3aed);
  box-shadow:5px 6px 14px rgba(0,0,0,.45),inset -5px 0 8px rgba(0,0,0,.22);
  color:#fff;
  font-family:Georgia,"Times New Roman",serif;
  font-size:.58rem;
  font-weight:800;
  line-height:1.05;
  padding:7px;
}
.list-preview-book:nth-child(2) { height:122px; }
.list-preview-book:nth-child(3) { height:107px; }
.list-preview-book img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.list-preview-book.is-empty {
  align-items:center;
  justify-content:center;
  border-color:rgba(255,255,255,.1);
  background:linear-gradient(145deg,#302d35,#17151b);
  box-shadow:4px 5px 12px rgba(0,0,0,.38),inset -5px 0 8px rgba(0,0,0,.28);
  color:#77717e;
  padding:0;
}
.list-preview-book.is-empty span { border:1px solid rgba(255,255,255,.12); border-radius:50%; display:grid; place-items:center; width:25px; height:25px; font-size:.75rem; }
.list-preview-book.has-fallback { background:linear-gradient(150deg,#261038,#6d28d9); }
.reading-list-card-link:hover .list-preview-book:not(.is-empty) { transform:translateY(-3px); transition:transform .18s ease; }

/* Flat, overlapping books arranged across a desk. */
.list-bookcase {
  height:154px;
  display:block;
  background:
    radial-gradient(ellipse at 50% 88%,rgba(168,85,247,.14),transparent 56%),
    linear-gradient(180deg,rgba(4,2,9,.64),rgba(20,11,29,.9));
  padding:0;
}
.list-bookcase::after {
  right:10%;
  bottom:13px;
  left:10%;
  height:16px;
  border:0;
  border-radius:50%;
  background:rgba(0,0,0,.48);
  box-shadow:0 5px 18px rgba(0,0,0,.7);
  filter:blur(5px);
}
.list-preview-book {
  position:absolute;
  bottom:20px;
  width:78px;
  height:112px;
  transform-origin:center bottom;
  transition:transform .2s ease,filter .2s ease;
}
.list-preview-book:nth-child(1) {
  z-index:4;
  left:calc(50% - 82px);
  height:116px;
  transform:translateY(-5px) rotate(-5deg);
  filter:drop-shadow(8px 10px 9px rgba(0,0,0,.5));
}
.list-preview-book:nth-child(2) {
  z-index:3;
  left:calc(50% - 35px);
  height:112px;
  transform:rotate(1deg);
}
.list-preview-book:nth-child(3) {
  z-index:2;
  left:calc(50% + 15px);
  height:108px;
  transform:translateY(3px) rotate(6deg);
}
.reading-list-card-link:hover .list-preview-book:nth-child(1):not(.is-empty) { transform:translateY(-10px) rotate(-5deg); }
.reading-list-card-link:hover .list-preview-book:nth-child(2):not(.is-empty) { transform:translateY(-2px) rotate(1deg); }
.reading-list-card-link:hover .list-preview-book:nth-child(3):not(.is-empty) { transform:translateY(1px) rotate(6deg); }

/* Protagonist profile help and scoring guide. */
.profile-heading-row { display:flex; align-items:flex-start; gap:9px; }
.profile-heading-row h2 { margin-right:0; }
.profile-help { position:relative; flex:0 0 auto; }
.profile-help > button { width:25px; min-height:25px; border:1px solid var(--line); border-radius:50%; background:rgba(168,85,247,.1); box-shadow:none; color:var(--focus); font-family:Georgia,"Times New Roman",serif; font-size:.85rem; padding:0; }
.profile-help-bubble { position:absolute; z-index:20; top:calc(100% + 9px); right:0; width:250px; border:1px solid var(--line); border-radius:8px; visibility:hidden; opacity:0; background:#11081e; box-shadow:0 18px 45px rgba(0,0,0,.5); color:var(--muted); font-size:.78rem; line-height:1.5; padding:13px; transform:translateY(-4px); transition:opacity .15s,transform .15s,visibility .15s; }
.profile-help-bubble::before { position:absolute; top:-5px; right:8px; width:8px; height:8px; border-top:1px solid var(--line); border-left:1px solid var(--line); background:#11081e; content:""; transform:rotate(45deg); }
.profile-help-bubble a { display:block; margin-top:8px; color:var(--focus); }
.profile-help:hover .profile-help-bubble,.profile-help:focus-within .profile-help-bubble { visibility:visible; opacity:1; transform:translateY(0); }
.profile-guide-page { position:relative; z-index:1; width:min(1120px,calc(100% - 32px)); margin:0 auto; padding:34px 0 80px; }
.profile-guide-hero { max-width:none; margin:28px 0 38px; }
.profile-guide-hero h1 { max-width:none; margin-bottom:20px; font-size:clamp(2.8rem,5vw,4.25rem); line-height:1; text-wrap:balance; }
.profile-guide-hero .profile-guide-intro { max-width:none; margin-bottom:16px; border-left:2px solid var(--dusk); color:var(--ink); font-size:1.18rem; font-weight:600; line-height:1.7; padding-left:20px; }
.profile-guide-hero > p:last-child { max-width:none; color:var(--muted); font-size:1.08rem; line-height:1.7; }
.scoring-principles { border:1px solid var(--line); border-radius:10px; background:rgba(12,6,22,.72); padding:26px; }
.scoring-principles h2 { margin-bottom:20px; }
.principle-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.principle-grid article { border:1px solid rgba(216,180,254,.14); border-radius:7px; background:rgba(255,255,255,.025); padding:16px; }
.principle-grid strong { color:var(--focus); }
.principle-grid p { margin:7px 0 0; color:var(--muted); font-size:.86rem; line-height:1.55; }
.confidence-note { margin:18px 0 0; border-left:3px solid var(--accent); color:var(--muted); line-height:1.6; padding-left:14px; }
.trait-guide-list { margin-top:38px; }
.trait-guide-list [data-trait-guides] { display:grid; gap:10px; }
.trait-guide { border:1px solid var(--line); border-radius:9px; overflow:hidden; background:rgba(12,6,22,.68); }
.trait-guide > summary { min-height:68px; display:flex; align-items:center; gap:16px; cursor:pointer; list-style:none; padding:12px 18px; }
.trait-guide > summary::-webkit-details-marker { display:none; }
.trait-guide > summary > span { display:grid; gap:4px; margin-right:auto; }
.trait-guide > summary strong { color:var(--ink); font-family:Georgia,"Times New Roman",serif; font-size:1.25rem; }
.trait-guide > summary small { color:var(--dim); }
.trait-guide > summary i { border:1px solid var(--line); border-radius:99px; color:var(--focus); font-size:.72rem; font-style:normal; padding:5px 9px; }
.trait-guide > summary::after { content:"⌄"; color:var(--focus); }
.trait-guide[open] > summary { border-bottom:1px solid var(--line); background:rgba(168,85,247,.06); }
.trait-guide[open] > summary::after { transform:rotate(180deg); }
.trait-guide-body { padding:20px; }
.trait-guide-description { max-width:760px; color:var(--muted); line-height:1.65; }
.trait-scale-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:18px 0 0; padding:0; list-style:none; }
.trait-scale-list li { border:1px solid rgba(216,180,254,.12); border-radius:6px; display:grid; grid-template-columns:42px 1fr; gap:10px; align-items:start; padding:11px; }
.trait-scale-list li:last-child { grid-column:1 / -1; }
.trait-scale-list li > strong { color:var(--focus); font-family:Georgia,"Times New Roman",serif; font-size:1.1rem; }
.trait-scale-list p { margin:0; color:var(--muted); font-size:.8rem; line-height:1.5; }

@media (max-width:680px) {
  .profile-help-bubble { right:-8px; width:min(250px,calc(100vw - 48px)); }
  .principle-grid,.trait-scale-list { grid-template-columns:1fr; }
  .trait-scale-list li:last-child { grid-column:auto; }
  .profile-guide-hero h1 { font-size:clamp(2.45rem,11vw,3.5rem); line-height:1.03; }
}

/* Upload-a-novel page */
.upload-novel-page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.upload-novel-card {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
  padding: 34px;
}

.upload-close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 1.45rem;
  padding: 0;
}

.upload-close-button:hover {
  background: rgba(168, 85, 247, 0.1);
  color: var(--ink);
}

.upload-novel-card h1 {
  margin: 0 34px 10px 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.upload-novel-intro {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.6;
}

.upload-form-row {
  margin-bottom: 18px;
}

.upload-form-row label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
}

.upload-form-row input,
.upload-form-row select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(3, 1, 8, 0.78);
  color: var(--ink);
  font: inherit;
  padding: 0 13px;
}

.upload-form-row input:focus,
.upload-form-row select:focus {
  border-color: var(--focus);
  outline: 3px solid rgba(168, 85, 247, 0.14);
}

.upload-form-error,
.upload-form-success {
  margin: 4px 0 18px;
  line-height: 1.5;
}

.upload-form-error {
  color: #fda4af;
}

.upload-form-success {
  color: var(--muted);
}

.upload-form.is-hidden,
.upload-preview.is-hidden,
.upload-form-error.is-hidden,
.upload-form-success.is-hidden {
  display: none;
}

.upload-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
}

.upload-form-actions button {
  width: auto;
}

.upload-preview h2 {
  margin-bottom: 18px;
  font-size: 1.4rem;
}

.upload-preview-body {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.upload-preview-cover {
  width: 130px;
  height: 190px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(145deg, #231033, #5b21b6);
}

.upload-preview-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-preview-details p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.5;
}

.upload-preview-details strong {
  color: var(--ink);
  margin-right: 6px;
}

.upload-synopsis-label {
  margin-top: 14px !important;
}

.upload-synopsis {
  white-space: pre-line;
}

@media (max-width: 560px) {
  .upload-preview-body {
    grid-template-columns: 1fr;
  }
}


/* Manage profile page */
.profile-manage-page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.profile-manage-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
  padding: 34px;
}

.profile-manage-card h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.profile-manage-intro {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.6;
}

.profile-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 18px 20px;
}

.profile-readonly-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-readonly-item strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.profile-form-row {
  margin-bottom: 18px;
}

.profile-form-row label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
}

.profile-form-row input,
.profile-form-row select,
.profile-form-row textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(3, 1, 8, 0.78);
  color: var(--ink);
  font: inherit;
  padding: 12px 13px;
}

.profile-form-row input,
.profile-form-row select {
  min-height: 48px;
}

.profile-form-row textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.55;
}

.profile-form-row input:focus,
.profile-form-row select:focus,
.profile-form-row textarea:focus {
  border-color: var(--focus);
  outline: 3px solid rgba(168, 85, 247, 0.14);
}

.profile-about-counter {
  margin-top: 6px;
  color: var(--dim);
  font-size: 0.78rem;
  text-align: right;
}

.profile-tags-field .tag-combobox,
.profile-tags-field .selected-tags,
.profile-tags-field .tag-help {
  margin-left: 0;
}

.profile-message {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.08);
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 10px 12px;
  text-align: center;
}

.profile-message.is-hidden {
  display: none;
}

.profile-message.profile-message-error {
  border-color: var(--passion);
  background: var(--passion-soft);
  color: #f5c4c9;
}

.profile-manage-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.profile-manage-actions button {
  width: auto;
}

.profile-presence-section { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 26px; }
.profile-presence-section h2 { margin: 0; font-size: 1.22rem; }
.profile-presence-section > p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.profile-presence-toggle { display: inline-flex; align-items: center; gap: 10px; margin-top: 17px; color: var(--ink); font-weight: 750; cursor: pointer; }
.profile-presence-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.profile-presence-section .profile-presence-note { color: var(--dim); font-size: .84rem; }

@media (max-width: 560px) {
  .profile-readonly-grid {
    grid-template-columns: 1fr;
  }
}


/* Manage profile: avatar upload + circular crop editor */
.profile-avatar-section {
  position: relative;
  width: max-content;
  margin-bottom: 30px;
}

.profile-avatar-preview {
  width: 128px;
  height: 128px;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #241031, #5c2782);
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.6rem;
  font-weight: 800;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-avatar-edit-button {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.1rem;
  border: 2px solid var(--surface-strong);
}

.avatar-editor-modal {
  position: relative;
  width: min(100%, 380px);
}

.avatar-editor-modal .eyebrow {
  margin: 0 0 6px;
}

.avatar-editor-modal h2 {
  margin: 0 34px 22px 0;
  font-size: 1.75rem;
}

.avatar-editor-stage {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 18px;
  border-radius: 8px;
  overflow: hidden;
  background: #050208;
  touch-action: none;
  cursor: grab;
}

.avatar-editor-stage.is-dragging {
  cursor: grabbing;
}

.avatar-editor-image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.avatar-editor-crop-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 0 2000px rgba(3, 1, 8, 0.72);
  pointer-events: none;
}

.avatar-zoom-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
}

.avatar-editor-modal input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.avatar-editor-hint {
  margin: 14px 0 0;
  color: var(--dim);
  font-size: 0.8rem;
  text-align: center;
}


/* Public user profile page */
.reader-directory-page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 84px;
}

.reader-directory-heading { max-width: none; }
.reader-directory-heading h1 { margin: 0 0 14px; font-size: clamp(2.6rem, 5vw, 4.5rem); }
.reader-directory-heading > p:last-child { margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.reader-directory-search { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: none; margin-top: 32px; }
.reader-directory-search label { color: var(--ink); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.reader-directory-search > div { display: flex; gap: 10px; }
.reader-directory-search input { flex: 1; min-width: 0; min-height: 46px; border: 1px solid var(--line); border-radius: 8px; background: rgba(8, 3, 13, .62); color: var(--ink); font: inherit; padding: 0 14px; }
.reader-directory-search input:focus { border-color: var(--focus); box-shadow: 0 0 0 4px rgba(155, 77, 204, .15); outline: none; }
.reader-directory-search button { width: auto; min-height: 46px; padding: 0 20px; }
.reader-directory-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 24px 0 12px; }
.reader-directory-status { min-height: 1.4em; margin: 0; color: var(--muted); font-size: .88rem; font-weight: 700; }
.reader-directory-sort { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.reader-directory-sort select { min-height: 34px; border: 1px solid var(--line); border-radius: 7px; background: rgba(8, 3, 13, .62); color: var(--ink); font: inherit; letter-spacing: normal; text-transform: none; padding: 0 28px 0 10px; }
.reader-directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.reader-directory-card { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 14px; align-items: start; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, rgba(36, 17, 50, .78), rgba(11, 5, 19, .84)); color: inherit; padding: 18px; text-decoration: none; transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.reader-directory-card:hover, .reader-directory-card:focus-visible { border-color: rgba(110, 146, 196, .62); background: linear-gradient(145deg, rgba(48, 27, 66, .9), rgba(13, 9, 25, .94)); color: inherit; text-decoration: none; transform: translateY(-2px); }
.reader-directory-avatar { display: grid; place-items: center; width: 54px; height: 54px; overflow: hidden; border: 1px solid rgba(110, 146, 196, .48); border-radius: 50%; background: linear-gradient(145deg, #643875, #243b58); color: var(--ink); font: 700 1.2rem Georgia, serif; }
.reader-directory-avatar img { width: 100%; height: 100%; object-fit: cover; }
.reader-directory-body { min-width: 0; }
.reader-directory-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.reader-directory-body strong { display: block; min-width: 0; overflow: hidden; color: var(--ink); font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.reader-directory-location { margin: 4px 0 0; color: var(--dusk); font-size: .75rem; font-weight: 700; }
.reader-directory-about { display: -webkit-box; margin: 8px 0 0; overflow: hidden; color: var(--muted); font-size: .82rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.reader-directory-about.is-empty { color: var(--dim); }
.reader-directory-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.reader-directory-tags span { border: 1px solid rgba(216, 180, 254, .26); border-radius: 999px; color: var(--accent); font-size: .66rem; font-weight: 750; padding: 3px 7px; }
.reader-directory-arrow { align-self: center; color: var(--dusk); font-size: 1.2rem; }
.reader-directory-empty { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); padding: 34px; text-align: center; }

.user-profile-page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.user-profile-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
  padding: 34px;
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 30px;
}

.user-profile-avatar {
  flex: 0 0 auto;
  width: 128px;
  height: 128px;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #241031, #5c2782);
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.6rem;
  font-weight: 800;
}

.user-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-profile-header h1 {
  margin: 0;
  min-width: 0;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.05;
  overflow-wrap: break-word;
}

.user-profile-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 18px 20px;
}

.user-profile-detail-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-profile-detail-item strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.user-profile-section {
  margin-top: 28px;
}

.user-profile-section h2 {
  margin-bottom: 12px;
  font-size: 1.3rem;
}

.user-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-profile-empty {
  margin: 0;
  color: var(--muted);
}

.user-profile-about {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-line;
}

.user-profile-identity { min-width: 0; }
.user-profile-name-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-online-status { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 6px; color: var(--dim); font-size: .76rem; font-weight: 750; }
.user-online-status::before { width: 7px; height: 7px; border-radius: 50%; background: #6a5b70; content: ""; }
.user-online-status.is-online { color: #8bc7a8; }
.user-online-status.is-online::before { background: var(--verdant); box-shadow: 0 0 10px rgba(95, 155, 130, .75); }
.user-profile-activity-link { display: inline-flex; align-items: center; min-height: 40px; margin-top: 14px; border: 1px solid rgba(110, 146, 196, .52); border-radius: 8px; background: var(--dusk-soft); color: var(--ink); font-size: .85rem; font-weight: 800; padding: 0 14px; text-decoration: none; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.user-profile-activity-link:hover, .user-profile-activity-link:focus-visible { border-color: var(--dusk); background: rgba(110, 146, 196, .24); color: #fff; text-decoration: none; transform: translateY(-1px); }

.user-activity-section { margin-top: 28px; }
.activity-page .user-activity-section { margin-top: 0; }
.activity-page .user-activity-heading { padding-top: 10px; }
.activity-page .user-activity-heading h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 3.5rem); }
.activity-intro { margin: 8px 0 0; color: var(--muted); }
.user-activity-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); padding: 0 4px 18px; }
.user-activity-heading .eyebrow { margin: 0 0 7px; }
.user-activity-heading h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.25rem); }
.user-activity-stats { color: var(--muted); font-size: .86rem; font-weight: 700; white-space: nowrap; }
.user-activity-feed { display: grid; gap: 14px; margin-top: 18px; }
.user-activity-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 18px; border: 1px solid rgba(173,121,211,.22); border-radius: 12px; background: linear-gradient(145deg, rgba(29,15,40,.68), rgba(12,7,19,.78)); padding: 18px; box-shadow: 0 14px 34px rgba(0,0,0,.14); }
.user-activity-cover { width: 76px; aspect-ratio: 2 / 3; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: linear-gradient(145deg,#241031,#5c2782); color: var(--ink); font: 700 1.6rem Georgia,serif; text-decoration: none; }
.user-activity-cover img { width: 100%; height: 100%; object-fit: cover; }
.user-activity-cover.has-fallback { padding: 7px; font-size: .72rem; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.user-activity-body { min-width: 0; }
.user-activity-context { margin: 0 0 5px; color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.user-activity-title { color: var(--ink); font: 700 1.2rem Georgia,serif; text-decoration: none; }
.user-activity-title:hover, .user-activity-title:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.user-activity-author { margin-left: 7px; color: var(--dim); font-size: .82rem; }
.user-activity-meta { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.user-activity-meta time { color: var(--dim); font-size: .76rem; }
.user-activity-comment { margin: 15px 0 0; border-top: 1px solid rgba(255,255,255,.07); padding-top: 14px; color: var(--muted); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.user-activity-empty { border: 1px dashed var(--line); border-radius: 10px; padding: 32px; text-align: center; }
.user-activity-empty strong { color: var(--ink); }
.user-activity-empty p { margin: 7px 0 0; color: var(--muted); }

@media (max-width: 560px) {
  .reading-lists-ground::before { top: -20px; right: -8px; bottom: -22px; left: -8px; border-radius: 14px; }

  .reader-directory-page { padding-top: 32px; }
  .reader-directory-grid { grid-template-columns: 1fr; }
  .reader-directory-search > div { flex-direction: column; }
  .reader-directory-search button { width: 100%; }
  .reader-directory-toolbar { align-items: flex-start; flex-direction: column; }

  .user-profile-header {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .user-profile-details {
    grid-template-columns: 1fr;
  }

  .user-activity-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .user-activity-card { grid-template-columns: 54px minmax(0, 1fr); gap: 13px; padding: 14px; }
  .user-activity-cover { width: 54px; }
  .user-activity-author { display: block; margin: 4px 0 0; }
}

/* Upload page: "Your uploaded novels" collapsible list */
.upload-mine-section {
  margin-bottom: 26px;
}

.upload-mine-toggle {
  width: auto;
  min-height: 42px;
  font-size: 0.88rem;
}

.upload-mine-toggle::after {
  content: "⌄";
  margin-left: 8px;
  color: var(--focus);
  transition: transform 0.18s ease;
}

.upload-mine-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.upload-mine-list {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px 16px;
}

.upload-mine-list.is-hidden {
  display: none;
}

.upload-mine-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.upload-mine-list li {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.upload-mine-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.upload-mine-empty,
.upload-mine-list > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Reader ratings and reviews */
.novel-rating-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.novel-rating-summary > span:first-child,
.reviews-overview > span,
.review-card-stars {
  color: #f2b84b;
}

.novel-rating-summary strong { color: var(--ink); font-size: 1.05rem; }

.reviews-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
  align-items: start;
  gap: 24px clamp(2.5rem, 5vw, 5rem);
  width: 100%;
  margin-top: 54px;
  border-top: 1px solid var(--line);
  padding-top: 38px;
}

.reviews-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
}

.reviews-feed {
  grid-column: 1;
  display: grid;
  gap: 24px;
  min-width: 0;
}

.reviews-heading-row h2 { margin: 5px 0 0; font-size: clamp(1.7rem, 3vw, 2.25rem); }

.reviews-overview { display: flex; align-items: baseline; gap: 5px; color: var(--muted); }
.reviews-overview strong { color: var(--ink); font: 700 1.8rem Georgia, serif; }
.reviews-overview small { margin-left: 4px; }

.review-composer {
  grid-column: 2;
  position: sticky;
  top: 24px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  padding: 24px;
}

.review-login-prompt { margin: 0; color: var(--muted); }
.review-form-heading h3 { margin: 0 0 5px; font-size: 1.18rem; }
.review-form-heading p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.star-picker { margin: 20px 0 18px; border: 0; padding: 0; }
.star-picker legend { margin-bottom: 8px; color: var(--muted); font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.star-picker-options { display: inline-flex; align-items: center; gap: 3px; outline: none; touch-action: none; user-select: none; }
.star-picker-options:focus-visible { border-radius: 4px; outline: 2px solid var(--focus); outline-offset: 4px; }
.star-picker-options button { width: 34px; min-height: 36px; border: 0; background: transparent; padding: 0; cursor: pointer; }
.star-picker-options button span { display: block; color: #665f52; font-size: 2rem; line-height: 1; transition: transform .15s ease; }
.star-picker-options button[data-fill="full"] span { color: #f2b84b; }
.star-picker-options button[data-fill="half"] span { color: transparent; background: linear-gradient(90deg, #f2b84b 50%, #665f52 50%); background-clip: text; -webkit-background-clip: text; }
.star-picker-options button:hover span { transform: translateY(-2px); }
.review-rating-control { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 36px; }
.review-rating-copy { display: flex; align-items: center; gap: 9px; min-width: 92px; }
.review-rating-value { color: var(--muted); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.review-rating-value.is-preview { color: var(--ink); }
.review-rating-clear { min-height: auto; border: 0; background: transparent; color: var(--accent); padding: 0; font-size: .78rem; cursor: pointer; }
.review-rating-clear[hidden] { display: none; }

.review-comment-label { display: grid; gap: 8px; color: var(--ink); font-weight: 700; }
.review-comment-label > span { margin-left: 5px; color: var(--dim); font-size: .78rem; font-weight: 500; }
.review-comment-label > .review-comment-field { position: relative; display: block; margin-left: 0; }
.review-comment-label textarea { width: 100%; resize: vertical; min-height: 104px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.16); color: var(--ink); padding: 13px 14px 34px; font: inherit; line-height: 1.55; }
.review-comment-label textarea:focus { border-color: var(--focus); outline: 2px solid color-mix(in srgb, var(--focus) 25%, transparent); }
.review-comment-label .review-comment-counter { position: absolute; right: 12px; bottom: 10px; color: var(--dim); font-size: .72rem; font-variant-numeric: tabular-nums; line-height: 1; pointer-events: none; }
.review-form-footer { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 14px; }
.review-form-footer [role="status"] { margin-right: auto; color: #ef9d9d; font-size: .88rem; }

.reviews-list { display: grid; gap: 14px; min-width: 0; }
.review-card { position: relative; overflow: hidden; border: 1px solid rgba(173, 121, 211, .22); border-radius: 12px; background: linear-gradient(145deg, rgba(29, 15, 40, .68), rgba(12, 7, 19, .78)); padding: 22px 24px; box-shadow: 0 16px 38px rgba(0, 0, 0, .14); transition: border-color .18s ease, transform .18s ease; }
.review-card:hover { border-color: rgba(190, 132, 231, .36); }
.review-card-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
.review-avatar { width: 46px; height: 46px; overflow: hidden; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: linear-gradient(145deg, #241031, #5c2782); color: #fff; font-weight: 800; box-shadow: 0 5px 16px rgba(0,0,0,.2); }
.review-avatar img { width: 100%; height: 100%; object-fit: cover; }
.review-profile-link { display: block; border-radius: 50%; color: inherit; text-decoration: none; }
.review-profile-link:hover .review-avatar,
.review-profile-link:focus-visible .review-avatar { outline: 2px solid var(--focus); outline-offset: 3px; }
.review-author-link { color: var(--ink); text-decoration: none; }
.review-author-link:hover,
.review-author-link:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.review-card-header strong, .review-card-header time { display: block; }
.review-card-header time { margin-top: 3px; color: var(--dim); font-size: .78rem; }
.review-card-stars { letter-spacing: 2px; white-space: nowrap; font-size: 1.05rem; }
.review-card-stars > span { color: #665f52; }
.review-card-stars > span[data-fill="full"] { color: #f2b84b; }
.review-card-stars > span[data-fill="half"] { color: transparent; background: linear-gradient(90deg, #f2b84b 50%, #665f52 50%); background-clip: text; -webkit-background-clip: text; }
.review-card-meta { display: grid; justify-items: end; gap: 7px; }
.review-card > p { margin: 18px 0 0; border-top: 1px solid rgba(255,255,255,.07); padding-top: 17px; color: var(--muted); font-size: .98rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.reviews-empty { margin: 0; color: var(--muted); }

@media (max-width: 1050px) {
  .reviews-section { grid-template-columns: 1fr; }
  .reviews-feed,
  .review-composer,
  .reviews-list { grid-column: 1; }
  .review-composer { grid-row: auto; position: static; }
}

@media (max-width: 620px) {
  .reviews-heading-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .review-composer { padding: 20px; }
  .review-card-header { grid-template-columns: auto 1fr; }
  .review-card-meta { grid-column: 2; justify-items: start; }
}

/* Chapter tracking */
.novel-chapter-tracker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.novel-chapter-tracker label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.novel-chapter-input {
  width: 90px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(3, 1, 8, 0.72);
  color: var(--ink);
  font: inherit;
  padding: 0 10px;
}

.novel-chapter-input:focus {
  border-color: var(--focus);
  outline: 3px solid rgba(155, 77, 204, 0.14);
}

.novel-chapter-status {
  color: var(--dim);
  font-size: 0.78rem;
  min-width: 44px;
}

.list-novel-chapter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.list-novel-chapter-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.list-novel-chapter-input {
  width: 76px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(3, 1, 8, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 0 8px;
}

.list-novel-chapter-input:focus {
  border-color: var(--focus);
  outline: 3px solid rgba(155, 77, 204, 0.14);
}

.list-novel-chapter-status {
  color: var(--dim);
  font-size: 0.74rem;
}

/* =========================================================
   INBOX PAGE
   ========================================================= */

.inbox-page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.inbox-summary {
  color: var(--muted);
  font-size: 1.05rem;
}

.inbox-list {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.inbox-message {
  border: 1px solid rgba(173, 121, 211, 0.22);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(29, 15, 40, 0.68), rgba(12, 7, 19, 0.78));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
  transition: border-color 0.18s ease, background 0.18s ease;
}

/* Unread highlight. */
.inbox-message.is-unread {
  border-color: rgba(216, 180, 254, 0.5);
  background: linear-gradient(145deg, rgba(60, 26, 87, 0.62), rgba(20, 9, 30, 0.84));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(155, 77, 204, 0.12) inset;
}

.inbox-message > summary {
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
}

.inbox-message > summary::-webkit-details-marker {
  display: none;
}

.inbox-message > summary:hover {
  background: rgba(255, 255, 255, 0.02);
}

.inbox-unread-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: transparent;
}

.inbox-message.is-unread .inbox-unread-dot {
  background: var(--passion);
  box-shadow: 0 0 8px rgba(209, 74, 85, 0.6);
}

.inbox-message-subject {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-message.is-unread .inbox-message-subject {
  font-weight: 800;
}

.inbox-message-date {
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 0.78rem;
  white-space: nowrap;
}

.inbox-message-body {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 18px 22px 20px;
}

.inbox-message-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-line;
}

.inbox-message-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.inbox-delete-message {
  border-color: rgba(209, 74, 85, 0.42);
  color: #edabb4;
}

.inbox-delete-message:hover,
.inbox-delete-message:focus-visible {
  border-color: var(--passion);
  background: var(--passion-soft);
  color: #ffd5da;
}

.inbox-read-toggle {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.82rem;
}

@media (max-width: 560px) {
  .inbox-message > summary {
    padding: 15px 16px;
  }

  .inbox-message-body {
    padding: 15px 16px 16px;
  }

  .inbox-message-date {
    display: none;
  }
}

/* =========================================================
   FRIEND ACTION (profile page: Add friend / Request sent / Friends)
   ========================================================= */

.friend-action {
  flex: 0 0 auto;
  margin-left: auto;
  align-self: center;
}

.friend-action-button {
  width: auto;
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.92rem;
  white-space: nowrap;
}

.friend-action-static {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
  padding: 0 16px;
}

.friend-action-static.is-friends {
  border-color: rgba(155, 77, 204, 0.4);
  background: var(--accent-soft);
  color: var(--ink);
}

.friend-action-static.is-pending {
  border-style: dashed;
}

@media (max-width: 560px) {
  .friend-action {
    width: 100%;
    margin-left: 0;
  }

  .friend-action-button,
  .friend-action-static {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   INBOX: FRIEND REQUEST NOTIFICATIONS
   ========================================================= */

.inbox-friend-request-link {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.inbox-friend-request-link a {
  font-weight: 800;
}

.inbox-friend-request-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.inbox-friend-accept,
.inbox-friend-reject {
  width: auto;
  min-height: 38px;
  padding: 0 16px;
  font-size: 0.85rem;
}

.inbox-friend-reject {
  border-color: rgba(255, 93, 98, 0.3);
  color: #fda4af;
}

.inbox-friend-request-resolved {
  margin: 14px 0 0;
  color: var(--dim);
  font-size: 0.85rem;
  font-style: italic;
}

/* =========================================================
   YOUR FRIENDS PAGE
   ========================================================= */

.friends-page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.friends-summary {
  color: var(--muted);
  font-size: 1.05rem;
}

.friends-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 4px;
}

.friends-tab {
  width: auto;
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0 20px;
}

.friends-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.friends-tab[aria-selected="true"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(116, 44, 157, 0.22);
}

.friends-list {
  display: grid;
  gap: 10px;
}

/* The bordered "card" is now the row (link + actions), not the link
   alone, since a button can't be nested inside an <a> (invalid HTML --
   interactive content inside interactive content). */
.friend-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(173, 121, 211, 0.2);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(29, 15, 40, 0.62), rgba(12, 7, 19, 0.72));
  padding: 10px 14px 10px 16px;
  transition: border-color 0.18s ease;
}

.friend-list-row:hover {
  border-color: rgba(216, 180, 254, 0.4);
}

.friend-list-row.is-pending {
  border-style: dashed;
}

.friend-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
}

.friend-list-item:hover,
.friend-list-item:focus-visible {
  color: inherit;
  text-decoration: none;
}

.friend-list-item:hover .friend-list-name {
  color: var(--focus);
}

.friend-list-avatar {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #241031, #5c2782);
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.friend-list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.friend-list-name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.friend-list-direction {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  padding: 5px 10px;
}

.friend-list-row-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.friend-list-remove {
  width: auto;
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.8rem;
  color: #fda4af;
  border-color: rgba(255, 93, 98, 0.3);
}

.friend-list-remove:hover {
  border-color: #ff666b;
  background: rgba(255, 93, 98, 0.12);
  color: #ff8b8f;
}

.friend-list-accept,
.friend-list-reject {
  width: auto;
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.8rem;
}

.friend-list-reject {
  color: #fda4af;
  border-color: rgba(255, 93, 98, 0.3);
}

.friend-list-reject:hover {
  border-color: #ff666b;
  background: rgba(255, 93, 98, 0.12);
  color: #ff8b8f;
}

@media (max-width: 480px) {
  .friends-tabs {
    width: 100%;
  }

  .friends-tab {
    flex: 1 1 0;
  }

  .friend-list-direction {
    display: none;
  }

  .friend-list-row {
    flex-wrap: wrap;
  }

  .friend-list-row-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* =========================================================
   FRIEND REQUEST BADGES (avatar + "Friends" dropdown link)
   ========================================================= */

/* .account-trigger is defined in styles.css without a position, since it
   previously only ever held one centered child (the initial letter or
   avatar image). It now also holds a sibling badge, so it needs to be a
   positioning context for that badge's absolute placement. */
.account-trigger {
  position: relative;
}

.account-trigger-content {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.account-trigger-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--passion);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  padding: 0 4px;
  box-shadow: 0 0 0 2px rgba(7, 3, 13, 0.86);
}

.account-trigger-badge.is-hidden {
  display: none;
}

.account-popover-link-friends {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-popover-badge {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--passion);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  padding: 0 5px;
}

.account-popover-badge.is-hidden {
  display: none;
}

/* =========================================================
   MANAGE PROFILE: SOCIAL ACCOUNTS
   ========================================================= */

.profile-social-section {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 24px;
}

.profile-social-heading {
  margin-bottom: 6px;
  font-size: 1.3rem;
}

.profile-social-intro {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.profile-social-field {
  margin-bottom: 16px;
}

.profile-social-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
}

.profile-social-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 240px);
  gap: 12px;
}

.profile-social-controls input,
.profile-social-controls select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(3, 1, 8, 0.78);
  color: var(--ink);
  font: inherit;
  padding: 0 13px;
}

.profile-social-controls input:focus,
.profile-social-controls select:focus {
  border-color: var(--focus);
  outline: 3px solid rgba(168, 85, 247, 0.14);
}

@media (max-width: 560px) {
  .profile-social-controls {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   PUBLIC PROFILE: SOCIAL ACCOUNTS
   ========================================================= */

.user-social-list {
  display: grid;
  gap: 10px;
}

.user-social-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 14px;
}

.user-social-platform {
  flex: 0 0 auto;
  width: 120px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
}

.user-social-platform .social-platform-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 1.25rem;
  display: inline-block;
}

.user-social-value {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.user-social-value.is-empty,
.user-social-value.is-restricted {
  color: var(--muted);
  font-weight: 500;
  font-style: italic;
}

@media (max-width: 480px) {
  .user-social-row {
    align-items: flex-start;
  }

  .user-social-platform {
    width: 105px;
  }
}

/* =========================================================
   SOCIAL PLATFORM LABELS + ICONS
   ========================================================= */

.profile-social-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
}

.social-platform-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 1.25rem;
  display: inline-block;
  vertical-align: middle;
}

.discord-icon {
  color: #7980c7; /* muted Discord periwinkle */
}

.instagram-icon {
  color: #c47791; /* muted Instagram rose */
}

.reddit-icon {
  color: #c66a5d; /* subdued Reddit coral */
}

.tiktok-icon {
  color: #a56bc7; /* Axiom-compatible TikTok purple */
  filter: drop-shadow(0 0 4px rgba(165, 107, 199, 0.28));
}

.review-card-meta-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.review-like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.review-like-button {
  width: 30px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  color: var(--muted);
  padding: 0;
}

.review-like-button:hover:not(:disabled) {
  border-color: var(--focus);
  background: var(--accent-soft);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

.review-like-button.is-liked {
  border-color: #b66ad7;
  background: var(--accent-soft);
  color: var(--focus);
}

.review-like-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.review-like-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.review-like-button.is-liked .review-like-icon {
  fill: currentColor;
}

.review-like-count {
  min-width: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.review-like-button.is-liked ~ .review-like-count {
  color: var(--ink);
}


/* Similar novels: consistent portrait covers with details underneath. */
.similar-section { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.similar-section:not([hidden]) + .reviews-section { margin-top: 0; padding-top: 1.5rem; }
.similar-heading { margin-bottom: 1.25rem; }
.similar-heading h2 { margin: 0 0 0.5rem; font-size: 1.4rem; }
.similar-heading > p:last-child { color: var(--dim); margin: 0; font-size: 0.9rem; }
.similar-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding: 6px 6px 14px;
  margin: -6px -6px 0;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.similar-card { scroll-snap-align: start; align-items: center; display: flex; flex-direction: column; gap: 0.85rem; min-width: 0; color: var(--ink); text-decoration: none; border-radius: 8px; }
.similar-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; }
.similar-cover { position: relative; width: 100%; aspect-ratio: 2 / 3; flex-shrink: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(145deg, #352043, #100718); display: grid; place-items: center; }
.similar-cover > span { padding: 1rem; font-size: 1rem; text-align: center; font-weight: 750; overflow-wrap: anywhere; }
.similar-cover img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.similar-card:hover .similar-cover { border-color: var(--focus); }
.similar-copy { width: 100%; min-width: 0; padding-top: 0; }
.similar-copy h3 { margin: 0; font-size: 0.95rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.similar-copy > p { margin: 0.35rem 0 0; color: var(--dim); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.similar-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 0.65rem; }
.similar-tags span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; color: var(--dim); font-size: 0.7rem; }
.similar-message { color: var(--dim); font-size: 0.9rem; }
.similar-retry { background: transparent; color: var(--ink); border: 0; text-decoration: underline; padding: 0.25rem; font: inherit; }
@media (max-width: 1050px) {
  .similar-grid { grid-template-columns: none; grid-auto-columns: 160px; gap: 16px; }
}

/* Reading list visibility -- an emoji chip (<details>/<summary>, same
   pattern as .reading-list-picker above and .account-menu in styles.css)
   that opens a small popover instead of a plain <select>. */
.list-visibility-picker { position: relative; margin: 0 18px; width: max-content; max-width: calc(100% - 36px); }
.list-visibility-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-size: .82rem;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: border-color .15s ease, background .15s ease;
}
.list-visibility-chip::-webkit-details-marker { display: none; }
.list-visibility-chip:hover { border-color: var(--line-strong); background: var(--accent-soft); }
.list-visibility-picker[open] > .list-visibility-chip { border-color: var(--focus); background: var(--accent-soft); }
.list-visibility-icon { font-size: 1rem; line-height: 1; }
.list-visibility-label { white-space: nowrap; }
.list-visibility-status { color: var(--focus); font-size: .72rem; font-weight: 700; }
.list-visibility-status:empty { display: none; }
.list-visibility-chip::after {
  content: "\2304";
  margin-left: 1px;
  color: var(--dim);
  font-size: .78rem;
  transition: transform .15s ease;
}
.list-visibility-picker[open] .list-visibility-chip::after { transform: rotate(180deg); }

.list-visibility-menu {
  position: absolute;
  z-index: 15;
  top: calc(100% + 8px);
  left: 0;
  width: 250px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #11081e;
  box-shadow: 0 22px 55px rgba(0, 0, 0, .5);
  padding: 8px;
}
.list-visibility-menu > strong {
  display: block;
  color: var(--dim);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 7px 9px 9px;
}
.list-visibility-option {
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  padding: 9px;
  text-align: left;
  transition: background .15s ease;
}
.list-visibility-option:hover:not(:disabled) { background: var(--accent-soft); transform: none; box-shadow: none; }
.list-visibility-option:disabled { opacity: .5; cursor: wait; }
.list-visibility-option-icon { flex: 0 0 auto; font-size: 1.1rem; line-height: 1.3; }
.list-visibility-option-copy { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.list-visibility-option-copy strong { display: block; font-size: .85rem; }
.list-visibility-option-copy small { display: block; color: var(--dim); font-size: .73rem; line-height: 1.4; }
.list-visibility-option-check { flex: 0 0 auto; color: var(--focus); font-weight: 800; opacity: 0; }
.list-visibility-option.is-selected { background: rgba(155, 77, 204, .07); }
.list-visibility-option.is-selected .list-visibility-option-check { opacity: 1; }

@media (max-width: 700px) {
  .list-visibility-picker { margin: 0 12px; max-width: calc(100% - 24px); }
  .list-visibility-menu { width: min(250px, calc(100vw - 56px)); }
}

/* Reading lists on the public profile page */
.user-reading-lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.user-reading-lists > .user-profile-empty { grid-column: 1 / -1; }
.user-reading-lists .reading-list-card-link { padding-bottom: 18px; }
.reading-list-visibility-badge {
  display: inline-block; margin-top: 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--focus); font-size: .7rem; font-weight: 800; padding: 3px 9px;
}

/* Reading list ratings */
.reading-list-card-link .reading-list-rating { margin: 8px 0 0; color: var(--dusk); font-size: .85rem; font-weight: 700; }
.reading-list-card-link .reading-list-rating.is-unrated { color: var(--dim); font-weight: 500; }
.reading-list-rating strong { color: var(--ink); }
.reading-list-rating .reading-list-rating-count { color: var(--muted); font-weight: 500; }

/* .reviews-section sets display:grid, which would override the hidden attribute */
.list-reviews-section[hidden] { display: none; }

.profile-vote-link { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: #cfa4e8; font-size: 12px; text-decoration: none; }
.profile-vote-link[hidden] { display: none; }
.profile-vote-link:hover { color: var(--ink); }

/* =========================================================================
   READING LISTS -- snug, cozy redesign
   Keep this block LAST in the file: it supersedes the earlier reading-list,
   bookcase, visibility-picker and (previously missing) like-heart rules.

   Design notes
   - The one memorable thing is the lamp-lit oak shelf on each list card.
     Everything around it stays quiet: hairline borders, soft tone shifts,
     no lift-on-hover on every tile.
   - Dusk blue and muted plum give the shelf depth; the rose --passion stays
     reserved for the heart so a like remains the warmest thing on the page.
   ========================================================================= */

:root {
  --rl-radius: 20px;
  --rl-glow: rgba(110, 146, 196, 0.12);
  --rl-glow-strong: rgba(110, 146, 196, 0.20);
  --rl-hairline: rgba(214, 197, 238, 0.10);
  --rl-wood: linear-gradient(180deg, #74536f 0%, #493347 48%, #2a1d31 100%);
}

@keyframes rl-rise {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes list-like-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ---------- Page frame ---------- */

.reading-lists-page {
  width: min(1120px, calc(100% - 32px));
  padding: 36px 0 96px;
}

.reading-lists-page > .novel-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.reading-lists-page > .novel-back-link:hover {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--ink);
}

.reading-lists-page .search-results-heading {
  margin-bottom: 28px;
}

.reading-lists-page .search-results-heading h1 {
  margin-bottom: 10px;
  font-size: clamp(2.3rem, 4.6vw, 3.4rem);
  line-height: 1.05;
}

/* ---------- Single-list header (list.html / shared-list.html) ---------- */

.reading-lists-page .reading-list-heading {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  max-width: none;
  margin: 0 0 32px;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(90% 140% at 0% 0%, var(--rl-glow), transparent 60%),
    linear-gradient(150deg, rgba(38, 19, 52, 0.86), rgba(12, 6, 22, 0.9));
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.reading-lists-page .reading-list-heading > .eyebrow,
.reading-lists-page .reading-list-heading > h1 {
  flex: 0 0 100%;
  margin: 0;
}

.reading-lists-page .reading-list-heading > .eyebrow {
  margin-bottom: 2px;
}

.reading-lists-page .reading-list-heading > h1 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.reading-lists-page .reading-list-heading .reading-lists-summary {
  margin: 0;
  font-size: 0.98rem;
}

.reading-list-like-slot {
  display: inline-flex;
}

.reading-list-like-slot:empty {
  display: none;
}

/* ---------- The heart (whole-list like) ---------- */

.list-like {
  display: inline-flex;
  align-items: center;
}

.list-like .list-like-button {
  width: auto;
  min-height: 34px;
  padding: 0 13px 0 11px;
  gap: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.list-like .list-like-button:hover {
  transform: none;
  box-shadow: none;
}

.list-like .list-like-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  transition: fill 0.16s ease, stroke 0.16s ease, transform 0.16s ease;
}

.list-like .list-like-count {
  min-width: 1ch;
  line-height: 1;
}

.list-like .list-like-button:not(.is-own):hover {
  border-color: rgba(209, 74, 85, 0.5);
  background: var(--passion-soft);
  color: #f4a3ab;
}

.list-like .list-like-button:not(.is-own):hover .list-like-icon {
  transform: scale(1.12);
}

.list-like .list-like-button.is-liked {
  border-color: rgba(209, 74, 85, 0.55);
  background: var(--passion-soft);
  color: #ff8a95;
}

.list-like .list-like-button.is-liked .list-like-icon {
  fill: var(--passion);
  stroke: var(--passion);
}

.list-like .list-like-button.is-popping .list-like-icon {
  animation: list-like-pop 0.35s ease-out;
}

/* Owner view: a quiet read-only count, not a dead button. */
.list-like .list-like-button.is-own {
  cursor: default;
  color: var(--dim);
}

.list-like .list-like-button.is-own.has-likes {
  color: #d99aa1;
}

.list-like .list-like-button.is-own.has-likes .list-like-icon {
  fill: rgba(209, 74, 85, 0.55);
  stroke: rgba(209, 74, 85, 0.8);
}

.list-like .list-like-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.list-like.large .list-like-button {
  min-height: 42px;
  padding: 0 18px 0 15px;
  font-size: 0.95rem;
}

.list-like.large .list-like-icon {
  width: 21px;
  height: 21px;
  flex-basis: 21px;
}

/* ---------- My reading lists grid + cards ---------- */

.reading-lists-grid,
.user-reading-lists {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

/* A visual shelf behind the library only. It deliberately has no padding or
   layout rules, so the existing card grid never shifts to accommodate it. */
.reading-lists-ground {
  position: relative;
  isolation: isolate;
}

.reading-lists-ground::before {
  position: absolute;
  z-index: -1;
  top: -20px;
  right: -18px;
  bottom: -34px;
  left: -18px;

  border: 1px solid rgba(173, 121, 211, 0.30);
  border-radius: 20px;
  background:
    radial-gradient(circle at 90% 18%, rgba(110, 146, 196, 0.20), transparent 35%),
    radial-gradient(circle at 10% 88%, rgba(95, 155, 130, 0.13), transparent 32%),
    linear-gradient(145deg, rgba(40, 21, 57, 0.44), rgba(16, 8, 29, 0.38));
  box-shadow: 0 26px 62px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.045);

  content: "";
  pointer-events: none;
}

.reading-list-card {
  position: relative;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--rl-radius);
  background:
    radial-gradient(circle at 88% 8%, var(--dusk-soft), transparent 42%),
    linear-gradient(160deg, rgba(40, 20, 55, 0.82), rgba(14, 7, 25, 0.90));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reading-list-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Title, count and rating sit in a small grid so "3 novels  ★ 4.5/5" share a line. */
.reading-list-card .reading-list-card-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  align-items: baseline;
  padding: 14px 14px 0;
  border-radius: var(--rl-radius) var(--rl-radius) 0 0;
}

.reading-list-card .reading-list-card-link > .list-bookcase,
.reading-list-card .reading-list-card-link > h3,
.reading-list-card .reading-list-card-link > .reading-list-visibility-badge {
  grid-column: 1 / -1;
}

.reading-list-card .reading-list-card-link h3 {
  margin: 16px 0 6px;
  font-size: 1.3rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.reading-list-card .reading-list-card-link:hover h3 {
  color: var(--dusk);
}

.reading-list-card .reading-list-card-link p {
  font-size: 0.84rem;
}

.reading-list-card .reading-list-card-link .reading-list-rating {
  margin: 0;
}

.reading-list-card .reading-list-card-link .reading-list-visibility-badge {
  justify-self: start;
  margin: 12px 0 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.reading-list-card .reading-list-card-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -3px;
}

/* Footer rows sink to the bottom so cards in one grid row line up. */
.reading-list-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
}

.reading-list-card-like-row {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding: 12px 14px 14px;
}

.reading-list-card .reading-list-card-meta-row .list-like {
  margin-left: auto;
}

/* Rename | Delete: a quiet bar along the bottom edge. */
.reading-list-card .reading-list-card-actions {
  display: flex;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-top: 1px solid var(--rl-hairline);
  border-radius: 0 0 var(--rl-radius) var(--rl-radius);
}

.reading-list-card .reading-list-action {
  flex: 1 1 0;
  width: auto;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  transition: background 0.16s ease, color 0.16s ease;
}

.reading-list-card .reading-list-action + .reading-list-action {
  border-left: 1px solid var(--rl-hairline);
}

.reading-list-card .reading-list-action:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

.reading-list-card .reading-list-action:last-child:hover {
  background: var(--passion-soft);
  color: #f5b3ba;
}

.reading-list-card .reading-list-action:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -3px;
}

/* ---------- The lamp-lit shelf ---------- */

.list-bookcase {
  position: relative;
  display: block;
  height: 160px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(110, 146, 196, 0.24);
  border-radius: 14px;
  background:
    radial-gradient(ellipse 70% 90% at 50% 0%, var(--rl-glow-strong), transparent 70%),
    linear-gradient(180deg, rgba(22, 11, 30, 0.92), rgba(9, 4, 14, 0.96));
}

/* A plum-toned shelf anchors the books without bringing back the old gold. */
.list-bookcase::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 22px;
  border: 0;
  border-radius: 0;
  content: "";
  background: var(--rl-wood);
  filter: none;
  box-shadow: inset 0 1px 0 rgba(224, 205, 244, 0.18), 0 -10px 20px rgba(0, 0, 0, 0.35);
}

.list-preview-book {
  bottom: 21px;
  width: 82px;
  border-color: rgba(255, 255, 255, 0.16);
}

.list-preview-book:nth-child(1) {
  left: calc(50% - 88px);
  height: 124px;
}

.list-preview-book:nth-child(2) {
  left: calc(50% - 34px);
  height: 120px;
}

.list-preview-book:nth-child(3) {
  left: calc(50% + 20px);
  height: 116px;
}

/* A soft crease down the spine of every cover. */
.list-preview-book::before {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 12%;
  content: "";
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.42), rgba(255, 255, 255, 0.08) 60%, transparent);
  pointer-events: none;
}

.list-preview-book.is-empty::before {
  display: none;
}

/* ---------- Visibility chip + popover ---------- */

.list-visibility-picker {
  margin: 0;
  max-width: none;
}

.list-visibility-chip {
  min-height: 34px;
  font-size: 0.8rem;
}

/* Opens upward, over its own card, so it never spills onto the row below. */
.list-visibility-menu {
  top: auto;
  bottom: calc(100% + 8px);
  left: 0;
  width: 232px;
  border-radius: 14px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  transform-origin: bottom left;
  animation: rl-rise 0.16s ease-out;
}

/* ---------- "Start a new list" ghost card ---------- */

.reading-list-card.create-list-card {
  justify-content: center;
  border: 1.5px dashed rgba(110, 146, 196, 0.38);
  border-radius: var(--rl-radius);
  background: linear-gradient(145deg, var(--dusk-soft), rgba(95, 155, 130, 0.035));
  padding: 14px;
}

.reading-list-card.create-list-card:hover {
  border-color: rgba(110, 146, 196, 0.68);
  background: linear-gradient(145deg, rgba(110, 146, 196, 0.20), rgba(95, 155, 130, 0.08));
  transform: none;
}

.create-list-preview {
  height: 160px;
  border: 1px dashed rgba(110, 146, 196, 0.32);
  border-radius: 14px;
  background: radial-gradient(circle at 50% 50%, var(--rl-glow), transparent 60%), rgba(4, 2, 9, 0.4);
}

.create-list-plus {
  border-color: rgba(110, 146, 196, 0.62);
  color: var(--dusk);
}

.reading-list-card.create-list-card:hover .create-list-plus {
  background: rgba(110, 146, 196, 0.20);
}

.create-list-card strong,
.create-list-card small {
  text-align: center;
}

.create-list-card small {
  font-weight: 500;
  line-height: 1.4;
}

/* ---------- Novels on a list ---------- */

.reading-lists-page .search-results-grid {
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 20px;
}

/* A tile is the novel itself (shared list) or the novel plus its chapter
   controls (your own list). Borders, not shadows: hover only warms the edge. */
.reading-lists-page .search-results-grid > .book-card-link > .book-card,
.reading-lists-page .list-novel-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(38, 19, 52, 0.55), rgba(12, 6, 22, 0.7));
  transition: border-color 0.2s ease, background 0.2s ease;
}

.reading-lists-page .search-results-grid > .book-card-link:hover > .book-card,
.reading-lists-page .list-novel-item:hover {
  border-color: var(--line-strong);
  background: linear-gradient(160deg, rgba(48, 24, 66, 0.6), rgba(14, 7, 26, 0.75));
}

/* The old outline-on-hover is redundant inside a tile; keep the keyboard ring. */
.reading-lists-page .book-card-link:hover .book-card {
  outline: none;
}

.reading-lists-page .book-card-link:focus-visible .book-card {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.reading-lists-page .book-cover {
  min-height: 250px;
  border-radius: 10px;
}

.reading-lists-page .book-card h3 {
  margin: 12px 2px 4px;
  font-size: 0.98rem;
}

.reading-lists-page .book-card p {
  display: -webkit-box;
  margin: 0 2px 2px;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 400;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.reading-lists-page .list-novel-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-novel-chapter {
  margin: 0;
  padding: 9px 12px;
  gap: 10px;
  border: 1px solid var(--rl-hairline);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.list-novel-chapter-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.list-novel-chapter-input {
  width: 68px;
  min-height: 34px;
  border-radius: 9px;
  text-align: center;
}

.list-novel-chapter-status {
  margin-left: auto;
  color: var(--dusk);
  font-size: 0.75rem;
}

/* Remove appears on hover/focus so tiles stay calm; always visible on touch. */
.reading-lists-page .list-novel-item .list-novel-remove {
  top: 18px;
  right: 18px;
  z-index: 2;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(10, 4, 16, 0.74);
  backdrop-filter: blur(6px);
  box-shadow: none;
  color: #f4dfe2;
  font-size: 0.74rem;
  font-weight: 750;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.reading-lists-page .list-novel-item:hover .list-novel-remove,
.reading-lists-page .list-novel-item .list-novel-remove:focus-visible {
  opacity: 1;
  transform: none;
}

.reading-lists-page .list-novel-item .list-novel-remove:hover {
  border-color: transparent;
  background: rgba(209, 74, 85, 0.92);
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.reading-lists-page .list-novel-item .list-novel-remove:disabled {
  opacity: 0.5;
  cursor: wait;
}

@media (hover: none) {
  .reading-lists-page .list-novel-item .list-novel-remove {
    opacity: 1;
    transform: none;
  }
}

.reading-lists-page .search-empty {
  padding: 48px 24px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

/* ---------- Reviews on a list ---------- */

.list-reviews-section {
  margin-top: 48px;
  padding-top: 34px;
}

.list-reviews-section .review-composer,
.list-reviews-section .review-card {
  border-radius: 18px;
}

/* ---------- Refined inbox cards ---------- */
.inbox-list { gap: 14px; margin-top: 18px; }
.inbox-message { border-radius: 14px; background: linear-gradient(110deg, rgba(33, 17, 48, .78), rgba(14, 7, 25, .84)); box-shadow: 0 12px 30px rgba(0, 0, 0, .13), inset 0 1px 0 rgba(255, 255, 255, .025); transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.inbox-message[open] { border-color: rgba(110, 146, 196, .46); background: linear-gradient(120deg, rgba(43, 23, 61, .88), rgba(15, 8, 28, .92)); }
.inbox-message > summary { gap: 11px; padding: 14px 18px; }
.inbox-message > summary:hover { background: rgba(255, 255, 255, .035); }
.inbox-message-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid rgba(110, 146, 196, .42); border-radius: 10px; background: linear-gradient(145deg, rgba(110, 146, 196, .18), rgba(155, 77, 204, .12)); color: #b9d0f3; font-size: .95rem; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.inbox-message-body { padding: 18px 22px 20px 62px; }
.inbox-message-actions { justify-content: flex-start; }
.inbox-message-actions .ghost-link { width: auto; min-height: 36px; padding: 0 13px; font-size: .78rem; }
.inbox-read-toggle { min-height: 36px; }

@media (max-width: 560px) {
  .inbox-message-body { padding: 15px 16px 16px; }
  .inbox-message-icon { width: 31px; height: 31px; flex-basis: 31px; border-radius: 9px; }
}

/* ---------- Dialogs ---------- */

.modal-card {
  border-color: var(--line-strong);
  border-radius: 20px;
}

.modal-overlay:not(.is-hidden) .modal-card {
  animation: rl-rise 0.2s ease-out;
}

.create-list-modal > input {
  height: 50px;
  padding: 0 15px;
  border-radius: 12px;
}

.create-list-modal .modal-actions button {
  border-radius: 12px;
}

.create-list-modal .create-list-error {
  margin: 10px 0 0;
  color: #fda4af;
  font-size: 0.85rem;
  line-height: 1.45;
}

.create-list-modal .create-list-error:empty {
  display: none;
}

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  .reading-lists-page .reading-list-heading {
    padding: 22px 20px;
    border-radius: 20px;
  }

  .reading-lists-page .search-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 14px;
  }

  .reading-lists-page .book-cover {
    min-height: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reading-lists-page *,
  .user-reading-lists *,
  .modal-overlay * {
    animation: none !important;
    transition: none !important;
  }
}

/* Threaded replies stay quieter than the original review, but every entry
   gets the same compact discussion controls. */
.review-replies { display: grid; gap: 14px; margin-top: 16px; }
.review-thread-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-height: 32px; margin-top: 11px; color: var(--dim); }
.review-thread-actions .review-like { gap: 4px; margin-right: 3px; }
.review-thread-actions .review-like-button { width: 28px; min-height: 28px; border: 0; border-radius: 6px; background: transparent; }
.review-thread-actions .review-like-button:hover:not(:disabled) { background: var(--dusk-soft); }
.review-thread-actions .review-like-count { min-width: 8px; font-size: .76rem; }
.review-thread-placeholder,
.review-reply-button { width: auto; min-height: 28px; flex: 0 0 auto; border: 0; border-radius: 6px; background: transparent; box-shadow: none; color: var(--dusk); padding: 4px 7px; font-size: .76rem; font-weight: 800; }
.review-thread-placeholder { color: var(--dim); cursor: not-allowed; opacity: .58; }
.review-reply-button:hover, .review-reply-button:focus-visible { background: var(--dusk-soft); color: var(--ink); transform: none; box-shadow: none; }
.review-reply-action-row { display: contents; }
.review-reply-form { flex: 0 0 100%; }
.review-more-actions { position: relative; width: auto; flex: 0 0 auto; margin-left: 1px; }
.review-more-actions > summary { width: 28px; min-height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--dim); cursor: pointer; font-size: .9rem; font-weight: 800; letter-spacing: 1px; list-style: none; }
.review-more-actions > summary::-webkit-details-marker { display: none; }
.review-more-actions > summary:hover, .review-more-actions[open] > summary { background: rgba(255,255,255,.07); color: var(--ink); }
.review-more-menu { position: absolute; z-index: 8; top: calc(100% + 6px); right: 0; width: 168px; display: grid; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 9px; background: linear-gradient(145deg, #261432, #100819); box-shadow: 0 16px 36px rgba(0,0,0,.36); padding: 5px; }
.review-more-menu button { width: 100%; min-height: 32px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); padding: 0 9px; text-align: left; font: inherit; font-size: .78rem; cursor: pointer; }
.review-more-menu button:hover, .review-more-menu button:focus-visible { background: var(--dusk-soft); }
.review-more-menu button.is-danger { color: #ff8388; }
.review-more-menu button.is-danger:hover, .review-more-menu button.is-danger:focus-visible { background: rgba(209,74,85,.14); }
.review-more-menu .review-thread-placeholder { color: var(--dim); opacity: .64; }
.review-more-menu hr { width: 100%; height: 1px; border: 0; background: var(--line); margin: 4px 0; }
.review-reply-form { display: grid; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: rgba(110, 146, 196, .055); padding: 12px; }
.review-reply-form label { display: grid; gap: 7px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.review-reply-form textarea { width: 100%; min-height: 76px; resize: vertical; border: 1px solid var(--line); border-radius: 7px; background: rgba(3, 1, 8, .5); color: var(--ink); font: inherit; line-height: 1.5; padding: 9px 10px; }
.review-reply-form textarea:focus { border-color: var(--focus); outline: 2px solid color-mix(in srgb, var(--focus) 22%, transparent); }
.review-reply-form-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.review-reply-form-footer [role="status"] { margin-right: auto; color: #ef9d9d; font-size: .78rem; }
.review-reply-form-footer button { width: auto; min-height: 34px; padding: 0 11px; font-size: .76rem; }
.review-reply { display: grid; gap: 6px; margin-left: 16px; border-left: 2px solid rgba(110, 146, 196, .30); padding: 2px 0 0 15px; }
.review-reply-header { display: flex; align-items: center; gap: 9px; }
.review-reply-avatar { width: 30px; height: 30px; flex: 0 0 30px; overflow: hidden; display: grid; place-items: center; border: 1px solid rgba(110, 146, 196, .35); border-radius: 50%; background: linear-gradient(145deg, #26304c, #3d2e50); color: var(--ink); font-size: .72rem; font-weight: 800; }
.review-reply-avatar img { width: 100%; height: 100%; object-fit: cover; }
.review-reply-header a { color: var(--ink); font-size: .82rem; font-weight: 800; text-decoration: none; }
.review-reply-header a:hover, .review-reply-header a:focus-visible { color: var(--dusk); text-decoration: underline; text-underline-offset: 3px; }
.review-reply-header time { display: block; margin-top: 2px; color: var(--dim); font-size: .72rem; }
.review-reply > p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-reply .review-replies { margin-top: 4px; }
.review-card.is-activity-target, .review-reply.is-activity-target { border-color: var(--dusk); background-color: rgba(110, 146, 196, .11); box-shadow: 0 0 0 4px rgba(110, 146, 196, .16), 0 20px 48px rgba(0, 0, 0, .30); }
.review-reply.is-activity-target { border-left-color: var(--dusk); }
@media (max-width: 620px) { .review-reply { margin-left: 8px; padding-left: 11px; } }
.profile-manage-page .consistent-select select,
.upload-novel-page .consistent-select select {
  appearance: none;
  padding-right: 36px;
  background-color: rgba(3, 1, 8, 0.78);
}
.profile-manage-page select option,
.upload-novel-page select option {
  background-color: rgba(3, 1, 8, 0.78);
}
