#tab-chat .cht-poll-preview:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  margin: 0 0 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--tx);
  font-size: 12px;
}

#tab-chat .cht-poll-preview strong {
  flex: 1 1 145px;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tab-chat .cht-poll-editor {
  box-sizing: border-box;
  inline-size: min(440px, calc(100% - 28px));
  max-block-size: calc(100dvh - 28px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--tx);
}

#tab-chat .cht-poll-editor::backdrop {
  background: rgb(14 20 34 / .52);
}

#tab-chat .cht-poll-editor form,
#tab-chat .cht-poll-editor :is(fieldset, .cht-poll-editor-choices) {
  display: grid;
  gap: 8px;
}

#tab-chat .cht-poll-editor form {gap: 13px}
#tab-chat .cht-poll-editor h3 {margin: 0}

#tab-chat .cht-poll-editor fieldset {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

#tab-chat .cht-poll-editor legend {margin-block-end: 4px}

#tab-chat .cht-poll-editor label {
  display: grid;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

#tab-chat .cht-poll-editor :is(input:not([type=checkbox]), select) {
  box-sizing: border-box;
  min-inline-size: 0;
  min-block-size: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--tx);
  font: inherit;
}

#tab-chat .cht-poll-editor :is(input, select):focus-visible,
#tab-chat .cht-poll-result:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

#tab-chat .cht-poll-editor-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

#tab-chat .cht-poll-editor-option input {grid-column: 1 / -1}
#tab-chat .cht-poll-editor-option:has(button:not([hidden])) input {grid-column: 1}
#tab-chat .cht-poll-editor fieldset > .btn {justify-self: start}

#tab-chat .cht-poll-editor-preferences,
#tab-chat .cht-poll-editor footer,
#tab-chat .cht-poll-card footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#tab-chat .cht-poll-editor footer {justify-content: flex-end}

#tab-chat .cht-poll-editor .cht-poll-multiple {
  display: flex;
  min-block-size: 36px;
}

#tab-chat .cht-poll-card {
  display: grid;
  gap: 7px;
  box-sizing: border-box;
  inline-size: min(100%, 390px);
  margin: 5px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: var(--tx);
  white-space: normal;
}

#tab-chat .cht-poll-question {font-size: 15px}

#tab-chat :is(.cht-poll-meta, .cht-poll-count) {
  color: var(--tx2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#tab-chat .cht-poll-results {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

#tab-chat .cht-poll-result {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  min-block-size: 36px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow-wrap: anywhere;
}

#tab-chat .cht-poll-result::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: -1;
  inline-size: var(--cht-poll-share, 0%);
  background: var(--accent-bg);
}

#tab-chat .cht-poll-result.is-interactive {cursor: pointer}
#tab-chat .cht-poll-result.is-interactive:hover {border-color: var(--accent)}
#tab-chat .cht-poll-result input {flex: none; accent-color: var(--accent)}
#tab-chat .cht-poll-option-name {min-inline-size: 0; flex: 1}
#tab-chat .cht-poll-count {flex: none}
#tab-chat .cht-poll-error {margin: 0; color: var(--danger-on); font-size: 12px}
#tab-chat .cht-poll-error:empty {display: none}
#tab-chat :is(.cht-poll-editor, .cht-poll-card) button[hidden] {display: none}
