:root {
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1f1f1f;
  background: #f8f5f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f8f5f0;
}

.mobile-shell {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fefefe;
  box-shadow: 0 12px 35px rgba(69, 52, 35, 0.12);
}

.page-container {
  flex: 1;
  width: 100%;
  padding: 1.5rem 1.5rem 8rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.page-heading {
  text-align: center;
}

.page-heading h1 {
  margin: 0;
  font-size: 2.4rem;
  letter-spacing: 0.03em;
  color: #413122;
}

.add-books-page {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-height: 100%;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: sticky;
  top: 0.25rem;
  background: #fefefe;
  padding-bottom: 1rem;
  z-index: 2;
}

.search-field {
  display: flex;
  align-items: center;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  padding: 0.6rem 0.75rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.search-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
}

.search-field button {
  border: none;
  background: transparent;
  color: #f2994a;
  font-size: 1.2rem;
}

.primary-btn {
  border: none;
  border-radius: 18px;
  padding: 0.9rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #f2994a, #f46b45);
  cursor: pointer;
}

.ghost-copy {
  text-align: center;
  color: rgba(0, 0, 0, 0.15);
  font-size: 1.8rem;
  letter-spacing: 0.1em;
}

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

.status-text.loading {
  color: #555;
}

.status-text.error {
  color: #c0392b;
}

.status-text.info {
  color: #857c72;
}

.book-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
}

.book-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: flex-start;
  background: #fff;
  padding: 1rem;
  border-radius: 22px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
  border: none;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.book-card::after {
  content: '';
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f2994a, #f46b45);
  opacity: 0.5;
  display: block;
  margin-top: 0.2rem;
}

.book-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(242, 153, 74, 0.35);
}

.book-thumb {
  width: 72px;
  height: 108px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.18);
  align-self: center;
}

.book-info h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #1f1f1f;
}

.book-info {
  width: 100%;
}

.book-meta {
  margin: 0.2rem 0;
  color: #8b8175;
  font-size: 0.9rem;
}

.mybooks-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mybooks-detail {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.back-btn {
  border: none;
  background: transparent;
  color: #4f3823;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-hero {
  border-radius: 28px;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
  background: linear-gradient(135deg, #f0eade, #f9f4ec);
}

.detail-hero-glow {
  width: 100%;
  display: flex;
  justify-content: center;
}

.detail-hero-img {
  width: 130px;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.placeholder-thumb {
  width: 110px;
  height: 150px;
  border-radius: 16px;
  border: 1px dashed rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.5);
  font-weight: 600;
}

.detail-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.book-description {
  color: #5c5046;
  line-height: 1.6;
}

.secondary-btn {
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 14px;
  padding: 0.85rem;
  background: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(420px, 100%);
  background: #ffffff;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.12);
  padding: 0.65rem 1rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 20;
}

.nav-item {
  border: none;
  background: transparent;
  color: #a6a6a6;
  font-weight: 600;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0;
  text-decoration: none;
}

.nav-item svg {
  font-size: 1.1rem;
}

.nav-item.active {
  color: #f2994a;
}

.scanner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 50;
}

.scanner-fullscreen {
  position: relative;
  width: 100%;
  height: 100%;
}

.scanner-fullscreen canvas,
.scanner-fullscreen video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.scanner-overlay-line {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #4ade80, transparent);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.8);
}

.scanner-overlay-info {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: 16px;
  text-align: center;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.scanner-overlay-info button {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
}

.save-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 16px;
  font-weight: 600;
  z-index: 70;
}

@media (max-width: 480px) {
  .mobile-shell {
    max-width: 100%;
    box-shadow: none;
  }

  .page-container {
    padding: 1rem 1rem 8rem;
  }
}
