body[data-page="profile"] .profile-reviews-hero-card {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

body[data-page="profile"] .profile-review-composer-shell {
  min-width: 0;
  order: -1;
}

body[data-page="profile"] .profile-reviews-hero-copy {
  min-width: 0;
}

body[data-page="profile"] .profile-review-compose-form {
  display: grid;
  gap: 12px;
  height: 100%;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border-color) 80%);
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg-card) 88%, var(--bg-elevated) 12%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent),
    0 18px 42px rgba(0, 0, 0, 0.18);
}

body[data-page="profile"] .profile-review-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

body[data-page="profile"] .profile-review-field label,
body[data-page="profile"] .profile-review-field > span,
body[data-page="profile"] .profile-review-tag-fieldset legend {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-page="profile"] .profile-review-book-native,
body[data-page="profile"] .profile-review-input,
body[data-page="profile"] .profile-review-textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--surface-input, color-mix(in srgb, var(--bg-elevated) 78%, var(--bg-card) 22%));
  color: var(--text-primary);
  font: inherit;
  font-size: 0.92rem;
  box-shadow: none;
}

body[data-page="profile"] .profile-review-book-native,
body[data-page="profile"] .profile-review-input {
  min-height: 40px;
  padding: 0 12px;
}

body[data-page="profile"] .profile-review-textarea {
  min-height: 118px;
  max-height: 140px;
  padding: 12px;
  line-height: 1.5;
  resize: vertical;
}

body[data-page="profile"] .profile-review-book-native:focus,
body[data-page="profile"] .profile-review-input:focus,
body[data-page="profile"] .profile-review-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

body[data-page="profile"] .profile-review-book-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px 9px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-elevated) 76%, transparent);
}

body[data-page="profile"] .profile-review-book-row.is-empty {
  border-style: dashed;
  color: var(--text-muted);
}

body[data-page="profile"] .profile-review-book-cover-mini {
  display: grid;
  place-items: center;
  width: 38px;
  height: 46px;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--bg-soft), var(--bg-elevated));
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
}

body[data-page="profile"] .profile-review-book-cover-mini img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

body[data-page="profile"] .profile-review-book-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body[data-page="profile"] .profile-review-book-copy strong,
body[data-page="profile"] .profile-review-book-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="profile"] .profile-review-book-copy strong {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 800;
}

body[data-page="profile"] .profile-review-book-copy small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

body[data-page="profile"] .profile-review-book-clear {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

body[data-page="profile"] .profile-review-book-clear:hover,
body[data-page="profile"] .profile-review-book-clear:focus-visible {
  outline: none;
  color: var(--text-primary);
  border-color: var(--accent);
}

body[data-page="profile"] .profile-review-no-library-state {
  padding: 14px;
  border: 1px dashed var(--border-color);
  border-radius: 16px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-elevated) 68%, transparent);
  font-size: 0.9rem;
  line-height: 1.45;
}

body[data-page="profile"] .profile-review-form-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.76fr) minmax(0, 1fr);
  gap: 12px;
}

body[data-page="profile"] .profile-review-rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

body[data-page="profile"] .profile-review-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
}

body[data-page="profile"] .profile-review-star {
  width: 22px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--text-muted) 62%, transparent);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: color 120ms ease, transform 120ms ease;
}

body[data-page="profile"] .profile-review-star:hover,
body[data-page="profile"] .profile-review-star:focus-visible,
body[data-page="profile"] .profile-review-star.is-active {
  outline: none;
  color: var(--accent);
}

body[data-page="profile"] .profile-review-star:hover,
body[data-page="profile"] .profile-review-star:focus-visible {
  transform: translateY(-1px);
}

body[data-page="profile"] .profile-review-rating-value,
body[data-page="profile"] .profile-review-counter,
body[data-page="profile"] .profile-review-form-status {
  color: var(--text-muted);
  font-size: 0.78rem;
}

body[data-page="profile"] .profile-review-field-text {
  position: relative;
}

body[data-page="profile"] .profile-review-counter {
  justify-self: end;
  margin-top: -2px;
}

body[data-page="profile"] .profile-review-tags-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body[data-page="profile"] .profile-review-tag-fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

body[data-page="profile"] .profile-review-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

body[data-page="profile"] .profile-review-tag-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

body[data-page="profile"] .profile-review-tag-chip span,
body[data-page="profile"] .profile-review-tag-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
}

body[data-page="profile"] .profile-review-tag-chip span {
  cursor: pointer;
}

body[data-page="profile"] .profile-review-tag-chip input:checked + span {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border-color) 42%);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--text-primary);
}

body[data-page="profile"] .profile-review-tag-chip input:focus-visible + span {
  outline: 2px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 2px;
}

body[data-page="profile"] .profile-review-tag-add {
  width: 30px;
  padding: 0;
  border-style: dashed;
  opacity: 0.62;
  cursor: not-allowed;
}

body[data-page="profile"] .profile-review-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

body[data-page="profile"] .profile-review-draft-button,
body[data-page="profile"] .profile-review-publish-button {
  min-height: 40px;
  border-radius: 14px;
  font-size: 0.88rem;
  white-space: nowrap;
}

body[data-page="profile"] .profile-review-publish-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body[data-page="profile"] .profile-review-publish-button:not(:disabled) {
  color: #1b1207 !important;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong)) !important;
  box-shadow:
    0 12px 26px color-mix(in srgb, var(--accent) 24%, transparent),
    0 0 28px color-mix(in srgb, var(--accent) 18%, transparent) !important;
}

body[data-page="profile"] .profile-review-publish-button:disabled,
body[data-page="profile"] .profile-review-draft-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none !important;
}

body[data-page="profile"] .profile-review-form-status {
  min-height: 1.1em;
  margin: -2px 0 0;
  line-height: 1.4;
}

body[data-page="profile"] .profile-review-detail header,
body[data-page="profile"] .profile-review-detail footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body[data-page="profile"] .profile-review-detail-book {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
}

body[data-page="profile"] .profile-review-detail-book img {
  width: 46px;
  height: 64px;
  object-fit: cover;
  border-radius: 7px;
}

body[data-page="profile"] .profile-review-detail-book span,
body[data-page="profile"] .profile-review-detail-book small {
  display: block;
}

body[data-page="profile"] .profile-review-detail-book small {
  margin-top: 4px;
  color: var(--text-muted);
}

body[data-page="profile"] .profile-review-detail-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

@media (max-width: 1100px) {
  body[data-page="profile"] .profile-reviews-hero-card {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="profile"] .profile-review-composer-shell,
  body[data-page="profile"] .profile-reviews-hero-copy {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  body[data-page="profile"] .profile-review-compose-form {
    padding: 14px;
    border-radius: 18px;
  }

  body[data-page="profile"] .profile-review-form-grid,
  body[data-page="profile"] .profile-review-tags-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="profile"] .profile-review-form-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  body[data-page="profile"] .profile-review-draft-button,
  body[data-page="profile"] .profile-review-publish-button {
    width: 100%;
  }
}
