/* =============================================================
   Communities Surveys — styling for:
     • CustomFieldFormRenderer (shared renderer, edit + read-only)
     • CreateSurveyWizard + WizardStep* + WizardListOptionsEditor
     • SurveyPost feed card (with PreviewMode) — includes the answered-state
       expander panel (compact badge + collapse/expand + skeleton shimmer)
     • SurveyPost inline fill/view panel (replaced the fill-in modal 2026-04-21)

   All colors respect the Communities CSS-variable contract:
     --community-primary, --community-accent  (per-community branding)
     --text-primary (#1f2937), --text-secondary (#4B5563)  (WCAG AA fixed)

   Touch targets ≥ 44px where interactive. Focus outlines preserved.
   ============================================================= */

/* --------- shared field renderer --------- */
.cf-field-group {
    margin: 0 0 1.25rem 0;
    padding: 0;
}

.cf-field-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.cf-required {
    color: #dc2626;
    margin-left: 0.25rem;
}

.cf-field-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 0 0.5rem 0;
}

.cf-input,
.cf-textarea,
.cf-select {
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
}

.cf-textarea {
    min-height: 88px;
    resize: vertical;
    font-family: inherit;
}

.cf-input:focus,
.cf-textarea:focus,
.cf-select:focus {
    outline: 2px solid var(--community-primary, #2563eb);
    outline-offset: 2px;
    border-color: var(--community-primary, #2563eb);
}

.cf-input.has-error,
.cf-textarea.has-error,
.cf-select.has-error {
    border-color: #dc2626;
}

.cf-field-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.cf-radio-group,
.cf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cf-radio-option,
.cf-checkbox-option,
.cf-toggle-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
    min-height: 44px;
    cursor: pointer;
    color: var(--text-primary);
}

.cf-radio-option input,
.cf-checkbox-option input,
.cf-toggle-option input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cf-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cf-chip {
    padding: 0.5rem 1rem;
    min-height: 44px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: var(--text-primary);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9375rem;
}

.cf-chip.selected {
    background: var(--community-primary, #2563eb);
    color: #ffffff;
    border-color: var(--community-primary, #2563eb);
}

.cf-chip:focus {
    outline: 2px solid var(--community-primary, #2563eb);
    outline-offset: 2px;
}

.cf-rating {
    display: flex;
    gap: 0.25rem;
}

.cf-star {
    background: none;
    border: 0;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.5rem;
    color: #d1d5db;
    cursor: pointer;
}

.cf-star.filled {
    color: var(--community-accent, #f59e0b);
}

.cf-star:focus {
    outline: 2px solid var(--community-primary, #2563eb);
    outline-offset: 2px;
}

.cf-file-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    padding: 0.75rem;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
}

/* Read-only variants */
.cf-readonly .cf-readonly-value {
    color: var(--text-primary);
    background: #f9fafb;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    min-height: 2.25rem;
}

.cf-readonly-longtext {
    white-space: pre-wrap;
}

.cf-readonly-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.cf-readonly-pill {
    padding: 0.25rem 0.75rem;
    background: var(--community-primary, #2563eb);
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.875rem;
}

/* --------- wizard shell --------- */
/* Namespaced on .srv-modal-overlay to avoid colliding with the global modals.css
   .modal-overlay class (which is display:none by default and only visible when
   a .active class is toggled on). */
.srv-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.survey-wizard-modal {
    background: #ffffff;
    border-radius: 12px;
    width: min(640px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.survey-wizard-modal .srv-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.survey-wizard-modal .srv-modal-header h2 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.srv-modal-close-btn {
    background: none;
    border: 0;
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
}

.srv-modal-close-btn:hover,
.srv-modal-close-btn:focus {
    background: #f3f4f6;
    outline: 2px solid var(--community-primary, #2563eb);
    outline-offset: 2px;
}

.survey-wizard-modal .srv-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

.survey-wizard-modal .srv-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.wizard-error,
.srv-modal-error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
}

/* wizard steps */
.wizard-step {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wizard-step-heading {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.wizard-step-subtitle {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9375rem;
}

.wizard-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.wizard-field-label {
    font-weight: 600;
    color: var(--text-primary);
}

.wizard-input,
.wizard-textarea,
.wizard-select {
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    color: var(--text-primary);
}

.wizard-textarea {
    min-height: 66px;
    resize: vertical;
    font-family: inherit;
}

.wizard-input:focus,
.wizard-textarea:focus,
.wizard-select:focus {
    outline: 2px solid var(--community-primary, #2563eb);
    outline-offset: 2px;
    border-color: var(--community-primary, #2563eb);
}

.wizard-field-toggle {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.wizard-toggle-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    cursor: pointer;
    color: var(--text-primary);
}

.wizard-helper {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* Options editor (list types) */
.wizard-options-editor {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.wizard-options-heading {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.wizard-option-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-option-remove {
    background: none;
    border: 0;
    width: 44px;
    height: 44px;
    color: #dc2626;
    cursor: pointer;
    border-radius: 6px;
}

.wizard-option-remove:hover:not(:disabled),
.wizard-option-remove:focus {
    background: #fef2f2;
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.wizard-option-remove:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.wizard-option-add {
    align-self: flex-start;
    background: transparent;
    border: 1px dashed var(--community-primary, #2563eb);
    color: var(--community-primary, #2563eb);
    padding: 0.5rem 1rem;
    min-height: 44px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-option-add:hover,
.wizard-option-add:focus {
    background: var(--community-primary, #2563eb);
    color: #ffffff;
    outline: none;
}

.wizard-validation {
    color: #dc2626;
    font-size: 0.875rem;
    margin: 0;
}

.wizard-preview-container {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    background: #f9fafb;
}

/* --------- survey post (feed card) --------- */
.post.survey-post {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.survey-post .post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.survey-post .post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.survey-post .post-author-info {
    display: flex;
    flex-direction: column;
}

.survey-post .post-author-name {
    font-weight: 600;
    color: var(--text-primary);
}

.survey-post .post-timeago {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.survey-post .post-delete-btn {
    background: none;
    border: 0;
    width: 44px;
    height: 44px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
}

.survey-post .post-delete-btn:hover,
.survey-post .post-delete-btn:focus {
    background: #f3f4f6;
    color: #dc2626;
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.survey-post-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.survey-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: color-mix(in srgb, var(--community-primary, #2563eb) 15%, #ffffff);
    color: var(--community-primary, #2563eb);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    align-self: flex-start;
}

.survey-card-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.survey-card-meta {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* --------- shared button base (in case the project doesn't already have one) --------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    min-height: 44px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--community-primary, #2563eb);
    color: #ffffff;
    border-color: var(--community-primary, #2563eb);
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus {
    filter: brightness(0.9);
    outline: 2px solid var(--community-primary, #2563eb);
    outline-offset: 2px;
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border-color: #d1d5db;
}

.btn-secondary:hover:not(:disabled),
.btn-secondary:focus {
    background: #f3f4f6;
    outline: 2px solid var(--community-primary, #2563eb);
    outline-offset: 2px;
}

/* --------- comment-input poll icon --------- */
.comment-poll-btn {
    background: none;
    border: 0;
    width: 44px;
    height: 44px;
    color: var(--community-primary, #2563eb);
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.comment-poll-btn:hover:not(:disabled),
.comment-poll-btn:focus {
    background: color-mix(in srgb, var(--community-primary, #2563eb) 10%, #ffffff);
    outline: 2px solid var(--community-primary, #2563eb);
    outline-offset: 2px;
}

.comment-poll-btn:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

/* --------- survey own-answers card --------- */
.survey-own-answers {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.survey-own-answers-heading {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 600;
}

.survey-answers-loading,
.srv-modal-loading {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    color: var(--community-primary, #2563eb);
    font-size: 1.25rem;
}

/* --------- visually-hidden (repeats project-wide pattern, scoped-safe) --------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =============================================================
   Poll detail page (/poll/{id}) — thin wrapper; body styled via FeedItemRenderer.
   Alias of the .single-post-container shape in feed.css.
   ============================================================= */
.poll-detail-container {
    width: 100%;
}

.poll-detail-container .post {
    margin-bottom: 0;
}

.poll-detail-loading {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

/* =============================================================
   Inline poll panel — SurveyPost's Edit/View modes.
   Always expanded by default; user can manually collapse via the chevron.
   On successful submit the panel swaps mode in place (Edit → View-only)
   with a one-shot pulse via .is-just-submitted.
   ============================================================= */

/* Header row: poll badge on the left, collapse chevron on the right */
.survey-card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.survey-collapse-toggle {
    width: 44px;                           /* WCAG 2.1 AA — 44×44 touch target */
    height: 44px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary, #4B5563); /* CLAUDE.md §CSS Variables */
    transition: background 0.15s, border-color 0.15s;
    flex: 0 0 auto;
}

.survey-collapse-toggle:hover,
.survey-collapse-toggle:focus-visible {
    background: #f3f4f6;
    border-color: #e5e7eb;
    outline: none;
}

.survey-collapse-toggle:focus-visible {
    outline: 2px solid var(--community-primary, #2563eb);
    outline-offset: 2px;
}

.survey-collapse-toggle i.rotated {
    transform: rotate(180deg);
    transition: transform 0.2s ease;
}

/* Panel shell — wraps both Edit and View modes */
.survey-panel {
    margin-top: 0.75rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.survey-panel.is-edit-mode {
    background: #fafafa;
}

.survey-panel.is-view-mode {
    background: #f5faf5;                   /* subtle green tint differentiates read-only */
    border-color: #d1e7d7;
}

.survey-panel.is-just-submitted {
    border-color: var(--community-primary, #2563eb);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--community-primary, #2563eb) 20%, transparent);
    animation: survey-panel-pulse 1.2s ease-out 1;
}

@keyframes survey-panel-pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--community-primary, #2563eb) 45%, transparent); }
    70%  { box-shadow: 0 0 0 12px color-mix(in srgb, var(--community-primary, #2563eb) 0%, transparent); }
    100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--community-primary, #2563eb) 20%, transparent); }
}

/* Submit action row — Edit mode only */
.survey-fill-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.survey-fill-actions .btn {
    min-height: 44px;
}

.survey-fill-error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin: 0;
    font-size: 0.875rem;
}

/* Defensive empty state (non-preview, hydration failed / no questions) */
.survey-panel-empty {
    color: var(--text-secondary, #4B5563);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

/* --------- reduced motion --------- */
@media (prefers-reduced-motion: reduce) {
    .fa-spin {
        animation: none !important;
    }
    .survey-panel,
    .survey-collapse-toggle,
    .survey-collapse-toggle i.rotated {
        transition: none !important;
    }
    .survey-panel.is-just-submitted {
        animation: none !important;
    }
}

/* =============================================================
   Inline poll card rendered inside a comment thread (SurveyCommentPost).
   Intentionally lighter than .survey-panel — no filled background, no
   heavy border, a 2px left rule in the community accent color signals
   "this is a poll" without stealing visual weight from sibling text
   comments. View mode switches the rule to dashed (communicating
   "read-only" without relying on color contrast alone).
   ============================================================= */
.survey-comment-post {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.25rem 0;
    padding: 0.5rem 0.75rem;
    border-left: 2px solid var(--community-primary, #0b65d8);
    background: transparent;
}

.survey-comment-post.is-view-mode {
    border-left-style: dashed;
}

.survey-comment-post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.survey-comment-post-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #4B5563);
    font-weight: 500;
}

.survey-comment-post-badge i {
    color: var(--community-primary, #0b65d8);
}

.survey-comment-post-submitted {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #166534; /* green 800 — AAA on white at 7.2:1 */
    animation: survey-comment-post-chip-fade 3s linear 1 forwards;
}

@keyframes survey-comment-post-chip-fade {
    0%   { opacity: 1; }
    90%  { opacity: 1; }
    100% { opacity: 0; }
}

.survey-comment-post-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    line-height: 1.3;
}

.survey-comment-post-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.survey-comment-post-submit {
    min-height: 44px; /* WCAG touch target */
    min-width: 44px;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
}

.survey-comment-post-error {
    color: #b91c1c;
    font-size: 0.85rem;
    margin: 0;
}

.survey-comment-post-empty {
    color: var(--text-secondary, #4B5563);
    font-size: 0.85rem;
    font-style: italic;
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    .survey-comment-post-submitted {
        animation: none;
        opacity: 1;
    }
}

/* =============================================================
   Poll detail page breadcrumb — "Replying to …" link shown above the
   FeedItemRenderer on /poll/{id} when the poll is a comment (Plan 170).
   ============================================================= */
.poll-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #4B5563);
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.15s;
}

.poll-breadcrumb:hover,
.poll-breadcrumb:focus-visible {
    background: #f3f4f6;
    color: var(--text-primary, #1f2937);
    outline: none;
}

.poll-breadcrumb-icon {
    color: var(--community-primary, #0b65d8);
}

.poll-breadcrumb-deleted {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* =============================================================
   Plan 171 — Poll wizard Mode step (Create new vs Pick existing).
   Two card-style option buttons; clicking either commits the choice
   and advances. Only rendered in event-bound communities.
   ============================================================= */
.wizard-mode-picker {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem 0;
}

.wizard-mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .wizard-mode-options {
        grid-template-columns: 1fr; /* stack on narrow viewports */
    }
}

.wizard-mode-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 1rem;
    min-height: 44px; /* WCAG touch target */
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}

.wizard-mode-option:hover,
.wizard-mode-option:focus-visible {
    border-color: var(--community-primary, #0b65d8);
    background: #f3f4f6;
    outline: none;
}

.wizard-mode-option-icon {
    font-size: 1.4rem;
    color: var(--community-primary, #0b65d8);
    margin-bottom: 0.25rem;
}

.wizard-mode-option-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.wizard-mode-option-description {
    font-size: 0.85rem;
    color: var(--text-secondary, #4B5563);
    line-height: 1.3;
}

/* =============================================================
   Plan 171 — Poll wizard Pick step (searchable list of event surveys).
   ============================================================= */
.wizard-poll-picker {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.wizard-poll-picker-search {
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-family: inherit;
}

.wizard-poll-picker-search:focus-visible {
    outline: 2px solid var(--community-primary, #0b65d8);
    outline-offset: 2px;
}

.wizard-poll-picker-loading,
.wizard-poll-picker-empty,
.wizard-poll-picker-error {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary, #4B5563);
    font-size: 0.9rem;
}

.wizard-poll-picker-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.wizard-poll-picker-error { color: #b91c1c; }

.wizard-poll-picker-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;       /* cap height; internal scroll for long lists */
    overflow-y: auto;
}

.wizard-poll-picker-row-item { margin: 0; padding: 0; }

.wizard-poll-picker-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.6rem 0.75rem;
    min-height: 44px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}

.wizard-poll-picker-row:hover,
.wizard-poll-picker-row:focus-visible {
    border-color: var(--community-primary, #0b65d8);
    background: #f3f4f6;
    outline: none;
}

.wizard-poll-picker-row:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.wizard-poll-picker-row-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wizard-poll-picker-row-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.wizard-poll-picker-badge-answered {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #166534;           /* 7.2:1 on white — AAA */
    background: #dcfce7;
    padding: 0.15rem 0.4rem;
    border-radius: 12px;
}

.wizard-poll-picker-row-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #4B5563);
    flex-wrap: wrap;
}

@media (prefers-reduced-motion: reduce) {
    .wizard-mode-option,
    .wizard-poll-picker-row {
        transition: none;
    }
}
