/* Library Sun — "Luz pastel": clean iOS-like structure with a warm pastel palette.
   Light and dark follow the device setting. */

:root {
  color-scheme: light dark;

  --bg-1: #fbf8ff;
  --bg-2: #fff6ef;
  --card: #fff;
  --ink: #221d33;
  --ink-2: #4a435e;
  --muted: #8e87a3;
  --line: #eee8f6;

  --lav: #8b7cf6;
  --lav-2: #a996ff;
  --peach: #ffae7a;
  --pink: #ff8fb1;
  --lav-soft: #efeaff;
  --glow: rgb(139 124 246 / 22%);

  --tile-1: #ffeadd;
  --tile-2: #e2f5ec;
  --tile-3: #ffe5ef;

  --seg-bg: #ece8f5;
  --seg-on: #fff;
  --field: #fff;
  --field-soft: #f6f3fb;
  --tabbar: rgb(255 255 255 / 88%);

  --star-on: #ffa94d;
  --star-off: #ebe6f3;
  --icon-off: #ebe6f3;
  --chili: #ff6a4d;
  --heart: #ff6f9f;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --success: #2f9e6e;

  --cover-1: #8b7cf6;
  --cover-2: #ff8fb1;
  --cover-3: #5fb89a;
  --cover-4: #ff9f68;
  --cover-5: #5b8def;
  --cover-6: #c37be0;

  --shadow: 0 8px 24px rgb(90 70 160 / 9%);
  --shadow-cover: 0 8px 20px rgb(34 29 51 / 18%);

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 12px;

  --font-display: "Outfit", "Inter", -apple-system, system-ui, sans-serif;
  --font-body: "Inter", -apple-system, system-ui, sans-serif;

  --content-max: 560px;
  --tabbar-h: 68px;
}

/* Theme: html[data-theme] is "auto" (follow the device), "light" or "dark".
   The dark palette is written twice: once forced, once for "auto" on a dark device. */

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-1: #16131f;
  --bg-2: #120f19;
  --card: #1f1b2b;
  --ink: #f4f1fb;
  --ink-2: #cdc7dc;
  --muted: #9690ab;
  --line: rgb(255 255 255 / 7%);

  --lav: #a797ff;
  --lav-2: #8b7cf6;
  --lav-soft: rgb(167 151 255 / 16%);
  --glow: rgb(167 151 255 / 28%);

  --tile-1: rgb(255 174 122 / 14%);
  --tile-2: rgb(127 212 184 / 13%);
  --tile-3: rgb(255 143 177 / 14%);

  --seg-bg: #1a1724;
  --seg-on: #2c2640;
  --field: #1f1b2b;
  --field-soft: #191622;
  --tabbar: rgb(34 30 48 / 88%);

  --star-off: #332d45;
  --icon-off: #332d45;
  --danger-soft: rgb(229 72 77 / 14%);

  --shadow: 0 8px 24px rgb(0 0 0 / 35%);
  --shadow-cover: 0 10px 24px rgb(0 0 0 / 45%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-1: #16131f;
    --bg-2: #120f19;
    --card: #1f1b2b;
    --ink: #f4f1fb;
    --ink-2: #cdc7dc;
    --muted: #9690ab;
    --line: rgb(255 255 255 / 7%);

    --lav: #a797ff;
    --lav-2: #8b7cf6;
    --lav-soft: rgb(167 151 255 / 16%);
    --glow: rgb(167 151 255 / 28%);

    --tile-1: rgb(255 174 122 / 14%);
    --tile-2: rgb(127 212 184 / 13%);
    --tile-3: rgb(255 143 177 / 14%);

    --seg-bg: #1a1724;
    --seg-on: #2c2640;
    --field: #1f1b2b;
    --field-soft: #191622;
    --tabbar: rgb(34 30 48 / 88%);

    --star-off: #332d45;
    --icon-off: #332d45;
    --danger-soft: rgb(229 72 77 / 14%);

    --shadow: 0 8px 24px rgb(0 0 0 / 35%);
    --shadow-cover: 0 10px 24px rgb(0 0 0 / 45%);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(90% 40% at 90% 0%, var(--glow), transparent 70%),
    linear-gradient(170deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--lav);
  outline-offset: 2px;
  border-radius: 8px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

p {
  margin: 0;
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Layout */

.app {
  max-width: var(--content-max);
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + 24px)
    20px
    calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 44px);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.page-head--form {
  flex-direction: column;
  gap: 14px;
}

.eyebrow {
  margin-bottom: 2px;
  color: var(--lav);
  font-size: 15px;
  font-weight: 600;
}

.page-title {
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.section {
  margin-top: 26px;
}

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

.section-title {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-head .section-title {
  margin-bottom: 0;
}

.link {
  color: var(--lav);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.muted {
  color: var(--muted);
}

/* Surfaces */

.card {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--peach), var(--pink));
  color: #fff;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.pill--lav {
  border-color: transparent;
  background: var(--lav-soft);
  color: var(--lav);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease, opacity 120ms ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn .icon {
  width: 20px;
  height: 20px;
}

.btn--primary {
  background: linear-gradient(120deg, var(--lav-2), var(--lav));
  color: #fff;
  box-shadow: 0 10px 24px rgb(139 124 246 / 30%);
}

.btn--ghost {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--danger-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--danger);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
}

.btn--sm .icon {
  width: 18px;
  height: 18px;
}

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--lav);
  color: #fff;
  box-shadow: 0 8px 18px rgb(139 124 246 / 32%);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn--soft {
  width: 42px;
  height: 42px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.icon-btn .icon {
  width: 21px;
  height: 21px;
}

/* Forms */

.field {
  display: block;
  margin-top: 18px;
}

.field--first {
  margin-top: 0;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-row .input {
  width: 100%;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

.field-row__hint {
  margin-top: 6px;
}

.field__label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}

.field__optional {
  color: var(--muted);
  font-weight: 500;
}

.field__hint,
.field__error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}

.field__hint {
  color: var(--muted);
}

.field__error {
  color: var(--danger);
  font-weight: 600;
}

fieldset.field {
  margin-inline: 0;
  padding: 0;
  border: 0;
}

fieldset.field legend {
  padding: 0;
}

.input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field-soft);
  color: var(--ink);
  font: inherit;
  font-size: 17px; /* >= 16px so iOS Safari doesn't zoom on focus */
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input::placeholder {
  color: var(--muted);
}

.input:focus {
  border-color: var(--lav);
  box-shadow: 0 0 0 4px var(--lav-soft);
  outline: none;
}

.input.is-invalid {
  border-color: var(--danger);
}

.input--short {
  max-width: 140px;
}

.textarea {
  min-height: 130px;
  padding: 14px 16px;
  line-height: 1.55;
  resize: vertical;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 15px;
  font-weight: 600;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--lav);
}

.form__submit {
  margin-top: 26px;
}

/* Chips */

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

.chips--scroll {
  flex-wrap: nowrap;
  margin: 0 -20px;
  padding: 2px 20px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips--scroll::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 120ms ease, color 120ms ease;
}

.choice {
  position: relative;
  flex: none;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice input:checked + .chip {
  border-color: transparent;
  background: var(--ink);
  color: var(--bg-2);
}

.choice input:focus-visible + .chip {
  outline: 3px solid var(--lav);
  outline-offset: 2px;
}

/* Bottom sheet: a <details> whose panel slides up over a dimmed page */

.sheet > summary {
  list-style: none;
}

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

.sheet__backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgb(22 19 31 / 38%);
  animation: fade-in 160ms ease;
}

.sheet__panel {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 21;
  display: grid;
  gap: 6px;
  width: min(100%, var(--content-max));
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 16px);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--card);
  box-shadow: 0 -10px 30px rgb(34 29 51 / 18%);
  transform: translateX(-50%);
  animation: sheet-up 200ms ease;
}

.sheet__title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.sheet__section {
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.sheet__actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

/* Reading status: current value + bottom sheet (two taps to change) */

.status-menu__current {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 10px 8px 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.status-menu__label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.status-menu__value {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--lav-soft);
  color: var(--lav);
  font-size: 14px;
  font-weight: 700;
}

.status-menu__change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 6px 8px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}

.status-menu__change .icon {
  width: 18px;
  height: 18px;
}

.status-menu__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--field-soft);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.status-menu__option:active {
  background: var(--lav-soft);
}

.status-menu__option.is-current {
  background: var(--lav-soft);
  color: var(--lav);
  cursor: default;
}

.status-menu__option .icon {
  width: 20px;
  height: 20px;
}

.sheet__cancel {
  margin-top: 6px;
}

/* First-run welcome */

.welcome__panel {
  gap: 10px;
  padding-top: 26px;
  text-align: center;
}

.welcome__sun img {
  display: block;
  margin: 0 auto;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.welcome__title {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
}

.welcome__body {
  display: grid;
  gap: 8px;
  color: var(--ink-2);
  line-height: 1.5;
}

.welcome__quote {
  margin: 4px 0 2px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--lav-soft);
}

.welcome__quote blockquote {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  line-height: 1.5;
}

.welcome__quote figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.welcome__quote figcaption::before {
  content: "— ";
}

.welcome__signature {
  color: var(--muted);
  font-style: italic;
}

.welcome .btn {
  margin-top: 8px;
}

@keyframes sheet-up {
  from {
    transform: translate(-50%, 100%);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.status-dates {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

/* Covers */

.cover {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--seg-bg);
  box-shadow: var(--shadow-cover);
}

.cover--sm {
  width: 72px;
  flex: none;
  border-radius: 8px;
}

.cover--row {
  width: 96px;
  flex: none;
}

.cover--lg {
  width: 156px;
  flex: none;
  border-radius: 14px;
}

.cover--placeholder {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 16px 12px 12px;
  color: #fff;
  text-align: left;
  background:
    radial-gradient(120% 70% at 100% 0%, rgb(255 255 255 / 28%), transparent 60%),
    linear-gradient(160deg, var(--cover, var(--cover-1)), color-mix(in srgb, var(--cover, var(--cover-1)) 70%, #221d33));
}

.cover__title {
  display: -webkit-box;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

.cover__author {
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cover--lg.cover--placeholder {
  padding: 22px 16px 16px;
}

.cover--lg .cover__title {
  font-size: 19px;
}

.cover--row.cover--placeholder {
  padding: 12px 9px 9px;
}

.cover--row .cover__title {
  font-size: 13px;
}

.cover--sm.cover--placeholder {
  padding: 10px 7px 7px;
}

.cover--sm .cover__title {
  font-size: 10px;
  -webkit-line-clamp: 4;
}

.cover--sm .cover__author {
  display: none;
}

.cover--empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--field-soft);
  border: 1.5px dashed var(--line);
  box-shadow: none;
}

/* Home */

.now-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.now {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink);
  text-decoration: none;
}

.now__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.now__title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
}

.now__author {
  color: var(--muted);
  font-size: 14px;
}

.now__info .pill {
  margin-top: 8px;
}

.mini-stars {
  display: flex;
  gap: 2px;
  margin-top: 8px;
}

.mini-stars svg {
  width: 15px;
  height: 15px;
}

.cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--lav-2), var(--lav));
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 28px rgb(139 124 246 / 32%);
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease;
}

.cta:active {
  transform: scale(0.98);
}

.cta__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgb(255 255 255 / 22%);
}

.cta strong,
.cta small {
  display: block;
}

.cta strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.cta small {
  font-size: 13px;
  opacity: 0.88;
}

.shelf-row {
  display: flex;
  gap: 12px;
  margin: 0 -20px;
  padding: 4px 20px 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  list-style: none;
}

.shelf-row::-webkit-scrollbar {
  display: none;
}

.shelf-row li {
  scroll-snap-align: start;
}

.shelf-row a {
  display: block;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* Library */

.search {
  position: relative;
  display: block;
}

.search .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search .input {
  padding-left: 44px;
  border-radius: var(--radius);
  background: var(--field);
  box-shadow: var(--shadow);
}

.search .input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.library-filters__row {
  display: flex;
  gap: 10px;
}

.library-filters__row .search {
  flex: 1;
  min-width: 0;
}

.library-filters .chips--scroll {
  margin-top: 14px;
}

.filter-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 100%;
  min-height: 48px;
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.filter-btn .icon {
  width: 21px;
  height: 21px;
}

.filter-btn__count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.filter-btn__count[hidden] {
  display: none;
}

.filter-sheet .chips {
  margin-bottom: 4px;
}

.library-results {
  margin-top: 18px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.book-tile {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.book-tile .cover {
  transition: transform 120ms ease;
}

.book-tile:active .cover {
  transform: scale(0.97);
}

.book-tile__title,
.book-tile__author {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-tile__title {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.book-tile__author {
  color: var(--muted);
  font-size: 12px;
}

.book-tile__rating {
  color: var(--star-on);
  font-size: 12px;
  font-weight: 700;
}

/* Empty states */

.empty {
  padding: 30px 20px;
  text-align: center;
}

.empty__art {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto;
  border-radius: 24px;
  background: var(--lav-soft);
  color: var(--lav);
}

.empty__art .icon {
  width: 34px;
  height: 34px;
}

.empty h3 {
  margin-top: 16px;
  font-size: 19px;
  font-weight: 600;
}

.empty p {
  max-width: 32ch;
  margin: 6px auto 0;
  color: var(--muted);
  font-size: 15px;
}

.empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

/* Book detail */

.book-hero {
  position: relative;
  padding-top: 8px;
  text-align: center;
}

.book-hero::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 50%;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 174 122 / 45%), var(--glow) 55%, transparent 72%);
  transform: translateX(-50%);
  pointer-events: none;
}

.book-hero > * {
  position: relative;
}

.book-hero__bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.book-hero .cover--lg {
  margin: 0 auto 20px;
  transform: rotate(-2deg);
  box-shadow: 0 20px 40px rgb(34 29 51 / 28%);
}

.book-hero__title {
  font-size: 27px;
  overflow-wrap: anywhere;
}

.book-hero__subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
}

.book-hero__authors {
  margin-top: 4px;
  color: var(--lav);
  font-weight: 600;
}

.book-hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.status-picker {
  margin-top: 22px;
}

/* Reading progress */

.progress {
  margin-top: 14px;
  padding: 16px;
}

.progress__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.progress__label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.progress__percent {
  color: var(--lav);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.progress-bar {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--seg-bg);
}

.progress-bar__fill {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lav), var(--pink), var(--peach));
  transition: width 400ms ease;
}

.progress-bar--thin {
  height: 6px;
}

.progress__pages {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.progress__row {
  display: flex;
  gap: 10px;
}

.progress__input {
  flex: 1;
  min-width: 0;
}

.progress__row .btn {
  flex: none;
}

.progress__saved {
  margin-top: 8px;
}

.progress__hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.progress__done {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--lav-soft);
  font-weight: 600;
}

.progress__done p {
  margin: 0;
}

.now__progress {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.now__progress .progress-bar {
  flex: none;
  width: 120px;
}

.now__percent {
  color: var(--lav);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.book-tile__progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--lav);
  font-size: 12px;
  font-weight: 700;
}

.book-tile__progress .progress-bar {
  flex: 1;
}

/* Ratings */

.ratings {
  margin-top: 14px;
  padding: 14px 16px;
}

.rating {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}

.rating + .rating {
  border-top: 1px solid var(--line);
}

.rating__label {
  font-size: 15px;
  font-weight: 600;
}

.rating__value {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.rating__icons {
  display: flex;
  gap: 2px;
}

.rating__star {
  position: relative;
  width: 34px;
  height: 34px;
}

.rating__glyph {
  display: block;
  width: 30px;
  height: 30px;
  margin: 2px;
  fill: var(--star-off);
}

.rating__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill);
  overflow: hidden;
  pointer-events: none;
}

.rating__fill .rating__glyph {
  fill: var(--star-on);
}

.rating__hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rating__hit--half {
  left: 0;
}

.rating__hit--full {
  right: 0;
}

.rating__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--icon-off);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease;
}

.rating__icon:active {
  transform: scale(0.86);
}

.rating__icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.rating__icon svg .stem {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.rating--spicy .rating__icon.is-on {
  color: var(--chili);
}

.rating--romance .rating__icon.is-on {
  color: var(--heart);
}

.htmx-request.rating,
.htmx-request.status-picker,
.htmx-request.notes {
  opacity: 0.6;
  transition: opacity 200ms ease 150ms;
}

/* Notes */

.book-tags {
  margin-top: 14px;
}

.book-tags__current {
  display: grid;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.book-tags__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.book-tags__head .status-menu__change {
  margin-right: -8px;
}

.book-tags__label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.book-tags__empty {
  color: var(--muted);
  font-size: 14px;
}

.book-tags__saved {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.book-tags .sheet__panel .input {
  margin-top: 8px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--field-soft);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.tag--genre {
  background: var(--lav-soft);
  color: var(--lav);
}

.notes {
  margin-top: 14px;
}

.notes__label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.notes .textarea {
  border-color: transparent;
}

.notes__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.saved {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--success);
  font-size: 14px;
  font-weight: 600;
}

.saved .icon {
  width: 18px;
  height: 18px;
}

/* Delete confirmation */

.confirm {
  margin-top: 22px;
  text-align: center;
}

.confirm summary {
  list-style: none;
}

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

.confirm[open] summary {
  display: none;
}

.confirm__body {
  text-align: left;
}

.confirm__body p {
  margin-bottom: 16px;
  color: var(--ink-2);
}

.confirm__actions {
  display: grid;
  gap: 8px;
}

/* Cover picker */

.cover-picker {
  display: flex;
  gap: 16px;
  align-items: center;
}

.cover-picker__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.cover-picker__actions .field__hint {
  margin-top: 0;
}

/* Scan */

.viewfinder {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 40%, #3a3350, #17141f);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.viewfinder__video {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 250ms ease;
}

.viewfinder[data-state="live"] .viewfinder__video,
.viewfinder[data-state="found"] .viewfinder__video {
  opacity: 1;
}

.viewfinder__frame {
  position: relative;
  width: 72%;
  height: 46%;
  transition: transform 200ms ease;
}

.viewfinder__barcode {
  position: absolute;
  inset: 22% 14%;
  background: repeating-linear-gradient(
    90deg,
    rgb(255 255 255 / 22%) 0 3px,
    transparent 3px 6px,
    rgb(255 255 255 / 22%) 6px 7px,
    transparent 7px 11px
  );
  border-radius: 4px;
}

.viewfinder[data-state="live"] .viewfinder__barcode,
.viewfinder[data-state="found"] .viewfinder__barcode {
  display: none;
}

.viewfinder[data-state="found"] .viewfinder__frame {
  transform: scale(0.96);
}

.viewfinder[data-state="found"] .corner {
  border-color: #7ee2b0;
}

.viewfinder[data-state="found"] .viewfinder__line,
.viewfinder[data-state="error"] .viewfinder__line {
  display: none;
}

.viewfinder__status {
  position: absolute;
  bottom: 12px;
  left: 50%;
  max-width: calc(100% - 24px);
  padding: 6px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  background: rgb(22 19 31 / 62%);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.viewfinder__status:empty {
  display: none;
}

.scanner__start {
  margin-top: 12px;
}

.manual-isbn__row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.manual-isbn__row .input {
  flex: 1;
  min-width: 0;
  letter-spacing: 0.04em;
}

.scan-result:empty {
  display: none;
}

.scan-found {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.scan-found__cover {
  width: 96px;
}

.scan-found__eyebrow {
  color: var(--lav);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scan-found__title {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.scan-found__subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.scan-found__authors {
  margin-top: 6px;
  color: var(--lav);
  font-weight: 600;
}

.scan-found__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.scan-confirm .field:first-child {
  margin-top: 18px;
}

.scan-confirm__actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.scan-confirm__secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.scan-photo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
  background: color-mix(in srgb, var(--peach) 22%, var(--card));
}

.notice + .card,
.notice + .notice {
  margin-top: 12px;
}

.notice__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--peach), var(--pink));
}

.notice__icon svg {
  width: 18px;
  height: 18px;
}

.notice a {
  color: inherit;
  font-weight: 700;
}

.book-added {
  margin-top: 18px;
}

.notice--success {
  background: color-mix(in srgb, #7ee2b0 26%, var(--card));
}

.notice--success .notice__icon {
  background: linear-gradient(135deg, #58c98f, #7ee2b0);
}

/* Wishlist */

.btn--wish {
  background: color-mix(in srgb, var(--pink) 16%, var(--card));
  border: 1px solid color-mix(in srgb, var(--pink) 40%, transparent);
  color: color-mix(in srgb, var(--pink) 70%, var(--ink));
}

.pill--wish {
  gap: 5px;
  border-color: transparent;
  background: color-mix(in srgb, var(--pink) 18%, var(--card));
  color: color-mix(in srgb, var(--pink) 70%, var(--ink));
}

.pill--wish .icon {
  width: 13px;
  height: 13px;
}

.scan-confirm__actions .btn--wish {
  margin-top: 10px;
}

.wish-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.wish-actions__since {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.wish-actions__hint {
  margin-top: 0;
  text-align: center;
}

.wish-search__results {
  margin-top: 16px;
}

.wish-search__results > .wish-search__loading {
  display: none;
}

.wish-search__results.htmx-request > .wish-search__loading {
  display: flex;
}

.wish-search__results.htmx-request > :not(.wish-search__loading) {
  display: none;
}

.wish-search__note {
  margin-top: 10px;
  text-align: center;
}

.wish-results {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wish-result {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px;
}

.wish-result__cover {
  flex: none;
  width: 64px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
}

.wish-result__info {
  display: grid;
  gap: 3px;
  min-width: 0;
  justify-items: start;
}

.wish-result__title {
  font-weight: 700;
  line-height: 1.3;
}

.wish-result__authors {
  color: var(--ink-2);
  font-size: 14px;
}

.wish-result__detail {
  color: var(--muted);
  font-size: 12px;
}

.wish-result form,
.wish-result__owned {
  margin-top: 6px;
}

.wish-result__owned {
  text-decoration: none;
}

.wish-options {
  display: grid;
  gap: 10px;
}

.wish-option {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.wish-option strong,
.wish-option small {
  display: block;
}

.wish-option strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.wish-option small {
  color: var(--muted);
  font-size: 13px;
}

.wish-option__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--lav-soft);
  color: var(--lav);
}

.scan-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 600;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid color-mix(in srgb, var(--lav) 25%, transparent);
  border-top-color: var(--lav);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 0 solid var(--peach);
  transition: border-color 200ms ease;
}

.corner--tl { top: 0; left: 0; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 12px; }
.corner--tr { top: 0; right: 0; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 12px; }
.corner--bl { bottom: 0; left: 0; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 12px; }
.corner--br { bottom: 0; right: 0; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 12px; }

.viewfinder__line {
  position: absolute;
  top: 50%;
  left: 6%;
  right: 6%;
  height: 2px;
  border-radius: 2px;
  background: var(--peach);
  box-shadow: 0 0 14px var(--peach);
  animation: scan-line 2.4s ease-in-out infinite;
}

@keyframes scan-line {
  0%, 100% { transform: translateY(-38px); }
  50% { transform: translateY(38px); }
}

.manual-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.manual-card h3 {
  font-size: 17px;
  font-weight: 600;
}

.manual-card p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

/* Stats */

.stats-years {
  margin-bottom: 14px;
}

.stats-years .chip {
  color: var(--ink-2);
  text-decoration: none;
}

.stats-years .chip.is-on {
  border-color: transparent;
  background: var(--ink);
  color: var(--bg-2);
}

.stats-years + .notice,
.page-head + .notice {
  margin-bottom: 14px;
}

.goal-sheet > summary {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.goal {
  display: grid;
  gap: 8px;
}

.goal--empty {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
}

.goal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.goal__label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.goal__edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}

.goal__edit .icon {
  width: 16px;
  height: 16px;
}

.goal__count {
  color: var(--muted);
  font-size: 15px;
}

.goal__count strong {
  margin-right: 2px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
}

.goal__hint {
  color: var(--muted);
  font-size: 13px;
}

.goal__month {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.goal__month-label {
  color: var(--ink-2);
  font-weight: 600;
}

.goal__month-count {
  color: var(--muted);
  font-weight: 700;
}

.goal__icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--lav), var(--pink));
  color: #fff;
}

.goal__icon .icon {
  width: 22px;
  height: 22px;
}

.goal__empty-text {
  display: grid;
  gap: 2px;
}

.goal__empty-text small {
  color: var(--muted);
  font-size: 13px;
}

.goal-sheet .field {
  margin-top: 8px;
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.stat-tile {
  display: grid;
  gap: 4px;
  padding: 14px 12px;
}

.stat-tile__value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.stat-tile__value small {
  margin-left: 2px;
  color: var(--star-on);
  font-size: 18px;
}

.stat-tile__label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.months__bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.months__item {
  display: grid;
  grid-template-rows: 18px 110px auto;
  justify-items: center;
  gap: 4px;
}

.months__count {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}

.months__track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 22px;
  height: 100%;
  border-radius: 7px;
  background: var(--field-soft);
}

.months__bar {
  display: block;
  width: 100%;
  min-height: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, var(--lav-2), var(--lav));
}

.months__item.met-goal .months__bar {
  background: linear-gradient(180deg, var(--peach), var(--pink));
}

.months__label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.months__item.is-current .months__label {
  color: var(--lav);
  font-weight: 800;
}

.months__legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.months__dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--peach), var(--pink));
}

.ranking {
  display: grid;
  gap: 12px;
  margin: 0;
  list-style: none;
}

.ranking__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
}

.ranking__name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking__count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.ranking__track {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--field-soft);
}

.ranking__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lav), var(--pink));
}

.stats-empty {
  margin-top: 14px;
}

/* Lists (More) */

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.list li + li {
  border-top: 1px solid var(--line);
}

.list__item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 16px;
  color: var(--ink);
  text-decoration: none;
}

.list__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--lav-soft);
  color: var(--lav);
}

.list__icon .icon {
  width: 19px;
  height: 19px;
}

.list__label {
  flex: 1;
  font-weight: 600;
}

.list__item.is-disabled .list__label {
  color: var(--ink-2);
}

.list__chevron {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

a.list__item:active {
  background: var(--field-soft);
}

.settings-card + .settings-card {
  margin-top: 14px;
}

.settings-card__title {
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 600;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.theme-picker .chip {
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 0 8px;
}

.theme-picker .icon {
  width: 17px;
  height: 17px;
}

.theme-picker + .field__hint {
  margin-top: 10px;
}

/* Login */

body.is-public .app {
  padding-bottom: calc(env(safe-area-inset-bottom) + 32px);
}

.login {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100dvh - 64px);
  max-width: 420px;
  margin: 0 auto;
}

.login__brand {
  margin-bottom: 28px;
  text-align: center;
}

.login__sun {
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 16px;
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(135deg, var(--peach), var(--pink));
  box-shadow: 0 14px 30px rgb(255 143 177 / 40%);
}

.login__sun .icon {
  width: 38px;
  height: 38px;
}

.login__brand h1 {
  font-size: 34px;
  letter-spacing: -0.03em;
}

.login__brand p {
  margin-top: 4px;
  color: var(--muted);
}

.login__card {
  padding: 24px;
}

.login__card h2 {
  margin-bottom: 18px;
  font-size: 22px;
  font-weight: 600;
}

/* Floating tab bar */

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 24px);
  z-index: 30;
  max-width: calc(var(--content-max) - 32px);
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg-1);
  font-size: 14px;
  line-height: 1.4;
  box-shadow: var(--shadow);
  animation: fade-in 160ms ease;
}

.toast[hidden] {
  display: none;
}

body.is-public .toast {
  bottom: calc(env(safe-area-inset-bottom) + 16px);
}

.tabbar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  max-width: calc(var(--content-max) - 32px);
  height: var(--tabbar-h);
  margin: 0 auto;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--tabbar);
  backdrop-filter: saturate(1.4) blur(20px);
  -webkit-backdrop-filter: saturate(1.4) blur(20px);
  box-shadow: 0 12px 30px rgb(90 70 160 / 14%);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.tab .icon {
  width: 22px;
  height: 22px;
}

.tab.is-active {
  color: var(--lav);
}

.tab--scan .tab__label {
  display: none;
}

.tab__scan-btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--peach), var(--pink));
  box-shadow: 0 8px 18px rgb(255 143 177 / 40%);
  transition: transform 120ms ease;
}

.tab--scan:active .tab__scan-btn {
  transform: scale(0.94);
}

@media (prefers-reduced-motion: reduce) {
  .viewfinder__line,
  .spinner {
    animation: none;
  }

  .btn,
  .cta,
  .tab__scan-btn,
  .rating__icon,
  .book-tile .cover {
    transition: none;
  }
}
