/* PeopleRank — народный рейтинг. Lightweight, CLS-safe, mobile-first. */

.pr-rating {
  --pr-accent: #ff5a1f;
  --pr-bg: #fff;
  --pr-line: #ececef;
  --pr-text: #16181d;
  --pr-muted: #6b7280;
  --pr-radius: 14px;
  max-width: 760px;
  margin: 2rem auto;
  font-family: inherit;
  color: var(--pr-text);
}

.pr-trust {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: .9rem;
}
.pr-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(22, 163, 74, .12);
  color: #15803d;
  font-weight: 700;
}
.pr-trust-count { color: var(--pr-muted); }
.pr-trust-index {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
}
.pr-trust-index--high { background: rgba(22, 163, 74, .12); color: #15803d; }
.pr-trust-index--mid  { background: rgba(234, 179, 8, .15); color: #a16207; }
.pr-trust-index--low  { background: rgba(220, 38, 38, .12); color: #b91c1c; }

.pr-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pr-methodology { max-width: 760px; margin: 2rem auto; line-height: 1.6; }
.pr-methodology h2 { margin-bottom: .5rem; }
.pr-methodology h3 { margin-top: 1.4rem; font-size: 1.05rem; }

.pr-item {
  display: grid;
  grid-template-columns: 44px 64px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--pr-bg);
  border: 1px solid var(--pr-line);
  border-radius: var(--pr-radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  will-change: transform;
}

.pr-item--voted { box-shadow: 0 0 0 2px var(--pr-accent) inset; }

.pr-rank {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  color: var(--pr-accent);
  font-variant-numeric: tabular-nums;
}

.pr-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: #f3f4f6;
}

/* Placeholder when a nominee has no image — keeps the grid from shifting. */
.pr-thumb--ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.6rem;
  color: #fff;
  background: linear-gradient(135deg, var(--pr-accent), #ff8a4f);
  user-select: none;
}

.pr-body { min-width: 0; }

.pr-name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.25;
}

.pr-desc {
  margin: 2px 0 4px;
  font-size: .86rem;
  color: var(--pr-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pr-votes { font-size: .8rem; color: var(--pr-muted); }
.pr-votes-num { color: var(--pr-text); }

.pr-vote-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
  background: var(--pr-accent);
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
  white-space: nowrap;
}
.pr-vote-btn:hover { filter: brightness(1.05); }
.pr-vote-btn:active { transform: scale(.96); }
.pr-vote-btn:disabled { opacity: .6; cursor: default; }
.pr-vote-btn--loading { position: relative; color: transparent; }
.pr-vote-btn--loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pr-spin .7s linear infinite;
}
@keyframes pr-spin { to { transform: rotate(360deg); } }

.pr-suggest-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed var(--pr-line);
  border-radius: var(--pr-radius);
  background: transparent;
  color: var(--pr-muted);
  font-weight: 600;
  cursor: pointer;
}
.pr-suggest-btn:hover { border-color: var(--pr-accent); color: var(--pr-accent); }

.pr-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  padding: 12px 18px;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .18);
}
.pr-toast--show { opacity: 1; transform: translate(-50%, 0); }
.pr-toast--ok { background: #16a34a; }
.pr-toast--err { background: #dc2626; }

@media (max-width: 560px) {
  .pr-item { grid-template-columns: 34px 48px 1fr; grid-template-rows: auto auto; }
  .pr-thumb { width: 48px; height: 48px; }
  .pr-vote-btn { grid-column: 1 / -1; width: 100%; margin-top: 6px; }
}

/* ---- Creation widget ---- */
.pr-create {
  --pr-accent: #ff5a1f;
  --pr-line: #ececef;
  --pr-muted: #6b7280;
  position: relative;
  max-width: 680px;
  margin: 1.5rem auto;
  font-family: inherit;
}

.pr-create-label {
  display: block;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.pr-create-input,
.pr-create-add-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.05rem;
  border: 2px solid var(--pr-line);
  border-radius: 14px;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
.pr-create-input:focus,
.pr-create-add-input:focus { border-color: var(--pr-accent); }

.pr-create-results {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--pr-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .12);
}
.pr-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: .95rem;
  color: inherit;
  text-decoration: none;
}
.pr-result:hover { background: #faf6f3; }
.pr-result-go { color: var(--pr-muted); font-size: .8rem; }
.pr-result--create { font-weight: 700; color: var(--pr-accent); border-top: 1px solid var(--pr-line); }
.pr-result-sem { font-size: .72rem; color: #2563eb; background: rgba(37,99,235,.1); padding: 1px 6px; border-radius: 6px; margin-left: 6px; }

.pr-create-step2 { margin-top: 20px; }
.pr-create-h { margin: 0 0 4px; font-size: 1.1rem; }
.pr-create-hint { margin: 0 0 12px; color: var(--pr-muted); font-size: .9rem; }

.pr-create-nominees {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.pr-nominee {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--pr-line);
  border-radius: 12px;
  cursor: pointer;
}
.pr-nominee:hover { border-color: var(--pr-accent); }
.pr-nominee-cb { width: 18px; height: 18px; accent-color: var(--pr-accent); }
.pr-nominee-img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.pr-nominee-body { display: flex; flex-direction: column; min-width: 0; }
.pr-nominee-body b { font-size: .92rem; line-height: 1.2; }
.pr-nominee-body span { font-size: .78rem; color: var(--pr-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pr-create-add { display: flex; gap: 8px; margin-bottom: 14px; }
.pr-create-add-btn {
  flex: 0 0 auto;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: #f1f2f4;
  font-weight: 600;
  cursor: pointer;
}
.pr-create-submit { width: 100%; }

/* ---- Suggest modal ---- */
.pr-modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}
.pr-modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .3);
}
.pr-modal-box h3 { margin: 0 0 14px; }
.pr-modal-box input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--pr-line, #ececef);
  border-radius: 10px;
  box-sizing: border-box;
}
.pr-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.pr-modal-cancel { border: 0; background: transparent; cursor: pointer; color: #6b7280; font-weight: 600; }

/* Pre-vote share gate */
.pr-share-why { color: #6b7280; font-size: .92rem; margin: 0 0 16px; }
.pr-share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.pr-share-btn {
  padding: 12px 14px;
  border: 1px solid var(--pr-line, #ececef);
  border-radius: 12px;
  background: #fff;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: border-color .12s, transform .1s;
}
.pr-share-btn:hover { border-color: var(--pr-accent, #ff5a1f); }
.pr-share-btn:active { transform: scale(.97); }
.pr-share-native { grid-column: 1 / -1; background: var(--pr-accent, #ff5a1f); color: #fff; border-color: transparent; }
.pr-modal-box .pr-modal-cancel { display: block; margin: 0 auto; }
@media (prefers-color-scheme: dark) { .pr-share-btn { background: #23262e; color: #f3f4f6; } }

/* Opinion textarea in the post-vote modal */
.pr-modal-body {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--pr-line, #ececef);
  border-radius: 10px;
  margin-bottom: 12px;
  font: inherit;
  resize: vertical;
}

/* Inline argument next to a position */
.pr-arg {
  margin: 6px 0 0;
  font-size: .84rem;
  font-style: italic;
  color: var(--pr-muted, #6b7280);
  border-left: 3px solid var(--pr-accent, #ff5a1f);
  padding-left: 8px;
}

.pr-name a { color: inherit; text-decoration: none; }
.pr-name a:hover { text-decoration: underline; }

/* Affiliate links */
.pr-aff {
  display: inline-block;
  margin-top: 6px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--pr-accent, #ff5a1f);
  text-decoration: none;
}
.pr-aff:hover { text-decoration: underline; }
.pr-aff-btn { display: inline-block; margin-top: 10px; text-decoration: none; }

/* Embed code + promo */
.pr-embed { margin-top: 6px; font-size: .8rem; }
.pr-embed summary { cursor: pointer; color: var(--pr-muted, #6b7280); }
.pr-embed summary:hover { color: var(--pr-accent, #ff5a1f); }
.pr-embed textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  font-family: monospace;
  font-size: .72rem;
  border: 1px solid var(--pr-line, #ececef);
  border-radius: 8px;
  padding: 6px;
  resize: vertical;
}

/* Position history chart */
.pr-history { max-width: 760px; margin: 1.5rem auto 0; }
.pr-history-title { font-size: 1.1rem; margin-bottom: 10px; }
.pr-history-empty { color: var(--pr-muted, #6b7280); font-size: .9rem; }
.pr-history-svg { width: 100%; height: auto; border: 1px solid var(--pr-line, #ececef); border-radius: 12px; background: #fff; }
.pr-history-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: .85rem; }
.pr-history-leg { display: inline-flex; align-items: center; gap: 6px; }
.pr-history-leg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
@media (prefers-color-scheme: dark) { .pr-history-svg { background: #1a1c22; } }

/* Reviews block */
.pr-reviews { max-width: 760px; margin: 1.5rem auto 0; }
.pr-reviews-title { font-size: 1.1rem; margin-bottom: 12px; }
.pr-review-form { margin-bottom: 18px; }
.pr-review-body {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--pr-line, #ececef);
  border-radius: 12px;
  font: inherit;
  resize: vertical;
  margin-bottom: 8px;
}
.pr-review-row { display: flex; gap: 8px; }
.pr-review-name {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--pr-line, #ececef);
  border-radius: 10px;
}
.pr-review-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pr-review {
  padding: 12px 14px;
  border: 1px solid var(--pr-line, #ececef);
  border-radius: 12px;
}
.pr-review-meta { display: flex; gap: 10px; align-items: baseline; font-size: .85rem; color: var(--pr-muted, #6b7280); margin-bottom: 4px; }
.pr-review-text { margin: 0 0 8px; }
.pr-review-helpful { border: 0; background: transparent; cursor: pointer; color: var(--pr-muted, #6b7280); font-weight: 600; padding: 0; }
.pr-review-helpful:hover { color: var(--pr-accent, #ff5a1f); }

/* Nominee page */
.pr-nominee-page { max-width: 760px; margin: 2rem auto; padding: 0 16px; }
.pr-nominee-head { display: flex; gap: 18px; align-items: center; margin-bottom: 1.5rem; }
.pr-nominee-photo { width: 120px; height: 120px; object-fit: cover; border-radius: 16px; }
.pr-nominee-name { margin: 0 0 6px; }
.pr-nominee-desc { margin: 0; color: var(--pr-muted, #6b7280); }
.pr-nominee-h { font-size: 1.1rem; margin: 1.5rem 0 .75rem; }
.pr-nominee-ratings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pr-nominee-ratings li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--pr-line, #ececef); border-radius: 12px; }
.pr-nominee-ratings .pr-rank { font-size: 1.2rem; }
.pr-nominee-ratings .pr-votes { margin-left: auto; }

@media (prefers-color-scheme: dark) {
  .pr-rating { --pr-bg: #1a1c22; --pr-line: #2a2d36; --pr-text: #f3f4f6; --pr-muted: #9aa0ab; }
  .pr-create-results, .pr-modal-box { background: #1a1c22; color: #f3f4f6; }
  .pr-result:hover { background: #23262e; }
  .pr-create-add-btn { background: #2a2d36; color: #f3f4f6; }
}
