body {
  background:
    radial-gradient(circle at top, rgba(88, 101, 242, 0.22), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(116, 52, 255, 0.18), transparent 24%),
    linear-gradient(160deg, #050713 0%, #0a1024 45%, #13092a 100%);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(131, 153, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(131, 153, 255, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 85%);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.site-header h1 {
  margin: 4px 0 0;
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: 0.04em;
}

.eyebrow,
.section-tag {
  margin: 0;
  color: #79dbff;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link,
.ghost-button,
.primary-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.nav-link,
.ghost-button {
  background: rgba(14, 20, 44, 0.58);
  border: 1px solid rgba(123, 139, 255, 0.32);
  color: #eef2ff;
}

.primary-button {
  background: linear-gradient(135deg, #39c5ff, #6a5cff 55%, #9f51ff);
  box-shadow: 0 0 18px rgba(98, 114, 255, 0.42);
  color: #ffffff;
}

.nav-link:hover,
.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(113, 128, 255, 0.34);
}

.panel {
  background: rgba(8, 12, 28, 0.7);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(107, 122, 255, 0.24);
  box-shadow: inset 0 0 0 1px rgba(79, 214, 255, 0.04), 0 12px 40px rgba(1, 4, 16, 0.44);
  border-radius: 24px;
  padding: 24px;
}

.muted {
  color: #a8b1d8;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h3,
.section-head h2 {
  margin: 0;
}

.search-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  width: min(700px, 100%);
}

.search-bar input {
  min-height: 50px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(113, 128, 255, 0.28);
  background: rgba(3, 8, 24, 0.82);
  color: #eff1ff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.book-card,
.continue-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(111, 128, 255, 0.24);
  background: linear-gradient(180deg, rgba(13, 19, 40, 0.84), rgba(10, 15, 34, 0.68));
  box-shadow: 0 0 18px rgba(91, 107, 255, 0.14);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.book-card:hover,
.continue-card:hover {
  transform: translateY(-3px);
  border-color: rgba(102, 213, 255, 0.46);
  box-shadow: 0 0 26px rgba(87, 145, 255, 0.22);
}

.book-cover {
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(8, 12, 30, 0.95);
  border: 1px solid rgba(118, 132, 255, 0.22);
}

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

.book-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.book-meta h3,
.book-meta h4 {
  margin: 0;
}

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

.tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(66, 82, 172, 0.28);
  border: 1px solid rgba(113, 128, 255, 0.26);
  color: #dfe7ff;
  font-size: 12px;
}

.empty-state {
  padding: 28px 18px;
  text-align: center;
  color: #aab4dd;
  border-radius: 20px;
  border: 1px dashed rgba(119, 135, 255, 0.22);
  background: rgba(12, 18, 38, 0.44);
}

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  z-index: 999;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(10, 14, 30, 0.92);
  border: 1px solid rgba(111, 128, 255, 0.3);
  box-shadow: 0 0 18px rgba(90, 109, 255, 0.24);
}

.login-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 16, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 998;
}

.login-modal {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
}

.login-modal form {
  display: grid;
  gap: 12px;
}

.login-modal input {
  min-height: 48px;
  border-radius: 14px;
  padding: 0 14px;
  border: 1px solid rgba(116, 131, 255, 0.3);
  background: rgba(5, 9, 24, 0.84);
  color: #eff2ff;
}

@media (max-width: 768px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .site-header {
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-bar {
    grid-template-columns: 1fr;
  }
}
