/* ELEVN Poll Feed V1 — published Poll only */

.elevn-poll-question .post-text {
  font-size: 21px;
  line-height: 1.42;
  font-weight: 700;
}

.elevn-poll-question.is-shared .post-text {
  font-size: 16px;
  line-height: 1.48;
  font-weight: 650;
}

.elevn-poll-feed.poll-options {
  padding: 0 18px 3px;
}

.elevn-poll-feed .elevn-poll-option-wrap {
  position: relative;
  margin-bottom: 13px;
}

.elevn-poll-feed .poll-option {
  display: block;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  overflow: hidden;
  background: #f4f6fa;
  border: 1px solid #dce2ed;
  border-radius: 14px;
  color: #212a3a;
  font-weight: 600;
  transition: border-color .18s ease, background-color .18s ease;
}

.elevn-poll-feed .poll-option:hover {
  cursor: pointer;
  background: #ecf0f8;
  border-color: #a4b4d3;
}

.elevn-poll-feed .poll-option .percentage-bg {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 13px;
  background: #c7d9fa;
  opacity: .72;
  pointer-events: none;
  transition: width .24s ease;
}

.elevn-poll-feed .elevn-poll-option-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
}

.elevn-poll-feed .elevn-poll-check {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
}

.elevn-poll-feed .elevn-poll-radio-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

.elevn-poll-feed .elevn-poll-option-label {
  display: block;
  width: 100%;
  margin: 0;
  padding: 16px 0;
  color: inherit;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.elevn-poll-feed .elevn-poll-result {
  flex: 0 0 auto;
  color: #30466e;
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

/* Conceal results visually and from the accessibility tree. */
.elevn-poll-feed:not(.is-revealed) .percentage-bg,
.elevn-poll-feed:not(.is-revealed) .elevn-poll-result,
.elevn-poll-feed:not(.is-revealed) .poll-voters {
  display: none !important;
}

.elevn-poll-feed .poll-option:has(input:checked) {
  border-color: #648ce6;
  box-shadow: inset 0 0 0 1px #648ce6;
}

.elevn-poll-feed .poll-option:has(input:focus-visible) {
  outline: 2px solid #699df2;
  outline-offset: 2px;
}

.elevn-poll-feed .poll-voters {
  display: block;
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: -9px;
  padding: 0;
}

.elevn-poll-feed .poll-voters .more {
  display: block;
  width: auto;
  min-width: 28px;
  height: 20px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #e3e9f4;
  color: #415373;
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
  text-align: center;
}

.elevn-poll-feed .elevn-poll-footer {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px 14px;
  margin-top: 17px;
  color: #6d7890;
  font-size: 12px;
}

.elevn-poll-feed .elevn-poll-total,
.elevn-poll-feed .elevn-poll-result {
  font-variant-numeric: tabular-nums;
}

.elevn-poll-feed .elevn-poll-total-count {
  font-weight: 750;
  color: #445578;
}

.elevn-poll-feed .elevn-poll-total-unit {
  text-transform: lowercase;
}

.elevn-poll-feed .elevn-poll-hint {
  display: none;
}

.elevn-poll-feed.is-revealed:not(.is-readonly):has(input:checked) .elevn-poll-hint {
  display: inline;
}

.elevn-poll-feed.is-readonly .poll-option,
.elevn-poll-feed.is-readonly .poll-option:hover,
.elevn-poll-feed.is-readonly .elevn-poll-option-label {
  cursor: default;
  pointer-events: none;
}

body.night-mode .elevn-poll-feed .poll-option {
  background: #101323;
  border-color: #303b57;
  color: #eef2fc;
}

body.night-mode .elevn-poll-feed .poll-option:hover {
  background: #1c2640;
  border-color: #536688;
}

body.night-mode .elevn-poll-feed .percentage-bg {
  background: #324c88;
  opacity: .54;
}

body.night-mode .elevn-poll-feed .poll-option:has(input:checked) {
  border-color: #86a9ff;
  box-shadow: inset 0 0 0 1px #86a9ff;
}

body.night-mode .elevn-poll-feed .elevn-poll-result {
  color: #d5e4ff;
}

body.night-mode .elevn-poll-feed .poll-voters .more {
  background: #293754;
  color: #dce7ff;
}

body.night-mode .elevn-poll-feed .elevn-poll-footer {
  color: #acbad5;
}

body.night-mode .elevn-poll-feed .elevn-poll-total-count {
  color: #dce7ff;
}

@media (max-width: 767px) {
  .elevn-poll-question .post-text {
    font-size: 20px;
  }

  .elevn-poll-question.is-shared .post-text {
    font-size: 16px;
  }

  .elevn-poll-feed.poll-options {
    padding: 0 14px 3px;
  }

  .elevn-poll-feed .poll-option {
    padding: 0 13px;
  }

  .elevn-poll-feed .elevn-poll-option-label {
    font-size: 14px;
  }
}

/* ELEVN Poll Feed M1-P1 reviewed polish */

/* D1: place the voters trigger inside the visual row.
   .poll-voters is a sibling of .poll-option, inside
   the positioned .elevn-poll-option-wrap. */
.elevn-poll-feed.is-revealed .poll-option {
  padding-right: 68px;
}

.elevn-poll-feed .poll-voters {
  position: absolute;
  top: 50%;
  right: 9px;
  bottom: auto;
  left: auto;
  z-index: 3;
  padding: 0;
  transform: translateY(-50%);
}

.elevn-poll-feed .poll-voters .more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 44px;
  width: auto;
  height: auto;
  padding: 0 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #637596;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 650;
  cursor: pointer;
}


body.night-mode .elevn-poll-feed .poll-voters .more {
  background: transparent;
  color: #b9c9e5;
}

.elevn-poll-feed .poll-voters .more:hover {
  text-decoration: underline;
}

/* D2: compact desktop, full-width mobile. */
@media (min-width: 768px) {
  .elevn-poll-feed.poll-options {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
  }
}

/* D3: concise hint, with safe wrapping. */
.elevn-poll-feed .elevn-poll-footer {
  min-width: 0;
}

.elevn-poll-feed .elevn-poll-hint {
  min-width: 0;
  max-width: 100%;
  text-align: right;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* D4: reinforce non-selected answers, including 0%.
   Do not rely exclusively on :active in mobile WebViews. */
.elevn-poll-feed:not(.is-readonly)
.poll-option:not(:has(input:checked)) {
  border-color: #a8b8d1;
  cursor: pointer;
}

body.night-mode
.elevn-poll-feed:not(.is-readonly)
.poll-option:not(:has(input:checked)) {
  border-color: #4b6086;
}

/* D5: long user-generated text. */
.elevn-poll-question .post-text,
.elevn-poll-question .post-colored-text-wrapper,
.elevn-poll-feed .elevn-poll-option-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ELEVN Poll M1-P4 — ranking colors */
/* Leader: restrained gold. Other options: slate blue.
   Tied leaders: identical blue. Row sizing remains unchanged. */

.elevn-poll-feed.is-revealed .elevn-poll-leader .percentage-bg {
  background: #D5A13F;
  opacity: .70;
}

.elevn-poll-feed.is-revealed .elevn-poll-leader .elevn-poll-percentage {
  color: #805400;
  font-size: 17px;
  font-weight: 850;
}

body.night-mode .elevn-poll-feed.is-revealed .elevn-poll-leader .percentage-bg {
  background: #D5A13F;
  opacity: .70;
}

body.night-mode .elevn-poll-feed.is-revealed .elevn-poll-leader .elevn-poll-percentage {
  color: #FFE2A0;
}

.elevn-poll-feed.is-revealed .elevn-poll-trailer .percentage-bg {
  background: #586C8C;
  opacity: .38;
}

body.night-mode .elevn-poll-feed.is-revealed .elevn-poll-trailer .percentage-bg {
  background: #586C8C;
  opacity: .50;
}

.elevn-poll-feed.is-revealed .elevn-poll-tie .percentage-bg {
  background: #527FC8;
  opacity: .46;
}

body.night-mode .elevn-poll-feed.is-revealed .elevn-poll-tie .percentage-bg {
  background: #527FC8;
  opacity: .52;
}
