/* ===== Опросы 2.0.7 ===== */
/* --- создание --- */
.pc { display: flex; flex-direction: column; gap: 8px; }
.pc .field-input { width: 100%; box-sizing: border-box; }
.pc-title { font-size: 16px; font-weight: 600; }
.pc-label { margin-top: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.pc-quiz-hint { display: none; text-transform: none; font-weight: 500; letter-spacing: 0; color: #16a34a; }
.pc--quiz .pc-quiz-hint { display: inline; }
.pc-answers { display: flex; flex-direction: column; gap: 6px; }
.pc-ans { display: flex; align-items: center; gap: 6px; animation: pcIn .18s ease-out; }
@keyframes pcIn { from { opacity: 0; transform: translateY(-4px); } }
.pc-ans .field-input { flex: 1; min-width: 0; }
.pc-correct { display: none; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: transparent; cursor: pointer; padding: 0; transition: background .15s, border-color .15s; }
.pc--quiz .pc-correct { display: block; }
.pc-ans.is-correct .pc-correct { background: #22c55e; border-color: #22c55e; box-shadow: inset 0 0 0 3px var(--bg-elevated, #fff); }
.pc-ans.is-correct .field-input { border-color: #22c55e; }
.pc-del { flex: 0 0 30px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.pc-del:hover { background: var(--bg-soft); color: #ef4444; }
.pc-del[hidden] { display: block; visibility: hidden; }
.pc-add { align-self: flex-start; border: 0; background: transparent; color: var(--primary); font: inherit; font-weight: 600; padding: 6px 2px; cursor: pointer; }
.pc-add[hidden] { display: none; }
.pc-switches { display: flex; flex-direction: column; border-radius: 14px; background: var(--bg-soft); overflow: hidden; }
.pc-switch { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; position: relative; }
.pc-switch + .pc-switch { border-top: 1px solid var(--line); }
.pc-switch > span { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pc-switch b { font-size: 14px; font-weight: 600; }
.pc-switch small { font-size: 12px; color: var(--muted); }
.pc-switch input { position: absolute; opacity: 0; pointer-events: none; }
.pc-switch i { flex: 0 0 40px; height: 24px; border-radius: 12px; background: color-mix(in srgb, var(--muted) 35%, transparent); position: relative; transition: background .2s; }
.pc-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.3,1.4,.5,1); }
.pc-switch input:checked + i { background: var(--primary); }
.pc-switch input:checked + i::after { transform: translateX(16px); }
.pc-switch input:focus-visible + i { outline: 2px solid var(--primary); outline-offset: 2px; }
.pc-switch.is-off { opacity: .45; pointer-events: none; }
.pc-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.pc-row.hidden { display: none; }
.pc-timer { display: flex; gap: 6px; flex-wrap: wrap; }
.pc-timer button { flex: 1; min-width: 70px; padding: 8px 6px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.pc-timer button[aria-pressed="true"] { background: color-mix(in srgb, var(--primary) 14%, transparent); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.pc-send { margin-top: 8px; width: 100%; min-height: 44px; border-radius: 12px; font-weight: 700; }

/* --- сообщение --- */
.msg-bubble--poll { min-width: min(320px, 78vw); }
.pl { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 2px; }
.pl-kind { font-size: 12px; opacity: .75; }
.pl-title { font-size: 16px; font-weight: 700; line-height: 1.3; word-break: break-word; }
.pl-desc { font-size: 13.5px; opacity: .85; white-space: pre-wrap; word-break: break-word; }
.pl-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.pl-opt {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 8px 12px;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, currentColor 5%, transparent); color: inherit; font: inherit; font-size: 14px; text-align: left; cursor: pointer;
  transition: transform .12s ease, border-color .2s, background .2s; animation: plIn .25s ease-out both; animation-delay: calc(var(--i) * 30ms);
}
@keyframes plIn { from { opacity: 0; transform: translateY(4px); } }
.pl-opt:not(:disabled):hover { border-color: color-mix(in srgb, currentColor 35%, transparent); }
.pl-opt:not(:disabled):active { transform: scale(.98); }
.pl-opt:disabled { cursor: default; }
.pl-fill { position: absolute; inset: 0 auto 0 0; width: var(--p); background: color-mix(in srgb, currentColor 14%, transparent); border-radius: inherit; transition: width .55s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.pl-opt.is-mine .pl-fill, .pl-opt.is-top .pl-fill { background: color-mix(in srgb, var(--primary) 28%, transparent); }
.msg.out .pl-opt.is-mine .pl-fill, .msg.out .pl-opt.is-top .pl-fill { background: color-mix(in srgb, #fff 30%, transparent); }
.pl-mark { position: relative; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 45%, transparent); transition: all .18s; }
.pl-mark--box { border-radius: 5px; }
.pl-opt.is-picked .pl-mark, .pl-opt.is-mine .pl-mark { background: var(--primary); border-color: var(--primary); }
.msg.out .pl-opt.is-picked .pl-mark, .msg.out .pl-opt.is-mine .pl-mark { background: #fff; border-color: #fff; }
.pl-opt.is-picked .pl-mark::after, .pl-opt.is-mine .pl-mark::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.msg.out .pl-opt.is-picked .pl-mark::after, .msg.out .pl-opt.is-mine .pl-mark::after { border-color: var(--primary); }
.pl-opt.is-result:not(.is-mine) .pl-mark { opacity: 0; width: 0; flex-basis: 0; margin-right: -10px; border-width: 0; }
.pl-text { position: relative; flex: 1; min-width: 0; word-break: break-word; }
.pl-badge { font-size: 10px; padding: 1px 5px; border-radius: 6px; background: color-mix(in srgb, currentColor 15%, transparent); margin-left: 4px; }
.pl-pct { position: relative; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.pl-voters { position: relative; display: flex; }
.pl-voters i { width: 20px; height: 20px; margin-left: -6px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 700; background: var(--primary); color: #fff; border: 2px solid var(--bg-elevated, #fff); }
.pl-opt.is-correct { border-color: #22c55e; }
.pl-opt.is-correct .pl-fill { background: color-mix(in srgb, #22c55e 30%, transparent) !important; }
.pl-opt.is-correct .pl-mark { opacity: 1 !important; width: 18px !important; flex-basis: 18px !important; margin-right: 0 !important; border-width: 2px !important; background: #22c55e !important; border-color: #22c55e !important; }
.pl-opt.is-correct .pl-mark::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff !important; border-width: 0 2px 2px 0 !important; transform: rotate(45deg); }
.pl-opt.is-wrong { border-color: #ef4444; animation: plShake .35s ease; }
.pl-opt.is-wrong .pl-fill { background: color-mix(in srgb, #ef4444 28%, transparent) !important; }
.pl-opt.is-wrong .pl-mark { background: #ef4444 !important; border-color: #ef4444 !important; }
.pl-opt.is-wrong .pl-mark::after { content: "×" !important; border: 0 !important; transform: none !important; left: 0 !important; top: -3px !important; width: 14px !important; height: 14px !important; color: #fff; font-weight: 800; font-size: 14px; text-align: center; }
@keyframes plShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.pl-verdict { font-weight: 700; font-size: 13px; }
.pl-verdict.is-ok { color: #22c55e; }
.pl-verdict.is-bad { color: #ef4444; }
.msg.out .pl-verdict { color: #fff; }
.pl-explain { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, currentColor 8%, transparent); }
.pl-pending { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-pend { border: 1px dashed color-mix(in srgb, currentColor 35%, transparent); border-radius: 999px; padding: 4px 10px; background: transparent; color: inherit; font: inherit; font-size: 12.5px; cursor: pointer; }
.pl-pend.is-mine { border-style: solid; background: color-mix(in srgb, currentColor 12%, transparent); }
.pl-hint { width: 100%; font-size: 11.5px; opacity: .7; }
.pl-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; font-size: 12.5px; }
.pl-total { opacity: .75; margin-right: auto; }
.pl-act { border: 0; background: transparent; color: inherit; font: inherit; font-size: 12.5px; font-weight: 600; padding: 4px 2px; cursor: pointer; opacity: .9; }
.pl-act:hover { opacity: 1; text-decoration: underline; }
.msg:not(.out) .pl-act { color: var(--primary); }
.pl-act--primary { padding: 6px 12px; border-radius: 999px; background: var(--primary); color: #fff !important; opacity: 1; }
.msg.out .pl-act--primary { background: #fff; color: var(--primary) !important; }
.pl-act--primary:hover { text-decoration: none; filter: brightness(1.05); }
.pl-act--danger { opacity: .7; }
@media (prefers-reduced-motion: reduce) { .pl-opt, .pc-ans { animation: none; } .pl-fill { transition: none; } }
