/* Home: My books, the new-book dialog and the guide dialog */

.home-view {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding-bottom: 54px;
}

.home-nav {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.shelf-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 6px 0 18px;
}

.shelf-title {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
}

.book-search {
  position: relative;
  flex: 0 1 320px;
}

.book-search .book-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  transform: translateY(-50%);
  pointer-events: none;
}

.book-search input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--field-line);
  border-radius: 13px;
  background: var(--field);
  font-weight: 600;
  -webkit-appearance: none;
  appearance: none;
}

.book-search input::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.book-search input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px var(--focus-glow);
  outline: 0;
}

.book-spark {
  margin: 0 0 6px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--book-status-ink);
  background: var(--blue-pale);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.3;
}

.book-status[data-state="fresh"] {
  color: var(--book-status-fresh-ink);
  background: var(--green-pale);
}

.book-status[data-state="outdated"] {
  color: var(--book-status-outdated-ink);
  background: var(--gold-pale);
}

.book-list-more {
  display: flex;
  justify-content: center;
  padding-top: 18px;
}

.home-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding-top: 36px;
  color: var(--ink-soft);
  font-size: 0.83rem;
  text-align: center;
}

.home-footer.is-save-error {
  color: var(--error-ink);
  font-weight: 800;
}

.home-footer.is-save-error .device-dot {
  background: var(--error);
  box-shadow: 0 0 0 4px rgba(173, 75, 57, 0.12);
}

.device-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-pale);
}

.setup-dialog {
  width: min(calc(100% - 32px), 610px);
  overflow: hidden;
}

.setup-dialog form {
  padding: 38px;
}

.guide-dialog {
  position: relative;
  width: min(calc(100% - 32px), 780px);
  padding: 37px;
  overflow: hidden;
}

.guide-dialog-art {
  position: absolute;
  top: -100px;
  right: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: var(--violet-pale);
}

.guide-orbit {
  position: absolute;
  top: 90px;
  left: 30px;
  width: 180px;
  height: 70px;
  border: 2px solid rgba(102, 87, 199, 0.23);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.guide-star {
  position: absolute;
  top: 142px;
  left: 54px;
  color: var(--gold);
  font-size: 1.5rem;
}

.story-loop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 20px;
  padding: 13px;
  border: 1px dashed var(--story-loop-line);
  border-radius: 13px;
  color: var(--ink-soft);
  background: var(--violet-faint);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.story-loop b {
  color: var(--violet);
}

@media (max-width: 780px) {
  .home-view {
    width: min(calc(100% - 24px), var(--max-width));
  }

  .home-nav {
    min-height: 76px;
  }

  /* The brand mark alone, to make room for the theme button. */
  .home-nav .brand > span:last-child {
    display: none;
  }

  .home-nav .button-secondary {
    display: none;
  }

  .home-nav [data-action="open-explore"] {
    display: inline-flex;
  }

  .setup-dialog form,
  .guide-dialog {
    padding: 27px 21px;
  }
}

@media (max-width: 560px) {
  .home-nav-actions {
    gap: 6px;
  }

  .book-search {
    flex-basis: 100%;
  }

  .book-spark {
    display: none;
  }
}

@media (max-width: 500px) {
  .home-nav .button-primary {
    width: 44px;
    padding: 0;
    font-size: 0.86rem;
  }

  .home-nav .new-book-label {
    display: none;
  }

  .home-nav [data-action="open-explore"] {
    min-width: 44px;
    padding-inline: 9px;
    font-size: 0.76rem;
  }

  .home-nav [data-action="open-explore"] > span {
    display: none;
  }

  /* The avatar alone, to make room for the theme button. */
  .home-nav .account-control {
    padding: 5px;
  }

  .home-nav .account-compact-label {
    display: none;
  }
}

@media (max-width: 360px) {
  .home-nav [data-action="open-explore"] {
    padding-inline: 7px;
    font-size: 0.7rem;
  }
}
