:root {
  --bg-top: #f4f6fb;
  --bg-mid: #fbf8f4;
  --bg-bottom: #edf1fb;
  --text: #171a21;
  --muted: #596273;
  --subtle: #707b8a;
  --card: rgba(255, 255, 255, 0.9);
  --card-border: rgba(20, 28, 40, 0.08);
  --shadow: 0 12px 40px rgba(22, 34, 56, 0.08), 0 2px 8px rgba(22, 34, 56, 0.04);
  --radius-lg: 28px;
  --radius-sm: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --accent: #8d4eb0;
  --link: #1f62ea;
}

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

body.creator-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(ellipse 120% 72% at 50% -14%, rgba(255, 255, 255, 0.98), transparent 58%),
    linear-gradient(165deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bottom) 100%);
  background-attachment: fixed;
}

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

/* Breadcrumb + asset hints (LifeLoveMe navigation) */
.app-breadcrumb {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.85rem;
  padding: 0 clamp(1.25rem, 5vw, 2rem);
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.app-breadcrumb a {
  color: var(--link);
  text-decoration: none;
}

.app-breadcrumb a:hover {
  text-decoration: underline;
}

.app-breadcrumb__sep {
  color: var(--subtle);
  font-weight: 500;
  user-select: none;
}

.app-breadcrumb__here {
  color: var(--text);
  font-weight: 700;
}

.asset-tab-note {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: #fff;
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  left: 0.75rem;
}

.site-header {
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(1.15rem, 4vw, 1.75rem) clamp(1.25rem, 5vw, 2rem) 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--subtle);
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.22rem 0.4rem;
  border-radius: 7px;
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
  text-decoration: none;
}

.site-nav__sep {
  color: rgba(0, 0, 0, 0.12);
  user-select: none;
  font-weight: 400;
}

.page-hero {
  text-align: center;
  padding: clamp(1.75rem, 5vw, 2.75rem) 0 clamp(0.25rem, 2vw, 0.75rem);
}

.page-hero__eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--subtle);
}

.page-hero__icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.85rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 28, 40, 0.06);
  color: var(--accent);
  font-size: 28px;
}

.page-hero__title {
  margin: 0.85rem 0 0;
  font-size: clamp(2.1rem, 5.5vw, 3rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.page-hero__intro {
  margin: 1.05rem auto 0;
  max-width: 52rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
}

.page-main {
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2rem) clamp(1.25rem, 5vw, 2rem) clamp(3rem, 7vw, 4.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.6rem, 4vw, 2.4rem);
}

.group-section__title {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
}

.group-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(1.05rem, 3vw, 1.35rem);
  backdrop-filter: blur(12px);
}

.books-help {
  margin-bottom: 0.15rem;
}

.body-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.6;
}

.books-state {
  text-align: center;
  font-weight: 600;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.book-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem;
  backdrop-filter: blur(12px);
}

.book-cover {
  width: 100%;
  aspect-ratio: 16 / 8.5;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(20, 28, 40, 0.08);
  background: linear-gradient(140deg, rgba(225, 234, 252, 0.8), rgba(252, 242, 251, 0.82));
  margin-bottom: 0.82rem;
}

.book-cover__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-cover--placeholder {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.9rem;
  background:
    radial-gradient(130% 120% at 0% 0%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.2)),
    linear-gradient(140deg, rgba(141, 78, 176, 0.35), rgba(34, 104, 255, 0.3));
}

.book-cover__initials {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #553072;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.book-cover__title {
  color: #262f40;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card h3 {
  margin: 0;
  letter-spacing: -0.02em;
  font-size: 1.02rem;
}

.book-card p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.book-card--interactive {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.book-card--interactive:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 28, 40, 0.14);
  box-shadow: 0 18px 44px rgba(22, 34, 56, 0.1), 0 6px 14px rgba(22, 34, 56, 0.06);
}

.book-card--interactive:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.book-subtitle {
  margin: 0.28rem 0 0;
  color: #414957;
  font-weight: 600;
  font-size: 0.9rem;
}

.book-short {
  margin: 0.35rem 0 0;
}

.book-category {
  margin: 0.42rem 0 0;
  color: #4f5a69;
  font-size: 0.86rem;
  font-weight: 600;
}

.book-summary {
  margin: 0.7rem 0 0;
  color: #3c4351;
  line-height: 1.65;
  font-size: 0.93rem;
  border-top: 1px dashed rgba(20, 28, 40, 0.16);
  padding-top: 0.65rem;
}

.meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.06);
  color: #2b3340;
  border: 1px solid rgba(0, 0, 0, 0.07);
}

.pill--status {
  background: rgba(141, 78, 176, 0.1);
  border-color: rgba(141, 78, 176, 0.14);
}

.pill--tag {
  background: rgba(34, 104, 255, 0.08);
  border-color: rgba(34, 104, 255, 0.14);
}

.book-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 0.78rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.action-btn:hover {
  text-decoration: none;
}

.action-btn--summary {
  background: rgba(141, 78, 176, 0.11);
  border-color: rgba(141, 78, 176, 0.2);
  color: #6f2f95;
}

.action-btn--summary:hover {
  background: rgba(141, 78, 176, 0.18);
}

.action-btn--read {
  background: rgba(22, 161, 132, 0.12);
  border-color: rgba(22, 161, 132, 0.2);
  color: #10765f;
}

.action-btn--read:hover {
  background: rgba(22, 161, 132, 0.18);
}

.action-btn--download {
  background: rgba(34, 104, 255, 0.11);
  border-color: rgba(34, 104, 255, 0.2);
  color: #1b4bc2;
}

.action-btn--download:hover {
  background: rgba(34, 104, 255, 0.18);
}

.action-btn--open-pdf {
  background: rgba(245, 157, 45, 0.14);
  border-color: rgba(245, 157, 45, 0.24);
  color: #9b5b07;
}

.action-btn--open-pdf:hover {
  background: rgba(245, 157, 45, 0.22);
}

.action-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 0.78rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(130, 142, 158, 0.12);
  border: 1px solid rgba(130, 142, 158, 0.2);
  color: #586272;
}

.pdf-beta-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 0.78rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(130, 142, 158, 0.1);
  border: 1px dashed rgba(130, 142, 158, 0.35);
  color: #586272;
  cursor: default;
  user-select: none;
}

.reader-header .pdf-beta-status-chip {
  align-self: flex-start;
}

.tab-panel .pdf-beta-status-chip {
  margin-top: 0.5rem;
}

.page-footer {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2rem) clamp(2.5rem, 6vw, 3.5rem);
  text-align: center;
}

.page-footer p {
  margin: 0;
  font-size: 0.95rem;
}

.page-footer a {
  color: var(--muted);
  font-weight: 700;
}

.page-footer a:hover {
  color: var(--accent);
}

.book-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0.5rem 0 0;
}

.book-gallery__thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--card-border);
}

.book-reviews {
  margin: 0.65rem 0 0;
}

.book-review {
  margin: 0.35rem 0;
  padding-left: 0.75rem;
  border-left: 3px solid rgba(141, 78, 176, 0.35);
  font-size: 0.88rem;
  color: var(--muted);
}

.book-availability-note {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--subtle);
  font-style: italic;
  width: 100%;
}

.books-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.books-search__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 0.35rem;
}

.books-search__input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  font-family: var(--font);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.books-search__input:focus {
  outline: 2px solid rgba(141, 78, 176, 0.45);
  outline-offset: 2px;
}

.books-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.books-filter {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  cursor: pointer;
}

.books-filter:hover {
  border-color: rgba(141, 78, 176, 0.35);
  color: var(--text);
}

.books-filter--active {
  background: rgba(141, 78, 176, 0.14);
  border-color: rgba(141, 78, 176, 0.45);
  color: #553072;
}

.books-results-summary {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--subtle);
}

.books-group {
  margin-bottom: 0.5rem;
}

.books-group__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.15rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
  background: none;
  border: none;
  border-bottom: 1px solid rgba(20, 28, 40, 0.08);
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
}

.books-group__toggle::after {
  content: "▾";
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.books-group--collapsed .books-group__toggle::after {
  transform: rotate(-90deg);
}

.books-group--collapsed .books-group__panel {
  display: none;
}

.books-empty {
  text-align: center;
}

.book-status-chip {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.15rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
}

.book-status-chip--pdf {
  background: rgba(22, 161, 132, 0.14);
  color: #10765f;
}

.book-status-chip--metadata {
  background: rgba(130, 142, 158, 0.16);
  color: #586272;
}

.book-status-chip--needs-cover {
  background: rgba(245, 157, 45, 0.18);
  color: #9b5b07;
}

@media (max-width: 820px) {
  .book-grid {
    grid-template-columns: 1fr;
  }

  .book-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
