/* Polls and quizzes — pun_poll */

.pun-poll {
	margin: 1em 0;
	padding: 0.8em 1em;
	border: 1px solid #c8d0d8;
	border-radius: 6px;
	background: #f7f9fb;
}

.pun-poll-quiz {
	border-color: #d8c9a8;
	background: #fdfaf2;
}

.pun-poll-closed {
	opacity: 0.92;
}

.pun-poll-head {
	margin-bottom: 0.6em;
}

.pun-poll-kind {
	display: inline-block;
	margin-right: 0.6em;
	padding: 0.1em 0.5em;
	border-radius: 3px;
	background: #5c7a99;
	color: #fff;
	font-size: 0.8em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	vertical-align: middle;
}

.pun-poll-quiz .pun-poll-kind {
	background: #a8853c;
}

.pun-poll-question {
	font-weight: bold;
	font-size: 1.05em;
}

.pun-poll-hint,
.pun-poll-note,
.pun-poll-foot {
	margin: 0.4em 0;
	color: #667;
	font-size: 0.9em;
}

.pun-poll-options {
	margin: 0.5em 0;
	padding: 0;
	list-style: none;
}

.pun-poll-options li {
	margin: 0.25em 0;
	padding: 0;
}

.pun-poll-options label {
	display: block;
	padding: 0.25em 0.3em;
	border-radius: 4px;
	cursor: pointer;
}

.pun-poll-options label:hover {
	background: #eef3f8;
}

.pun-poll-results {
	margin: 0.5em 0;
	padding: 0;
	list-style: none;
}

.pun-poll-results li {
	margin: 0.35em 0;
	padding: 0.2em 0.3em;
	border-radius: 4px;
}

.pun-poll-results .pun-poll-label {
	display: block;
}

.pun-poll-results li.mine .pun-poll-label {
	font-weight: bold;
}

.pun-poll-results li.correct {
	background: #eaf6ea;
}

.pun-poll-results li.wrong.mine {
	background: #fbeceb;
}

.pun-poll-bar {
	display: inline-block;
	width: 70%;
	max-width: 70%;
	height: 10px;
	margin-right: 0.6em;
	border-radius: 5px;
	background: #e2e8ee;
	vertical-align: middle;
	overflow: hidden;
}

.pun-poll-fill {
	display: block;
	height: 100%;
	background: #5c7a99;
}

.pun-poll-results li.correct .pun-poll-fill {
	background: #4f9d4f;
}

.pun-poll-results li.wrong .pun-poll-fill {
	background: #9aa6b2;
}

.pun-poll-num {
	font-size: 0.9em;
	color: #556;
}

.pun-poll-verdict {
	margin: 0.5em 0;
	font-weight: bold;
}

.pun-poll-verdict.right {
	color: #2e7d32;
}

.pun-poll-verdict.wrong {
	color: #b3261e;
}

.pun-poll-error {
	margin: 0.4em 0;
	color: #b3261e;
}

.pun-poll-busy {
	opacity: 0.6;
}

.pun-poll-missing {
	color: #888;
	font-style: italic;
}

/* Editor */

.pun-poll-editor {
	margin: 0.6em 0 0.2em;
}

.pun-poll-editor-hint {
	margin-left: 0.6em;
	color: #667;
	font-size: 0.9em;
}

.pun-poll-chips {
	margin: 0.5em 0 0;
	padding: 0;
	list-style: none;
}

.pun-poll-chip {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	align-items: center;
	margin: 0.3em 0;
	padding: 0.35em 0.6em;
	border: 1px solid #c8d0d8;
	border-radius: 4px;
	background: #f7f9fb;
}

.pun-poll-chip-kind {
	padding: 0.05em 0.4em;
	border-radius: 3px;
	background: #5c7a99;
	color: #fff;
	font-size: 0.8em;
}

.pun-poll-chip-q {
	flex: 1 1 12em;
}

.pun-poll-chip-meta {
	color: #778;
	font-size: 0.85em;
}

/* Modal */

.pun-poll-modal {
	position: fixed;
	inset: 0;
	/* выше закреплённой шапки (#main-header, .fixed — z-index: 1000) */
	z-index: 10000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 4vh 1em;
	overflow: auto;
}

.pun-poll-modal[hidden] {
	display: none;
}

/* пока модалка открыта, страница под ней не прокручивается */
body.pun-poll-modal-open {
	overflow: hidden;
}

.pun-poll-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(20, 25, 30, 0.55);
}

.pun-poll-modal-box,
.pun-poll-modal {
	overscroll-behavior: contain;
}

.pun-poll-modal-box {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 620px;
	padding: 1em 1.2em 1.2em;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.pun-poll-modal-title {
	margin: 0 0 0.7em;
	font-size: 1.15em;
}

.pun-poll-m-row {
	margin: 0.7em 0;
}

.pun-poll-m-row[hidden] {
	display: none;
}

.pun-poll-m-inline {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	align-items: center;
}

.pun-poll-m-lbl {
	display: block;
	margin-bottom: 0.25em;
	font-weight: bold;
}

.pun-poll-m-question,
.pun-poll-m-otext {
	width: 100%;
	box-sizing: border-box;
	padding: 0.35em 0.5em;
	border: 1px solid #c2ccd6;
	border-radius: 4px;
}

.pun-poll-m-options {
	margin: 0 0 0.5em;
	padding: 0;
	list-style: none;
}

.pun-poll-m-option {
	display: flex;
	gap: 0.5em;
	align-items: center;
	margin: 0.3em 0;
}

.pun-poll-m-ocorrect-lbl[hidden] {
	display: none;
}

.pun-poll-m-ocorrect-lbl {
	white-space: nowrap;
	font-size: 0.9em;
	color: #556;
}

.pun-poll-m-oremove {
	padding: 0 0.5em;
	border: 1px solid #c2ccd6;
	border-radius: 4px;
	background: #f2f5f8;
	cursor: pointer;
	line-height: 1.6;
}

.pun-poll-m-max {
	width: 4em;
}

.pun-poll-m-errors {
	margin: 0 0 0.7em;
	padding: 0.5em 0.8em;
	border: 1px solid #e4b3ae;
	border-radius: 4px;
	background: #fbeceb;
	color: #8c211a;
}

.pun-poll-m-errors ul {
	margin: 0;
	padding-left: 1.1em;
}

.pun-poll-m-note {
	margin: 0.5em 0;
	color: #667;
	font-size: 0.9em;
}

.pun-poll-m-buttons {
	display: flex;
	gap: 0.6em;
	margin: 1em 0 0;
}

.pun-poll-m-buttons button,
.pun-poll-m-add {
	padding: 0.35em 0.9em;
	border: 1px solid #c2ccd6;
	border-radius: 4px;
	background: #f2f5f8;
	cursor: pointer;
}

/* синяя, как штатные primary-кнопки форума; селектор с .pun-poll-m-buttons —
   иначе правило серых кнопок выше перебивает по специфичности */
.pun-poll-m-buttons .pun-poll-m-save {
	border-color: #1979bf;
	background: #1979bf;
	color: #fafafa;
}

.pun-poll-m-buttons .pun-poll-m-save:hover,
.pun-poll-m-buttons .pun-poll-m-save:focus {
	border-color: #15639c;
	background: #15639c;
}

.pun-poll-m-buttons .pun-poll-m-reset {
	margin-left: auto;
	color: #8c211a;
}

.pun-poll-m-reset[hidden] {
	display: none;
}

@media (max-width: 600px) {
	.pun-poll-bar {
		width: 55%;
	}

	.pun-poll-m-inline {
		flex-direction: column;
		align-items: flex-start;
	}
}
