.cover-wrap { position: relative; }
.book-cover {
  width: 100%;
  aspect-ratio: 0.63;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 16px 28px rgba(47, 4, 17, 0.20);
}

.save-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.88);
  border-radius: 50%;
  background: rgba(39, 8, 15, 0.82);
  color: white;
  cursor: pointer;
  font-size: 24px;
  backdrop-filter: blur(6px);
}
.save-button[aria-pressed="true"] { background: var(--wine-700); }

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 5px 13px;
  background: var(--rose-100);
  color: #5f2534;
  font-family: var(--serif);
  font-size: 13px;
}
button.chip { cursor: pointer; }
button.chip:hover { background: #f6d1d4; }
.chip-disputed {
  border: 1px dashed rgba(103, 16, 39, 0.34);
  background: #fff9f6;
}

.vibe-badge {
  border: 1px solid var(--rose-200);
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--rose-050);
  color: var(--wine-700);
  font-family: var(--serif);
  font-size: 12px;
  white-space: nowrap;
}

.meter-list { display: grid; gap: 18px; }
.meter-row {
  display: grid;
  grid-template-columns:
    minmax(108px, 130px)
    minmax(72px, 98px)
    minmax(120px, 1fr)
    minmax(82px, 122px);
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
}
.meter-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 16px;
}
.meter-name span { color: var(--rose-500); font-size: 20px; }
.meter-edge { color: #6e5a5e; font-family: var(--serif); font-size: 12px; white-space: nowrap; }
.meter-edge:last-child { text-align: left; }
.meter {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f8d7d7 0%, #ebadb8 45%, #c74a64 100%);
}
.spice-meter { background: linear-gradient(90deg, #f8d7d7 0%, #f39aa1 45%, #cc3a54 68%, #72091f 100%); }
.meter-range {
  position: absolute;
  inset: -4px auto -4px var(--range-start);
  width: calc(var(--range-end) - var(--range-start));
  border-radius: 999px;
  background: rgba(123, 8, 36, 0.11);
}
.meter-marker {
  position: absolute;
  top: 50%;
  left: var(--marker);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--wine-700);
  box-shadow: 0 0 0 3px rgba(134, 26, 54, 0.09);
  transform: translate(-50%, -50%);
}

.review-score { margin-left: auto; color: var(--ink); font-family: var(--serif); font-size: 26px; font-weight: 500; }
.review-score span { color: var(--muted); font-size: 14px; }

.helpful-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--wine-700);
  cursor: pointer;
  font-family: var(--serif);
}
.helpful-button[aria-pressed="true"] { font-weight: 700; }

.receipt-note {
  position: relative;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 16px -2px 10px;
  padding: 13px 16px;
  background:
    linear-gradient(135deg, transparent 8px, #fff8f4 0) top left,
    linear-gradient(225deg, transparent 8px, #fff8f4 0) top right,
    linear-gradient(315deg, transparent 8px, #fff8f4 0) bottom right,
    linear-gradient(45deg, transparent 8px, #fff8f4 0) bottom left;
  background-size: 51% 51%;
  background-repeat: no-repeat;
  box-shadow: 0 10px 18px rgba(75, 0, 20, 0.11);
}
.receipt-note .text-link {
  grid-column: 2;
  justify-self: start;
  white-space: normal;
}
@container (min-width: 520px) {
  .receipt-note { grid-template-columns: auto minmax(0, 1fr) auto; }
  .receipt-note .text-link { grid-column: 3; justify-self: end; white-space: nowrap; }
}
.receipt-note p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.receipt-seal {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #7d1731, #4d0719);
  color: #e9c48d;
  font-family: var(--serif);
  font-weight: 700;
}
.receipt-seal-large { width: 58px; height: 58px; font-size: 18px; }

.receipt-modal-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.receipt-modal-heading h2 { margin: 4px 0 0; }
.receipt-modal-card blockquote {
  margin: 0 0 18px;
  border-left: 3px solid var(--rose-300);
  padding: 12px 18px;
  background: var(--rose-050);
  font-family: var(--serif);
  font-size: 18px;
}
.spoiler-button { width: auto; padding-inline: 18px; }
.spoiler-detail { margin-top: 14px; border-radius: 10px; padding: 16px; background: #f7eeea; }
.spoiler-detail p { margin: 5px 0 0; }

.review-start-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.review-start-options button { width: 100%; }

.burn-meter {
  background: linear-gradient(90deg, #dbe7f3 0%, #ead6df 42%, #dc8295 70%, #861a36 100%);
}

.account-dialog {
  width: min(92vw, 560px);
  max-height: min(88vh, 760px);
  border: 0;
  border-radius: 22px;
  padding: 0;
  background: transparent;
  box-shadow: 0 28px 90px rgba(55, 7, 22, 0.28);
}

.account-dialog::backdrop { background: rgba(37, 6, 18, 0.54); backdrop-filter: blur(4px); }

.account-shell {
  position: relative;
  overflow: auto;
  max-height: min(88vh, 760px);
  border: 1px solid rgba(134, 26, 54, 0.12);
  border-radius: 22px;
  padding: clamp(28px, 5vw, 44px);
  background: var(--paper);
}

.account-shell h2 { margin: 4px 42px 24px 0; font-size: clamp(27px, 5vw, 38px); }

.account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
  border-radius: 999px;
  padding: 5px;
  background: #f4e8e5;
}

.account-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 700;
}

.account-tabs button.is-active { background: white; color: var(--wine-800); box-shadow: 0 3px 12px rgba(73, 12, 30, 0.09); }

.account-form { display: grid; gap: 17px; }
.account-form label { display: grid; gap: 7px; color: var(--wine-800); font-family: var(--serif); font-size: 13px; font-weight: 700; }
.account-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(98, 40, 55, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}
.account-form input:focus { outline: 2px solid rgba(134, 26, 54, 0.16); border-color: var(--wine-700); }
.account-form .primary-action { justify-self: start; min-width: 150px; }
.form-note { margin: -8px 0 0; color: var(--muted); font-size: 12px; }

.account-error,
.account-setup {
  margin-bottom: 20px;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--serif);
}
.account-error { border: 1px solid #d97883; background: #fff0ef; color: #7f1730; }
.account-setup { border: 1px dashed rgba(134, 26, 54, 0.3); background: #fff8f4; }
.account-setup p { margin: 0 0 8px; }
.account-setup p:last-child { margin-bottom: 0; color: var(--muted); }

.account-user { display: grid; gap: 24px; }
.account-user-card { display: flex; align-items: center; gap: 14px; border-radius: 14px; padding: 18px; background: #fff8f4; }
.account-user-card strong { display: block; font-family: var(--serif); font-size: 18px; }
.account-user-card p { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.account-user .secondary-action { justify-self: start; }

@media (max-width: 520px) {
  .account-dialog { width: calc(100vw - 20px); }
  .account-shell { padding: 27px 20px; }
  .account-shell h2 { margin-right: 34px; }
}
