/* ================================
   COMPONENTS.CSS
   — UI Components & details
   ================================ */

/* ============ ROW LIST ITEMS ============ */

.row {
  display: flex;
  align-items: center;
  width: 100%;
  height: calc(100vh / 7);
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: var(--space-xxs);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.row:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.row:active {
  transform: translateY(0);
}

.upBtn {
  width: calc(100vh / 7 - 10px);
  height: calc(100vh / 7 - 10px);
  margin-right: var(--space-sm);
  background-size: contain;
  background-repeat: no-repeat;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.upBtn.red {
  background-image: url("../img/upredoff.png");
}

.upBtn.red:hover {
  background-image: url("../img/upredon.png");
  transform: scale(1.1);
  filter: brightness(1.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  background-color: rgba(255, 255, 255, 0.2);
}

.upBtn.blue {
  background-image: url("../img/upblueoff.png");
}

.upBtn.blue:hover {
  background-image: url("../img/upblueon.png");
  transform: scale(1.1);
  filter: brightness(1.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  background-color: rgba(255, 255, 255, 0.2);
}

.upBtn.green {
  background-image: url("../img/upgreenoff.png");
}

.upBtn.green:hover {
  background-image: url("../img/upgreenon.png");
  transform: scale(1.1);
  filter: brightness(1.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  background-color: rgba(255, 255, 255, 0.2);
}

.upBtn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Ensure overlay container dimensions equal image dimensions exactly */
.row .pic-wrap {
  position: relative;
  display: inline-block;
  margin-right: var(--space-sm); /* move spacing from img to wrapper */
  line-height: 0; /* remove baseline gap that can shift overlay a couple pixels */
}

/* Avoid adding spacing inside overlay container */
.row .pic {
  margin-right: 0 !important;
}

.pic {
  width: calc(100vh / 7);
  height: calc(100vh / 7);
  border-radius: 8px;
  object-fit: cover;
  object-position: top center; /* crop bottom preferentially for portrait images */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  border: none; /* avoid shifting overlay coordinates; keep visual border via box-shadow */
  display: block; /* eliminate inline baseline descent that adds a few px to wrapper height */
}

.pic:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.bio {
  flex: 1;
  font-size: 1.05rem;
  line-height: 1.4em;
  position: relative;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  padding-right: var(--space-sm);
  letter-spacing: 0.01em;
}

/* ============ BACK BUTTONS ============ */

#backBtnPol,
#backBtnEdit {
  margin-bottom: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: var(--font-weight-medium);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.02em;
}

#backBtnPol:hover,
#backBtnEdit:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#backBtnPol:active,
#backBtnEdit:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ============ POLITICIAN PAGE ============ */

#polHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
  gap: var(--space-sm);
  position: relative;
}

#polName {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
  flex: 1;
  min-width: 200px;
  margin-right: auto;
}

#backBtnPol {
  margin-right: var(--space-sm);
}

.buy-button {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: var(--font-weight-medium);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.02em;
  white-space: nowrap;
  margin-left: var(--space-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.buy-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.buy-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.buy-button:disabled {
  background: rgba(128, 128, 128, 0.3);
  cursor: not-allowed;
  opacity: 0.7;
}

#polContent {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start; /* prevent stretching the portrait container; keeps overlay alignment stable */
}

#polInfo {
  flex: 1;
}

#polPic {
  width: 120px;
  height: 120px;
  display: block; /* avoid baseline/line-height affecting container height */
  border-radius: 12px;
  object-fit: cover;
  object-position: top center; /* crop bottom on detail page as well */
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

#polPic:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

#polName {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

#polBio {
  font-size: 1.1rem;
  line-height: 1.6em;
  letter-spacing: 0.01em;
  padding-right: var(--space-sm);
}

.editable {
  color: #ffd54f;
  cursor: pointer;
  text-decoration: underline dashed;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-weight: var(--font-weight-medium);
}

.editable:hover {
  filter: brightness(1.3);
  background: rgba(255, 213, 79, 0.1);
  transform: scale(1.05);
}

/* ============ EDIT PAGE ============ */

#editHead {
  font-size: 1.8rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
}

/* #origText removed (no longer rendered) */

#options {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.optionRow {
  display: flex;
  align-items: center;
  padding: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  margin-bottom: var(--space-xxs);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.optionRow:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.optionRow:active {
  transform: translateY(0);
}

.optBtn {
  width: calc(100vh / 20 - 5px);
  height: calc(100vh / 20 - 5px);
  margin-right: var(--space-sm);
  background-size: contain;
  background-repeat: no-repeat;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.optBtn.red {
  background-image: url("../img/upredoff.png");
}

.optBtn.red:hover {
  background-image: url("../img/upredon.png");
  transform: scale(1.1);
  filter: brightness(1.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  background-color: rgba(255, 255, 255, 0.2);
}

.optBtn.blue {
  background-image: url("../img/upblueoff.png");
}

.optBtn.blue:hover {
  background-image: url("../img/upblueon.png");
  transform: scale(1.1);
  filter: brightness(1.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  background-color: rgba(255, 255, 255, 0.2);
}

.optBtn.green {
  background-image: url("../img/upgreenoff.png");
}

.optBtn.green:hover {
  background-image: url("../img/upgreenon.png");
  transform: scale(1.1);
  filter: brightness(1.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  background-color: rgba(255, 255, 255, 0.2);
}

.optBtn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.optWord {
  font-size: 1.1rem;
  line-height: 1.4em;
  letter-spacing: 0.01em;
}

/* ============ VOTE BADGE OVERLAY ============ */

/* Make buttons containing the badge be positioning context */
.upBtn,
.optBtn {
  position: relative;
}

/* Overlay the count centered on the button icon */
.upBtn .vote-count,
.optBtn .vote-count {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-block;
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
  pointer-events: none; /* clicks go to the button */
}

/* Slightly smaller overlay for the smaller option buttons */
.optBtn .vote-count {
  min-width: 24px;
  padding: 2px 6px;
  font-size: 0.9rem;
}

/* ============ PURCHASE MODAL ============ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(60% 60% at 50% 40%, rgba(0,0,0,0.55), rgba(0,0,0,0.75));
  backdrop-filter: saturate(115%) blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal {
  position: relative;
  width: min(520px, calc(100vw - 24px));
  /* Match site switcher dropdown background via theme var */
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(0,0,0,0.08)), var(--header-subsection-bg);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 20px;
}

/* Subtle accent top border using current site accent */
.modal::before {
  content: '';
  position: absolute;
  inset: 0;
  border-top: 3px solid var(--accent-main);
  opacity: 0.35;
  border-radius: 12px;
  pointer-events: none;
}

.modal h2 {
  margin: 0 0 8px 0;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.modal-subtext {
  margin: 0 0 14px 0;
  color: rgba(255,255,255,0.88);
  font-size: 1rem;
}

.modal-small {
  margin-top: 12px;
  color: rgba(255,255,255,0.8);
  font-size: 0.92rem;
}

.modal-close {
  position: absolute;
  right: 6px;
  top: 6px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 22px; /* balanced X */
  line-height: 1;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.12s ease;
}
.modal-close:hover {
  background: rgba(255,255,255,0.16);
}
.modal-close:focus {
  outline: 2px solid var(--accent-main);
  border-radius: 8px;
  outline-offset: 2px;
}

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

@media (max-width: 420px) {
  .purchase-grid {
    grid-template-columns: 1fr;
  }
}

.purchase-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04));
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
  min-height: 72px;
  position: relative;
}

.purchase-btn:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  box-shadow: 0 10px 28px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.25) inset;
  transform: translateY(-1px) scale(1.01);
  border-color: var(--accent-main);
}

.purchase-btn:active {
  transform: translateY(0);
}

.purchase-btn .votes {
  font-weight: 1000;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.purchase-btn .price {
  font-weight: 700;
  opacity: 0.9;
}

.purchase-btn:focus-visible {
  outline: 2px solid var(--accent-main);
  outline-offset: 3px;
  border-radius: 12px;
}

/* Overlay row buttons */
.ovBtn {
  width: calc(100vh / 20 - 5px);
  height: calc(100vh / 20 - 5px);
  margin-right: var(--space-sm);
  background-size: contain;
  background-repeat: no-repeat;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  background-color: rgba(255,255,255,0.10);
  border: 2px solid rgba(255,255,255,0.20);
  position: relative; /* for vote-count badge centering */
}

/* Reuse upvote icons by theme */
.ovBtn.red   { background-image: url("../img/upredoff.png"); }
.ovBtn.red:hover   { background-image: url("../img/upredon.png"); transform: scale(1.1); filter: brightness(1.2); }
.ovBtn.blue  { background-image: url("../img/upblueoff.png"); }
.ovBtn.blue:hover  { background-image: url("../img/upblueon.png"); transform: scale(1.1); filter: brightness(1.2); }
.ovBtn.green { background-image: url("../img/upgreenoff.png"); }
.ovBtn.green:hover { background-image: url("../img/upgreenon.png"); transform: scale(1.1); filter: brightness(1.2); }

/* ============ CONFIRMATION MODAL ============ */

.confirm-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.confirm-btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.confirm-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.confirm-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.confirm-btn:focus-visible {
  outline: 2px solid var(--accent-main);
  outline-offset: 2px;
}

/* ============ TOASTS ============ */
.toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
  pointer-events: none; /* allow clicks through except on the toast itself */
}

.toast {
  pointer-events: auto;
  min-width: 220px;
  max-width: min(480px, calc(100vw - 32px));
  background: rgba(0,0,0,0.85);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity .25s ease, transform .25s ease;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-hide {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.toast--info {
  border-color: rgba(255,255,255,0.28);
}

.toast--success {
  border-color: rgba(82, 255, 140, 0.65);
}

.toast--warn {
  border-color: rgba(255, 235, 59, 0.65);
}

.toast--error {
  border-color: rgba(255, 82, 82, 0.65);
}

/* ============================
   COMMENTS
   ============================ */
.comments-section {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
}
.comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.comments-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.comments-sort {
  display: flex;
  gap: 8px;
}
.sort-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 700;
}
.sort-btn:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}
.sort-btn.active {
  border-color: var(--accent-main);
  background: rgba(255,255,255,0.18);
}

.comment-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--space-sm);
}
.comment-input {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  color: #fff;
  padding: 8px 10px;
  font-size: 1rem;
}
.comment-input:focus {
  outline: 2px solid var(--accent-main);
  outline-offset: 2px;
}
.comment-note {
  font-size: 0.92rem;
  opacity: 0.85;
}
.comment-submit-btn {
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  transition: all 0.15s ease;
}
.comment-submit-btn:hover { background: rgba(255,255,255,0.18); transform: translateY(-1px); }

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-xs);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.04);
}
.comment-row:last-child {
  border-bottom: none;
}

/* Make the comment vote button smaller and non-shrinking within rows */
.comment-row .optBtn {
  width: 36px;
  height: 36px;
  margin-top: 2px;
  flex-shrink: 0;
}
.comment-row .optBtn .vote-count {
  min-width: 22px;
  padding: 2px 6px;
  font-size: 0.85rem;
}
.comment-body-wrap {
  /* Give the text column a sensible base and prevent ultra-narrow wrap */
  flex: 1 1 60%;
  min-width: 260px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.comment-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 2px;
}
.comment-author {
  color: #fff;
}
.badge-private {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.1);
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffd54f;
}
.comment-body {
  white-space: pre-wrap;
  line-height: 1.45em;
  letter-spacing: 0.01em;
  /* Break long tokens but don't split between every character */
  overflow-wrap: break-word;
  word-break: normal;
}
.comment-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;     /* place actions as a footer row under the body */
  flex-wrap: wrap;     /* allow wrapping on small screens */
  justify-content: flex-start;
}
/* Ensure the Edit/Delete pair has internal gap when nested as a single flex item */
.comment-actions .action-pair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cmt-action {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 700;
}
.cmt-action:hover { background: rgba(255,255,255,0.14); transform: translateY(-1px); }
.cmt-action.disabled,
.cmt-action:disabled { opacity: 0.6; cursor: not-allowed; }

.comment-children {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.comment-inline-box {
  margin-top: 6px;
  width: 100%;
}
/* Ensure inline editors/replies take full width of the text column */
.comment-edit-box,
.comment-reply-box {
  width: 100%;
}

/* While editing, disable row flex so the editor can span full width */
.comment-row.editing {
  display: block;
}
/* Defensive: hide icon even if JS misses it */
.comment-row.editing .optBtn {
  display: none !important;
}
/* Expand body column and editor to full width */
.comment-row.editing .comment-body-wrap {
  flex: none;
  min-width: 100%;
  width: 100%;
}
.comment-row.editing .comment-inline-box,
.comment-row.editing .comment-edit-box,
.comment-row.editing .comment-reply-box,
.comment-row.editing .comment-input {
  width: 100%;
}
.comment-inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.comment-save-btn,
.comment-cancel-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s ease;
}
.comment-save-btn:hover,
.comment-cancel-btn:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

/* ============ POL HEADER BUTTON ALIGNMENT FIX ============ */
#polHeader #backBtnPol,
#polHeader #backBtnEdit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.toggle-original {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: var(--font-weight-medium);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.02em;
  white-space: nowrap;
  margin-left: var(--space-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle-original:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.toggle-original:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* === Bio page top buttons: robust vertical alignment + consistent sizing (overrides) === */
#polHeader > button,
#polHeader .buy-button,
#polHeader .toggle-original {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  height: 36px;
  padding: 6px 12px;
  vertical-align: middle;
}

/* Remove inherited bottom margin on the Back button when used in the bio header row */
#polHeader #backBtnPol {
  margin-bottom: 0;
}

/* Slightly more compact on small screens */
@media (max-width: 480px) {
  #polHeader > button,
  #polHeader .buy-button,
  #polHeader .toggle-original {
    height: 34px;
    padding: 6px 10px;
  }
}
