.lhc-poll-widget {
    --lhc-bg: #f6f7f7;
    --lhc-card: #ffffff;
    --lhc-border: #dcdcde;
    --lhc-text: #1d2327;
    --lhc-subtext: #50575e;
    --lhc-primary: #dc2833;
    --lhc-primary-dark: #ad1f28;
    --lhc-success: #008a20;
    --lhc-danger: #d63638;
    --lhc-shadow: 0 12px 32px rgba(15, 23, 42, 0.09);
    color: var(--lhc-text);
    font-family:
        -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    padding: 2vh 0;
}

.lhc-poll-shell,
.lhc-poll-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.lhc-poll-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lhc-poll-title {
    margin: 0;
    padding: 4px 2px;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    font-weight: 800;
    line-height: 1.2;
}

.lhc-poll-grid {
    display: grid;
    grid-template-columns: repeat(var(--lhc-poll-columns, 3), minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.lhc-poll-widget--list .lhc-poll-grid {
    grid-template-columns: 1fr;
    gap: 14px;
}

.lhc-poll-widget--list .lhc-poll-card__body {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) minmax(220px, auto);
    grid-template-areas:
        "media content actions"
        "media result actions";
    column-gap: 16px;
    row-gap: 8px;
    min-height: 0;
    height: auto;
    align-items: center;
}

.lhc-poll-widget--list .lhc-poll-card__media {
    grid-area: media;
    width: 112px;
    height: 112px;
    aspect-ratio: auto;
}

.lhc-poll-widget--list .lhc-poll-card__logo {
    right: 7px;
    bottom: 7px;
    width: 38px;
    height: 38px;
    padding: 4px;
    border-radius: 9px;
}

.lhc-poll-widget--list .lhc-poll-card__content {
    grid-area: content;
    align-self: end;
    padding: 14px 0 0;
}

.lhc-poll-widget--list .lhc-poll-card__desc {
    min-height: 0;
    -webkit-line-clamp: 2;
}

.lhc-poll-widget--list .lhc-poll-card__result {
    grid-area: result;
    align-self: start;
    padding: 0 0 14px;
}

.lhc-poll-widget--list .lhc-poll-card__actions {
    grid-area: actions;
    grid-template-columns: repeat(2, minmax(100px, 1fr));
    align-self: stretch;
    align-content: center;
    min-width: 220px;
    margin: 0;
    padding: 14px 16px 14px 0;
}

.lhc-poll-card {
    min-width: 0;
}

.lhc-poll-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.lhc-poll-card__body {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    background: var(--lhc-card);
    border: 1px solid transparent;
    border-radius: 18px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.06);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.lhc-poll-card:hover .lhc-poll-card__body {
    border-color: rgba(220, 40, 51, 0.35);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.11);
    transform: translateY(-2px);
}

.lhc-poll-card.is-selected .lhc-poll-card__body {
    border-color: var(--lhc-primary);
    box-shadow:
        0 0 0 2px rgba(220, 40, 51, 0.13),
        0 10px 26px rgba(15, 23, 42, 0.1);
}

.lhc-poll-card.is-disabled .lhc-poll-card__body {
    opacity: 0.82;
}

.lhc-poll-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #e7edf5, #f8fafc);
}

.lhc-poll-card__media > img,
.lhc-poll-card__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lhc-poll-card__placeholder {
    background: linear-gradient(135deg, #e7edf5, #f8fafc);
}

.lhc-poll-card__logo {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: grid;
    place-items: center;
    width: 100px;
    height: auto;
    padding: 5px;
    overflow: hidden;
}

.lhc-poll-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.lhc-poll-card__content {
    display: grid;
    gap: 8px;
    padding: 18px 18px 12px;
}

.lhc-poll-card__title {
    margin: 0;
    color: var(--lhc-text);
    font-size: 1.1rem;
    font-weight: 750;
    line-height: 1.3;
}

.lhc-poll-card__desc {
    display: -webkit-box;
    min-height: 4.2em;
    margin: 0;
    overflow: hidden;
    color: var(--lhc-subtext);
    font-size: 0.92rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.lhc-poll-card__result {
    position: relative;
    display: grid;
    gap: 7px;
    padding: 0 18px 12px;
}

.lhc-poll-bar {
    height: 8px;
    overflow: hidden;
    background: rgba(120, 120, 128, 0.18);
    border-radius: 999px;
}

.lhc-poll-bar__fill {
    display: block;
    width: 0;
    height: 100%;
    background: #dc2833;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.lhc-poll-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 16px;
    color: var(--lhc-subtext);
    font-size: 0.78rem;
}

.lhc-poll-card__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto;
    padding: 4px 18px 18px;
}

.lhc-poll-button,
.lhc-poll-submit {
    min-height: 42px;
    border: 1px solid var(--lhc-border);
    border-radius: 10px;
    padding: 9px 14px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.lhc-poll-details {
    background: #ffffff;
    color: var(--lhc-text);
}

.lhc-poll-details:hover {
    border-color: var(--lhc-text);
    background: #f7f7f8;
}

.lhc-poll-vote,
.lhc-poll-submit {
    border-color: var(--lhc-primary);
    background: var(--lhc-primary);
    color: #ffffff;
}

.lhc-poll-vote:hover,
.lhc-poll-submit:hover {
    border-color: var(--lhc-primary-dark);
    background: var(--lhc-primary-dark);
    transform: translateY(-1px);
}

.lhc-poll-card.is-selected .lhc-poll-vote {
    border-color: var(--lhc-success);
    background: var(--lhc-success);
}

.lhc-poll-button:focus-visible,
.lhc-poll-submit:focus-visible,
.lhc-poll-modal__close:focus-visible {
    outline: 3px solid rgba(34, 113, 177, 0.35);
    outline-offset: 2px;
}

.lhc-poll-button:disabled,
.lhc-poll-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.lhc-poll-button[hidden],
.lhc-poll-submit[hidden],
.lhc-poll-ended[hidden],
.lhc-poll-modal[hidden] {
    display: none;
}

.lhc-poll-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.lhc-poll-submit {
    min-width: 180px;
    border-radius: 999px;
}

.lhc-poll-notice {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--lhc-border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--lhc-subtext);
    padding: 10px 13px;
    font-size: 0.88rem;
}

.lhc-poll-notice.is-empty {
    display: none;
}

.lhc-poll-notice.is-error {
    color: var(--lhc-danger);
}

.lhc-poll-notice.is-success {
    color: var(--lhc-success);
}

.lhc-poll-ended {
    display: grid;
    gap: 6px;
    border: 1px solid rgba(214, 54, 56, 0.2);
    border-left: 6px solid var(--lhc-danger);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(214, 54, 56, 0.08), #ffffff 70%);
    box-shadow: 0 8px 16px rgba(214, 54, 56, 0.08);
    padding: 16px 18px;
}

.lhc-poll-ended__title {
    color: var(--lhc-danger);
    font-size: 1rem;
    font-weight: 700;
}

.lhc-poll-ended__text {
    color: var(--lhc-subtext);
    font-size: 0.95rem;
}

.lhc-poll-widget.is-results-hidden .lhc-poll-card__result {
    display: none;
}

.lhc-poll-widget.is-loading .lhc-poll-form {
    pointer-events: none;
    opacity: 0.85;
}

.lhc-poll-widget.is-loading .lhc-poll-bar,
.lhc-poll-widget.is-loading .lhc-poll-stats {
    opacity: 0;
}

.lhc-poll-widget.is-loading .lhc-poll-skel {
    display: block;
}

.lhc-poll-skel {
    position: absolute;
    right: 18px;
    left: 18px;
    display: none;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        rgba(220, 220, 222, 0.6),
        rgba(205, 205, 209, 0.9),
        rgba(220, 220, 222, 0.6)
    );
    animation: lhc-shimmer 1.2s infinite;
}

.lhc-poll-skel--bar {
    top: 0;
}

.lhc-poll-skel--text {
    top: 15px;
    width: 55%;
    height: 12px;
}

body.lhc-poll-modal-open {
    overflow: hidden;
}

.lhc-poll-modal {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.lhc-poll-modal__backdrop {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: default;
}

.lhc-poll-modal__panel {
    position: relative;
    z-index: 1;
    width: min(860px, 100%);
    max-height: min(88vh, 900px);
    overflow: auto;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.lhc-poll-modal__header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    background: #f5f5f5;
    padding: 18px 20px;
}

.lhc-poll-modal__identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.lhc-poll-modal__logo {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border: 1px solid var(--lhc-border);
    border-radius: 12px;
    background: #ffffff;
    padding: 7px;
    box-sizing: border-box;
}

.lhc-poll-modal__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lhc-poll-modal__heading {
    min-width: 0;
    padding: 5px 0 5px 14px;
}

.lhc-poll-modal__title {
    font-weight: 900;
    margin: 0;
    color: #dc2833;
    font-size: clamp(1.3rem, 2vw, 1.5rem);
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.lhc-poll-modal__close {
    display: grid;
    flex: 0 0 38px;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--lhc-border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--lhc-text);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.lhc-poll-modal__content {
    color: var(--lhc-text);
    padding: 22px;
    font-size: 1.2rem;
    line-height: 1.65;
}

.lhc-poll-modal__content > :first-child {
    margin-top: 0;
}

.lhc-poll-modal__content > :last-child {
    margin-bottom: 0;
}

.lhc-poll-modal__content img,
.lhc-poll-modal__content video,
.lhc-poll-modal__content iframe {
    max-width: 100%;
}

.lhc-poll-modal__content iframe {
    width: 100%;
    min-height: 320px;
    border: 0;
}

@keyframes lhc-shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: 200px 0;
    }
}

@media (max-width: 640px) {
    .lhc-poll-widget {
        border-radius: 14px;
        padding: 14px;
    }

    .lhc-poll-grid {
        grid-template-columns: 1fr;
    }

    .lhc-poll-card__actions {
        grid-template-columns: 1fr;
    }

    .lhc-poll-widget--list .lhc-poll-card__body {
        grid-template-columns: 84px minmax(0, 1fr);
        grid-template-areas:
            "media content"
            "result result"
            "actions actions";
    }

    .lhc-poll-widget--list .lhc-poll-card__media {
        width: 84px;
        height: 84px;
    }

    .lhc-poll-widget--list .lhc-poll-card__content {
        align-self: center;
        padding: 12px 12px 12px 0;
    }

    .lhc-poll-widget--list .lhc-poll-card__result {
        padding: 0 12px;
    }

    .lhc-poll-widget--list .lhc-poll-card__actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
        padding: 6px 12px 12px;
    }

    .lhc-poll-modal {
        align-items: end;
        padding: 0;
    }

    .lhc-poll-modal__panel {
        width: 100%;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
    }

    .lhc-poll-modal__header,
    .lhc-poll-modal__content {
        padding: 16px;
    }

    .lhc-poll-modal__content iframe {
        min-height: 210px;
    }
}

@media (max-width: 900px) and (min-width: 641px) {
    .lhc-poll-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lhc-poll-widget--list .lhc-poll-grid {
        grid-template-columns: 1fr;
    }

    .lhc-poll-widget--list .lhc-poll-card__body {
        grid-template-columns: 96px minmax(0, 1fr);
        grid-template-areas:
            "media content"
            "result result"
            "actions actions";
    }

    .lhc-poll-widget--list .lhc-poll-card__media {
        width: 96px;
        height: 96px;
    }

    .lhc-poll-widget--list .lhc-poll-card__content {
        align-self: center;
        padding: 14px 14px 14px 0;
    }

    .lhc-poll-widget--list .lhc-poll-card__result {
        padding: 0 14px;
    }

    .lhc-poll-widget--list .lhc-poll-card__actions {
        min-width: 0;
        padding: 6px 14px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lhc-poll-card__body,
    .lhc-poll-button,
    .lhc-poll-submit,
    .lhc-poll-bar__fill {
        transition: none;
    }

    .lhc-poll-skel {
        animation: none;
    }
}
