/* ===== OPROSY / GOLOSOVANIYA: kartochka oprosa v soobschenii + modalka sozdaniya ===== */
/* Palitra kak v lists.css/games.css: --accent, --text, --text-secondary, --border, --bubble-other, --bg. */

.aya-poll-host { display: block; margin: 2px 0; }
.aya-poll {
    box-sizing: border-box;
    max-width: min(360px, 86vw);
    background: var(--bubble-other, #fff);
    border: 1px solid var(--border, rgba(0,56,65,.1));
    border-radius: 16px;
    padding: 12px 12px 12px;
    color: var(--text, #1A1D21);
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.aya-poll-loading { color: var(--text-secondary, #65676B); font-size: 14px; text-align: center; padding: 16px 8px; }

.aya-poll-q { font-weight: 700; font-size: 15px; line-height: 1.3; margin-bottom: 4px; word-break: break-word; }
.aya-poll-meta { font-size: 11px; color: var(--text-secondary, #65676B); margin-bottom: 10px; }

.aya-poll-opts { display: flex; flex-direction: column; gap: 6px; }

/* Variant = knopka s fonovoj polosoj-progressom */
.aya-poll-opt {
    position: relative; display: block; width: 100%; text-align: left;
    appearance: none; cursor: pointer; overflow: hidden;
    border: 1px solid var(--border, rgba(0,56,65,.14)); border-radius: 12px;
    background: var(--bg, #fff); color: var(--text, #1A1D21);
    padding: 0; font-family: inherit;
}
.aya-poll-opt:active { transform: scale(.995); }
.aya-poll-opt[disabled] { cursor: default; opacity: .92; }

.aya-poll-bar {
    position: absolute; left: 0; top: 0; bottom: 0; width: 0;
    background: color-mix(in srgb, var(--accent, #ff8c42) 20%, transparent);
    transition: width .25s ease; z-index: 0;
}
.aya-poll-opt.chosen .aya-poll-bar { background: color-mix(in srgb, var(--accent, #ff8c42) 34%, transparent); }
.aya-poll-opt.chosen { border-color: var(--accent, #ff8c42); }

.aya-poll-opt-row {
    position: relative; z-index: 1; display: flex; align-items: center; gap: 8px;
    padding: 9px 11px; font-size: 14px; line-height: 1.3;
}
.aya-poll-mark { flex: 0 0 auto; font-size: 16px; color: var(--accent, #ff8c42); line-height: 1; }
.aya-poll-opt-text { flex: 1 1 auto; word-break: break-word; }
.aya-poll-pct { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--text-secondary, #65676B); min-width: 34px; text-align: right; }
.aya-poll-n { flex: 0 0 auto; font-size: 11px; color: var(--text-secondary, #65676B); min-width: 16px; text-align: right; }

.aya-poll-voters { font-size: 11px; color: var(--text-secondary, #65676B); padding: 1px 12px 2px; word-break: break-word; }

.aya-poll-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-top: 10px; font-size: 12px; color: var(--text-secondary, #65676B);
}
.aya-poll-total { font-weight: 600; }
.aya-poll-state { font-size: 12px; }
.aya-poll-hint { color: var(--accent, #ff8c42); }

.aya-poll-actions { margin-top: 10px; }
.aya-poll-close-btn {
    appearance: none; width: 100%; border: 1px solid var(--border, rgba(0,56,65,.14)); border-radius: 10px;
    padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
    background: transparent; color: var(--text-secondary, #65676B); font-family: inherit;
}
.aya-poll-close-btn:active { background: var(--border, rgba(0,0,0,.05)); }

.aya-poll-closed .aya-poll-opt { cursor: default; }

/* --- knopka «Опрос» v kompozere (kak list-btn-mobile) --- */
.poll-btn-mobile {
    flex: 0 0 auto; width: 38px; height: 38px; border: none; background: transparent;
    font-size: 20px; line-height: 1; cursor: pointer; padding: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: var(--text, #1A1D21);
}
.poll-btn-mobile:active { background: var(--border, rgba(0,0,0,.06)); }

/* --- modalka sozdaniya oprosa (v duhe aya-list-modal) --- */
.aya-poll-modal-ov { position: fixed; inset: 0; z-index: 4000; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.aya-poll-modal {
    width: 100%; max-width: 480px; box-sizing: border-box;
    background: var(--bg, #fff); color: var(--text, #1A1D21);
    border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgba(0,0,0,.2);
    max-height: 88vh; overflow-y: auto;
}
.aya-poll-modal-title { font-weight: 700; font-size: 16px; text-align: center; margin-bottom: 14px; }

.aya-poll-q-input, .aya-poll-opt-input {
    box-sizing: border-box; width: 100%; font-family: inherit; font-size: 15px;
    border: 1px solid var(--border, rgba(0,56,65,.14)); border-radius: 12px;
    padding: 10px 12px; background: var(--bg, #fff); color: var(--text, #1A1D21);
}
.aya-poll-q-input { resize: none; margin-bottom: 12px; }
.aya-poll-q-input:focus, .aya-poll-opt-input:focus { outline: none; border-color: var(--accent, #ff8c42); }

.aya-poll-opts-edit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.aya-poll-opt-edit { display: flex; align-items: center; gap: 6px; }
.aya-poll-opt-edit .aya-poll-opt-input { flex: 1 1 auto; min-width: 0; }
.aya-poll-del-opt {
    flex: 0 0 auto; appearance: none; border: none; background: transparent; cursor: pointer;
    font-size: 15px; color: var(--text-secondary, #65676B); opacity: .6; padding: 6px 8px;
}
.aya-poll-del-opt:active { opacity: 1; }

.aya-poll-add-opt {
    appearance: none; border: 1px dashed var(--border, rgba(0,56,65,.3)); border-radius: 10px;
    background: transparent; color: var(--accent, #ff8c42); font-weight: 600; font-size: 14px;
    padding: 9px 12px; cursor: pointer; width: 100%; margin-bottom: 12px; font-family: inherit;
}
.aya-poll-add-opt:active { transform: scale(.99); }

.aya-poll-toggle {
    display: flex; align-items: center; gap: 10px; padding: 8px 2px;
    font-size: 15px; color: var(--text, #1A1D21); cursor: pointer;
}
.aya-poll-toggle input { width: 18px; height: 18px; accent-color: var(--accent, #ff8c42); }

.aya-poll-modal-btns { display: flex; gap: 10px; margin-top: 14px; }
.aya-poll-cancel, .aya-poll-create {
    flex: 1 1 0; appearance: none; border: none; border-radius: 12px;
    padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.aya-poll-cancel { background: var(--border, rgba(0,0,0,.06)); color: var(--text, #1A1D21); }
.aya-poll-create { background: var(--accent, #ff8c42); color: #fff; }
.aya-poll-create:disabled { opacity: .6; cursor: default; }
.aya-poll-cancel:active, .aya-poll-create:active { transform: scale(.98); }

/* --- tyomnaya tema --- */
body.dark-theme .aya-poll-opt { background: #1c2530; }
body.dark-theme .aya-poll-modal { background: #161D27; }
body.dark-theme .aya-poll-q-input,
body.dark-theme .aya-poll-opt-input { background: #1c2530; }
body.dark-theme .aya-poll-cancel { background: #222b35; }
