body {
  margin: 0;
  font-family: Georgia, serif;
  background-color: #1e3d34;
  color: #000;
}

* {
  box-sizing: border-box;
}

.app-shell {
  width: 95%;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  text-align: center;
  margin-bottom: 20px;
}

.logo {
  width: 120px;
  max-width: 100%;
  height: auto;
  display: block;
}

.app-title-wrap h1 {
  font-size: 28px;
  margin: 0;
  color: #fff;
}

.tagline {
  color: #d4cfc4;
  margin-top: 5px;
  margin-bottom: 0;
}

.status-message {
  display: none;
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
}

.auth-panel,
.panel {
  background: #d9d4c7;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 10px;
}

.auth-panel h2,
.panel h2 {
  margin-top: 0;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-add-row,
.controls-row,
.button-row,
.welcome-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.manual-form {
  display: grid;
  gap: 10px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-help {
  font-size: 12px;
  color: #555;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 0;
  border-radius: 6px;
  border: 1px solid #aaa;
  font-size: 14px;
  font-family: inherit;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

select[multiple] {
  min-height: 120px;
}

.hidden {
  display: none !important;
}

button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background-color: #2f5c4f;
  color: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

button:hover {
  background-color: #3c7463;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.primary-button {
  background-color: #2f5c4f;
}

.secondary-button {
  background-color: #6b7280;
}

.danger-button {
  background-color: #8b2c2c;
}

.highlight-button {
  background-color: #a06a2c;
}

.small-button {
  padding: 7px 10px;
  font-size: 13px;
}

.welcome-message {
  font-size: 14px;
  font-weight: bold;
}

.google-results {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.google-result-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  background: #f3f0e7;
  color: #000;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid #c9c2b4;
}

.google-result-card:hover {
  background: #ece7db;
}

.google-result-cover {
  width: 70px;
  min-width: 70px;
  height: 100px;
  border-radius: 6px;
  background: #ddd6c8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 12px;
  color: #555;
  text-align: center;
}

.google-result-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.google-result-meta {
  flex: 1;
  min-width: 0;
}

.google-result-title {
  font-weight: bold;
  margin-bottom: 4px;
}

.google-result-author,
.google-result-category {
  font-size: 12px;
  color: #444;
  line-height: 1.4;
}

.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.book-card {
  background: #f3f0e7;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: #ddd6c8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 12px;
  color: #555;
  text-align: center;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.book-title {
  font-weight: bold;
  font-size: 18px;
  line-height: 1.3;
}

.book-meta {
  font-size: 13px;
  line-height: 1.5;
}

.book-tropes-display {
  margin-top: 4px;
}

.book-rating-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.book-rating-label {
  font-size: 13px;
  font-weight: bold;
}

.star-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.star-button {
  background: transparent;
  color: #8b5a00;
  border: 1px solid #c9b37a;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 18px;
  line-height: 1;
}

.star-button:hover {
  background: #f3e8c7;
}

.book-edit-grid {
  display: grid;
  gap: 10px;
}

.book-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.book-hearts-label {
  font-size: 13px;
  font-weight: bold;
}

.book-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.heart-count {
  background-color: #8b2c2c;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: #f3f0e7;
  color: #000;
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  max-width: 380px;
}

.modal-box h3 {
  margin-top: 0;
}

@media (max-width: 700px) {
  .auth-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .quick-add-row,
  .controls-row,
  .button-row,
  .welcome-row {
    flex-direction: column;
    align-items: stretch;
  }

  .app-shell {
    padding: 14px;
  }

  .logo {
    width: 95px;
  }

  .app-title-wrap h1 {
    font-size: 24px;
  }
}