/*
 * TBV Awards voting board frontend styles.
 * Conference Awards Voting v0.12.0+
 *
 * Visual card design should still be controlled primarily in the Elementor
 * TBV Vote Card Loop Item. These styles handle voting behavior, layout,
 * verification panels, ranking states and the confirmation dialog.
 */

:root {
    --vote-first: #d4af37;
    --vote-second: #a7adb4;
    --vote-third: #b87333;

    --vote-first-soft:
        color-mix(in srgb,
            var(--vote-first) 16%,
            white);

    --vote-second-soft:
        color-mix(in srgb,
            var(--vote-second) 18%,
            white);

    --vote-third-soft:
        color-mix(in srgb,
            var(--vote-third) 16%,
            white);

    --vote-return-speed: 180ms;

    /* Desktop voting layout tuning */
    --vote-sidebar-width: 300px;
    --vote-layout-gap: 28px;
    --vote-sticky-top: 24px;
    --vote-organization-color: #111111;

    /* Voter access banner tuning */
    --vote-access-bg: #F4F5FA;
    --vote-access-text: #20252d;
    --vote-access-muted: #59616c;
    --vote-access-accent: #075b96;
    --vote-banner-bg: var(--vote-access-bg);
    --vote-banner-overlay: rgba(244, 245, 250, 0.94);
    --vote-banner-text: var(--vote-access-text);
    --vote-banner-radius: 16px;

    /* Elementor-managed empty podium marker */
    --vote-slot-marker-bg: #e5e7eb;
    --vote-slot-marker-border: #b8bec7;
    --vote-slot-marker-text: #59616c;

    /* Visible top-level page-section striping */
    --tbv-section-white: #ffffff;
    --tbv-section-offwhite: #F4F5FA;

    /* Completed-ballot state */
    --tbv-success-accent: #075b96;
    --tbv-success-bg: #F4F5FA;

    /* Own-organization lockout styling */
    --vote-locked: #6b7280;
    --vote-locked-soft:
        color-mix(
            in srgb,
            var(--vote-locked) 10%,
            white
        );
}

.rank-first {
    --rank-color: var(--vote-first);
    --rank-soft: var(--vote-first-soft);
}

.rank-second {
    --rank-color: var(--vote-second);
    --rank-soft: var(--vote-second-soft);
}

.rank-third {
    --rank-color: var(--vote-third);
    --rank-soft: var(--vote-third-soft);
}

/*
* ==============================
* VISIBLE PAGE-SECTION STRIPING
* ==============================
* Add `tbv-page-section` to each OUTERMOST Elementor page section that should
* participate. JavaScript numbers only the sections that are actually visible,
* so hidden seasonal sections do not break the white/off-white alternation.
*/

.tbv-page-section.tbv-section--white {
    background-color: var(--tbv-section-white) !important;
}

.tbv-page-section.tbv-section--offwhite {
    background-color: var(--tbv-section-offwhite) !important;
}

/*
* ==============================
* DESKTOP VOTING LAYOUT
* ==============================
* Elementor setup:
* - common parent: voting-layout
* - left child:    voting-sidebar
* - right child:   voting-cards-column
*
* The sticky sidebar remains constrained by the height of
* voting-layout, so it follows the card list and then stops
* when that whole voting area ends.
*/

.voting-layout {
    display: grid !important;
    grid-template-columns:
        minmax(240px, var(--vote-sidebar-width))
        minmax(0, 1fr);
    gap: var(--vote-layout-gap);
    align-items: start;
    overflow: visible !important;
}

.voting-sidebar {
    position: sticky;
    top: var(--vote-sticky-top);
    align-self: start;
    min-width: 0;
    z-index: 20;
}

.voting-sidebar .ranking-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.voting-cards-column {
    min-width: 0;
    overflow: visible !important;
}

/*
 * Design-selectable desktop podium placement. The side mode preserves the
 * original sticky sidebar. Top mode places the three rank slots in one row
 * above the Award Entry cards while keeping non-slot controls full width.
 */
.voting-layout.tbv-podium-layout--side {
    grid-template-columns:
        minmax(240px, var(--vote-sidebar-width))
        minmax(0, 1fr);
}

.voting-layout.tbv-podium-layout--top {
    grid-template-columns: minmax(0, 1fr);
}

.voting-layout.tbv-podium-layout--top .voting-sidebar {
    position: static;
    top: auto;
    width: 100%;
}

.voting-layout.tbv-podium-layout--top .voting-sidebar .ranking-area {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.voting-layout.tbv-podium-layout--top .ranking-area > :not(.rank-slot) {
    grid-column: 1 / -1;
}

/*
* ==============================
* VOTER ACCESS BANNER / FORM
* ==============================
* Optional Elementor setup:
* wrap the [tbv_voter_login] Shortcode widget in a container
* with class `voter-banner`, then set any background image on
* that Elementor container. The semi-transparent panel below
* becomes the readable overlay.
*/

.voter-banner {
    background-size: cover;
    background-position: center;
    border-radius: var(--vote-banner-radius);
    margin-bottom: 26px;
}


/*
 * Scroll-in animation for the complete Elementor voter banner.
 * This animates the shortcode and its sibling image container together.
 * JavaScript adds tbv-banner-animate only when enhancement is available.
 */
.voter-banner.tbv-banner-animate {
    opacity: 0;
    transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity;
}

/*
 * Add the class `voter-banner__images` to the Elementor Images container.
 * It enters FROM THE LEFT while the rest of the banner simply fades in.
 */
.voter-banner.tbv-banner-animate .voter-banner__images {
    opacity: 0;
    transform: translateX(-36px);
    transition:
        opacity 620ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.voter-banner.tbv-banner-animate.is-visible {
    opacity: 1;
    will-change: auto;
}

.voter-banner.tbv-banner-animate.is-visible .voter-banner__images {
    opacity: 1;
    transform: translateX(0);
    will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
    .voter-banner.tbv-banner-animate,
    .voter-banner.tbv-banner-animate.is-visible,
    .voter-banner.tbv-banner-animate .voter-banner__images,
    .voter-banner.tbv-banner-animate.is-visible .voter-banner__images {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.tbv-voter-access__verified {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: 24px 28px;
    border-radius: var(--vote-banner-radius);
    background:
        linear-gradient(var(--vote-banner-overlay), var(--vote-banner-overlay)),
        var(--vote-banner-bg);
    color: var(--vote-banner-text);
}

.voter-banner .tbv-voter-access__verified {
    border-radius: var(--vote-banner-radius);
}

.tbv-voter-access__year {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--vote-access-accent);
    opacity: 1;
    margin-bottom: 4px;
}

.tbv-voter-access__welcome {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.15;
    margin-bottom: 6px;
}

.tbv-voter-access__welcome-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    opacity: 0.82;
}

.tbv-voter-access__welcome-name {
    display: block;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 750;
    line-height: 1.1;
}

.tbv-voter-access__email,
.tbv-voter-access__organization {
    font-size: 0.92rem;
    line-height: 1.4;
}

.tbv-voter-access__ballot-status {
    display: inline-flex;
    align-items: center;
    column-gap: 0.32em;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(7, 91, 150, 0.16);
    background: #ffffff;
    color: var(--vote-access-text);
    font-size: 0.85rem;
}

.tbv-voter-access__logout-button,
.tbv-voter-access__submit {
    appearance: none;
    border: 1px solid rgba(255,255,255,0.75);
    border-radius: 9px;
    padding: 11px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tbv-voter-access__verified .tbv-voter-access__logout-button {
    border-color: var(--vote-access-accent);
    color: #ffffff;
    background: var(--vote-access-accent);
}

.tbv-voter-access__register-panel,
.tbv-voter-access__code-panel,
.tbv-voter-access__closed {
    padding: 22px 24px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: var(--vote-banner-radius);
    background: var(--vote-access-bg);
    color: var(--vote-access-text);
}

.tbv-voter-access__register-panel h3,
.tbv-voter-access__code-panel h3 {
    margin: 2px 0 6px;
}

.tbv-voter-access__register-panel > p,
.tbv-voter-access__code-panel > p {
    margin: 0 0 16px;
}

.tbv-voter-access__form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.tbv-voter-access__organization-form {
    display: grid;
    grid-template-columns: minmax(0, 360px);
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.tbv-voter-access__profile-panel > .tbv-voter-access__logout {
    margin-top: 12px;
}

.tbv-voter-access__form > .tbv-voter-access__submit {
    grid-column: auto;
    justify-self: start;
    max-width: 100%;
    white-space: normal;
}

.tbv-voter-access__form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
}

.tbv-voter-access__form-actions .tbv-voter-access__submit {
    max-width: 100%;
    white-space: normal;
}

.tbv-voter-access__field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.tbv-voter-access__field label,
.tbv-voter-access__code-form label {
    font-size: 0.85rem;
    font-weight: 700;
}

.tbv-voter-access__field input,
.tbv-voter-access__field select,
.tbv-voter-access__code-form input {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    border: 1px solid rgba(0,0,0,0.22);
    border-radius: 8px;
    padding: 9px 11px;
    font: inherit;
    background: #ffffff;
    color: #111111;
}

.tbv-voter-access__register-panel .tbv-voter-access__submit,
.tbv-voter-access__code-panel .tbv-voter-access__submit {
    border-color: transparent;
    background: var(--vote-access-accent);
    color: #ffffff;
    min-height: 44px;
}

.tbv-voter-access__code-form {
    display: grid;
    grid-template-columns: minmax(180px, 260px) auto;
    align-items: end;
    gap: 12px;
}

.tbv-voter-access__code-form label {
    grid-column: 1 / -1;
}

.tbv-voter-access__notice {
    margin-bottom: 10px;
    font-weight: 600;
}

.tbv-access-request-error {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid #b42318;
    border-radius: 8px;
    background: #fff5f5;
    color: #8a1c13;
    font-weight: 650;
}

[aria-busy="true"] .tbv-elementor-access__submit,
[aria-busy="true"] .tbv-voter-access__submit {
    cursor: wait;
    opacity: 0.68;
}

/*
 * Elementor Post Terms may render the Organization as a link.
 * Force it to inherit our intended text colour rather than
 * the site's global blue link colour.
 */
.vote-card__hospital,
.vote-card__hospital a,
.vote-card__hospital * {
    color: var(--vote-organization-color) !important;
}

.vote-card__hospital a {
    text-decoration: none !important;
}

/*
* ==============================
* SUBMIT BUTTON
* ==============================
*/

#submit-votes[aria-disabled="true"] {
    opacity: 0.4;
    cursor: not-allowed;
}

#submit-votes[aria-disabled="false"] {
    opacity: 1;
    cursor: pointer;
}

/*
* ==============================
* COMPACT LOOP CARD TEXT
* ==============================
* Keeps long titles and organization names readable in a four-column grid.
* Elementor remains in charge of the overall card design.
*/
.vote-card-item,
.vote-card-item .vote-card,
.vote-card-item .vote-card__content,
.vote-card-item .vote-card__title,
.vote-card-item .vote-card__hospital {
    min-width: 0;
    max-width: 100%;
}

.vote-card-item .vote-card__content {
    width: 100%;
}

.vote-card-item .vote-card__title,
.vote-card-item .vote-card__title *,
.vote-card-item .vote-card__hospital,
.vote-card-item .vote-card__hospital * {
    box-sizing: border-box;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

.vote-card-item .vote-card__title,
.vote-card-item .vote-card__title .elementor-heading-title {
    margin: 0 !important;
    font-size: clamp(0.9rem, 1.15vw, 1.05rem) !important;
    line-height: 1.15 !important;
}

.vote-card-item .vote-card__hospital,
.vote-card-item .vote-card__hospital * {
    font-size: clamp(0.72rem, 0.9vw, 0.82rem) !important;
    line-height: 1.28 !important;
}


/* 0.16.28: click-to-rank feature is paused. Keep Elementor-built controls available in the template but hidden on the live voting board. */
.tbv-rank-controls,
#tbv-sticky-ballot,
.tbv-sticky-ballot {
    display: none !important;
}

/*
* ==============================
* ELEMENTOR RANK HOOKS + STICKY BALLOT
* ==============================
* The per-card rank controls are styled entirely in Elementor.
* This rule only keeps the card's rank-control container out of the podium.
*/

/* Functional affordance only. Elementor remains in control of visual styling. */
.tbv-rank-first,
.tbv-rank-second,
.tbv-rank-third {
    cursor: pointer;
}

.ranking-area .tbv-rank-controls,
.rank-slot .tbv-rank-controls {
    display: none !important;
}

.tbv-rank-controls--podium-visible {
    display: none !important;
}

.tbv-sticky-ballot {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 99990;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(8px);
}

.tbv-sticky-ballot__title {
    margin: 0 2px 0 4px;
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 750;
}

.tbv-sticky-ballot button {
    min-height: 34px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 999px;
    background: #ffffff;
    color: inherit;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.tbv-sticky-ballot__rank {
    min-width: 52px;
    padding: 7px 10px;
}

.tbv-sticky-ballot__rank.is-filled {
    border-color: currentColor;
}

.tbv-sticky-ballot__view {
    padding: 7px 12px;
}

.tbv-sticky-ballot button:hover,
.tbv-sticky-ballot button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

/*
* ==============================
* DRAGGING
* ==============================
*/

.vote-card-item {
    cursor: grab;
    touch-action: none;
    user-select: none;
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
}

/*
 * Let the visual Elementor card fill its Loop Item wrapper.
 * The actual look of the card should still be styled in the
 * TBV Vote Card Loop Item template.
 */
.vote-card-item > .vote-card {
    width: 100%;
    height: 100%;
}

/*
 * Elementor's Loop Grid adds its own inner container.
 * Keep it from clipping a card while that card is dragged.
 */
.elementor-loop-container {
    overflow: visible !important;
}

/*
 * Raise whichever Elementor region the card came from while
 * dragging. This prevents a high-z-index card from still being
 * trapped underneath a sibling stacking context.
 */
.vote-drag-layer {
    position: relative !important;
    z-index: 99998 !important;
    overflow: visible !important;
}

/*
* ==============================
* OWN-ORGANIZATION LOCKOUT
* ==============================
* The video remains usable, but the card itself
* cannot be dragged into a ranking slot.
*/

.vote-card-item--locked {
    cursor: not-allowed;
}

.vote-card-item--locked .vote-card {
    position: relative;
    border-color: var(--vote-locked) !important;
    background: var(--vote-locked-soft);
}

.vote-card-item--locked .vote-card__content {
    opacity: 0.58;
}

.vote-card-lock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;

    padding: 7px 12px;
    border-radius: 999px;

    background: var(--vote-locked);
    color: #ffffff;

    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    overflow-wrap: anywhere;

    pointer-events: none;
}

/*
 * Locked cards still need a normal, usable video area.
 */
.vote-card-item--locked .vote-card__video,
.vote-card-item--locked .vote-card__video * {
    cursor: pointer;
}

/*
* Keep the video itself interactive.
*/
.vote-card__video,
.vote-card__video * {
    touch-action: auto;
}

/*
 * Keep Elementor's video play control still. Some icon/theme combinations
 * add a repeating pulse to the overlay play control. The voting cards use
 * a static play affordance so the grid stays calm and easy to scan.
 */
.vote-card__video .elementor-custom-embed-play,
.vote-card__video .elementor-custom-embed-play *,
.vote-card__video .elementor-custom-embed-play::before,
.vote-card__video .elementor-custom-embed-play::after {
    animation: none !important;
}

/*
* Actual card while being dragged.
*/
.vote-card--dragging {
    cursor: grabbing !important;
    opacity: 0.95;
    z-index: 99999 !important;
    will-change: transform;
    transition: none !important;
}

.vote-card--returning {
    transition:
        transform var(--vote-return-speed) ease-out !important;
}

/*
* Prevent Elementor containers from
* visually clipping our dragged card.
*/
.voting-board,
.ranking-area,
.card-pool,
.card-pool__items,
.rank-slot {
    overflow: visible !important;
}

.rank-slot {
    position: relative;
    z-index: 1;

    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

/*
 * Empty podium marker is now a real Elementor element.
 * Add a Text/Heading widget inside each rank slot with class
 * `rank-slot__marker`. The voting JS hides it when a card is placed.
 */
.rank-slot__marker {
    box-sizing: border-box;
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border: 1px dashed var(--vote-slot-marker-border);
    border-radius: 8px;
    background: var(--vote-slot-marker-bg);
    color: var(--vote-slot-marker-text) !important;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.05em;
    line-height: 1.15;
    text-align: center;
    text-transform: uppercase;
    opacity: 0.72;
    pointer-events: none;
}

/* Elementor Heading/Text widgets often put typography on an inner node.
 * Keep the marker subtle even if a global heading/link style is blue. */
.rank-slot__marker *,
.rank-slot__marker .elementor-heading-title,
.rank-slot__marker a {
    color: var(--vote-slot-marker-text) !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
    text-transform: inherit !important;
    text-decoration: none !important;
}

.rank-slot.drop-active {
    border-color: var(--rank-color) !important;
    border-style: dashed !important;

    background:
        color-mix(in srgb,
            var(--rank-color) 5%,
            white);

    opacity: 0.9;
}

.rank-slot.drop-target {
    opacity: 1;

    transform: scale(1.015);

    outline:
        3px solid var(--rank-color);

    outline-offset: 4px;

    background:
        var(--rank-soft);

    box-shadow:
        0 8px 24px color-mix(in srgb,
            var(--rank-color) 20%,
            transparent);
}


/*
 * Once a card is actually ranked, keep its place color visible.
 * Elementor's normal card border can otherwise make all three
 * ranked cards look identical after the hover state ends.
 */
.rank-first .vote-card-item .vote-card,
.rank-second .vote-card-item .vote-card,
.rank-third .vote-card-item .vote-card {
    border-style: solid !important;
    border-width: 3px !important;
    border-color: var(--rank-color) !important;
    box-shadow:
        0 6px 18px color-mix(in srgb, var(--rank-color) 22%, transparent) !important;
}

.rank-first.is-filled,
.rank-second.is-filled,
.rank-third.is-filled {
    background: var(--rank-soft);
}

/*
* Don't highlight the pool like
* a ranking position.
*/
.card-pool.drop-target {
    outline: none;
}

/*
* ==============================
* VERIFIED-VOTER GATE
* ==============================
* These classes are applied before any drag/drop
* handlers are created. Unverified visitors can see
* the verification UI above, but not the ballot.
*/

.tbv-voting-hidden {
    display: none !important;
}

/*
 * Optional Elementor helper content that should exist only during an active
 * ballot. Add the class tbv-voting-only to any Elementor container/widget.
 * The plugin adds tbv-voting-active to <body> only after the voter is
 * verified, voting is open, the voter has not voted, and the ballot is ready.
 * No active-state display value is forced, so Elementor keeps full control
 * over the element's layout when it becomes visible.
 */
body:not(.tbv-voting-active) .tbv-voting-only {
    display: none !important;
}

/* Completed ballots collapse the interactive layout completely. */
.tbv-voting-gate {
    margin: 18px 0 24px;
    padding: 18px 20px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.025);
}

.tbv-voting-gate__title {
    margin: 0 0 6px;
    font-size: 1.1rem;
    font-weight: 700;
}

.tbv-voting-gate__text {
    margin: 0;
}

.tbv-voting-gate__content {
    min-width: 0;
}

.tbv-voting-gate__eyebrow {
    margin: 0 0 8px;
    color: var(--tbv-success-accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.tbv-voting-gate--success {
    width: 100%;
    margin: 22px 0 30px;
    padding: clamp(24px, 4vw, 40px);
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
    border: 1px solid color-mix(in srgb, var(--tbv-success-accent) 20%, transparent);
    border-left: 6px solid var(--tbv-success-accent);
    border-radius: 18px;
    background:
        linear-gradient(
            135deg,
            var(--tbv-success-bg) 0%,
            #ffffff 100%
        );
}

.tbv-voting-gate--success .tbv-voting-gate__icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--tbv-success-accent);
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.tbv-voting-gate--success .tbv-voting-gate__title {
    margin: 0 0 8px;
    font-size: clamp(1.45rem, 2vw, 2rem);
    line-height: 1.15;
}

.tbv-voting-gate--success .tbv-voting-gate__text {
    max-width: 760px;
    color: #414957;
    font-size: 1rem;
    line-height: 1.6;
}

@media (max-width: 767px) {




    .tbv-sticky-ballot {
        bottom: 10px;
        gap: 4px;
        width: calc(100vw - 16px);
        justify-content: center;
        padding: 7px;
        border-radius: 14px;
    }

    .tbv-sticky-ballot__title {
        display: none;
    }

    .tbv-sticky-ballot__rank {
        min-width: 46px;
        padding: 7px 8px;
    }

    .tbv-sticky-ballot__view {
        padding: 7px 10px;
    }

    .tbv-voting-gate--success {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/*
* ==============================
* CONFIRMATION MODAL
* ==============================
*/

.vote-confirm-modal {
    width: min(1000px, 92vw);
    max-width: none;
    border: 0;
    padding: 0;
    background: transparent;
}

.vote-confirm-modal::backdrop {
    background: rgba(0, 0, 0, 0.72);
}

.vote-confirm-modal__panel {
    position: relative;
    background: #ffffff;
    border-radius: 18px;
    padding: 28px;
    overflow: hidden;
}

.vote-confirm-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

.vote-confirm-modal__header {
    margin-bottom: 24px;
}

.vote-confirm-modal__title {
    margin: 0 0 8px;
}

.vote-confirm-modal__text {
    margin: 0;
}

/*
* ==============================
* PODIUM LAYOUT
* ==============================
*/

.vote-confirm-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    margin-bottom: 28px;
}

.vote-confirm-podium__column {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    max-width: 260px;
}

.vote-confirm-podium__column--first {
    --place-color: var(--vote-first);
    --place-soft: var(--vote-first-soft);
    transform: translateY(-18px);
}

.vote-confirm-podium__column--second {
    --place-color: var(--vote-second);
    --place-soft: var(--vote-second-soft);
    transform: scale(0.94);
}

.vote-confirm-podium__column--third {
    --place-color: var(--vote-third);
    --place-soft: var(--vote-third-soft);
    transform: scale(0.94);
}

.vote-confirm-podium__card-wrap {
    width: 100%;
    margin-bottom: 12px;
}

.vote-confirm-podium__base {
    width: 100%;
    min-height: 70px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px 14px 0 0;
    font-weight: 700;
    background: var(--place-soft);

    border-top:
        4px solid var(--place-color);
}

.vote-confirm-podium__base--first {
    min-height: 110px;
}

.vote-confirm-podium__base--second {
    min-height: 85px;
}

.vote-confirm-podium__base--third {
    min-height: 85px;
}

/*
* ==============================
* SUMMARY CARD
* ==============================
*/

.vote-summary-card {
    background: #fff;
    border:
        2px solid var(--place-color);
    border-radius: 14px;
    overflow: hidden;

    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.08);
}

.vote-summary-card__place {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 10px;
    opacity: 0.8;
}

.vote-summary-card__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}

.vote-summary-card__hospital {
    font-size: 0.95rem;
    line-height: 1.4;
    opacity: 0.8;
}

.vote-summary-card__video-host {
    display: none;
    width: 100%;
    background: #111;
}

.vote-summary-card.has-playable-video .vote-summary-card__video-host {
    display: block;
}

.vote-summary-card.has-playable-video .vote-summary-card__image {
    display: none;
}

.vote-summary-card__video-host .vote-card__video,
.vote-summary-card__video-host .elementor-widget-video,
.vote-summary-card__video-host .elementor-wrapper,
.vote-summary-card__video-host iframe,
.vote-summary-card__video-host video {
    width: 100% !important;
    max-width: 100% !important;
}

.vote-summary-card__video-host iframe,
.vote-summary-card__video-host video {
    display: block;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
}

.vote-summary-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #eee;
}

.vote-summary-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vote-summary-card__content {
    padding: 16px;
}

/*
* ==============================
* MODAL ACTIONS
* ==============================
*/

.vote-confirm-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.vote-confirm-modal__button {
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid currentColor;
}


.vote-confirm-modal__button[disabled] {
    opacity: 0.55;
    cursor: wait;
}

.vote-confirm-modal__error {
    margin: 16px 0 0;
    padding: 12px 14px;
    border: 1px solid currentColor;
    border-radius: 10px;
    font-size: 0.95rem;
}

/*
* ==============================
* SIMPLE RESPONSIVE FALLBACK
* ==============================
*/

@media (max-width: 1024px) {
    .voting-layout {
        display: block !important;
    }

    .voting-sidebar {
        position: static;
        top: auto;
        margin-bottom: 24px;
    }

    .voting-layout.tbv-podium-layout--top .voting-sidebar .ranking-area {
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 900px) {
    .tbv-voter-access__form {
        grid-template-columns: 1fr 1fr;
    }

    .tbv-voter-access__form .tbv-voter-access__submit {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    .tbv-voter-access__verified {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .tbv-voter-access__actions {
        justify-self: start;
    }

    .tbv-voter-access__form,
    .tbv-voter-access__code-form {
        grid-template-columns: 1fr;
    }

    .tbv-voter-access__form .tbv-voter-access__submit,
    .tbv-voter-access__code-form label {
        grid-column: auto;
    }
    .vote-confirm-podium {
        flex-direction: column;
        align-items: stretch;
    }

    .vote-confirm-podium__column--first,
    .vote-confirm-podium__column--second,
    .vote-confirm-podium__column--third {
        transform: none;
        max-width: none;
    }
}

/*
 * ==============================
 * ELEMENTOR VOTER ACCESS WIDGETS
 * ==============================
 * v0.10.5 replaces the monolithic voter-login shortcode presentation with
 * independent Elementor widgets. Elementor controls own the visual choices;
 * these rules provide only reliable structure and responsive behavior.
 */
.tbv-elementor-access__panel,
.tbv-elementor-voter-details,
.tbv-elementor-end-access {
    box-sizing: border-box;
}

.tbv-elementor-access__notice {
    margin-bottom: 10px;
    font-weight: 600;
}

.tbv-elementor-access__year {
    margin-bottom: 6px;
}

.tbv-elementor-access__title {
    margin: 0 0 6px;
}

.tbv-elementor-access__body {
    margin: 0 0 16px;
}

.tbv-elementor-access__form,
.tbv-elementor-access__organization-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.tbv-elementor-access__form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
}

.tbv-elementor-access__field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.tbv-elementor-access__field input,
.tbv-elementor-access__field select,
.tbv-elementor-access__code-form input {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    border-width: 1px;
    border-style: solid;
    padding: 9px 11px;
    font: inherit;
}

.tbv-elementor-access__field select {
    color: #111827;
    background-color: #ffffff;
    font-size: 1rem;
    line-height: 1.35;
}

.tbv-elementor-access__field select:required:invalid {
    color: #4b5563;
}

.tbv-elementor-access__field select option {
    color: #111827;
    background: #ffffff;
}

.tbv-required {
    color: #b42318;
    font-weight: 800;
}

.tbv-elementor-access__submit,
.tbv-elementor-end-access__button {
    appearance: none;
    min-height: 44px;
    border-color: transparent;
    border-style: solid;
    border-width: 1px;
    cursor: pointer;
    font: inherit;
    box-sizing: border-box;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.tbv-elementor-access__form-actions .tbv-elementor-access__submit {
    flex: 0 1 auto;
    width: auto;
}

.tbv-elementor-access__code-form {
    display: grid;
    grid-template-columns: minmax(180px, 260px) auto;
    align-items: end;
    gap: 12px;
}

.tbv-elementor-access__code-form label {
    grid-column: 1 / -1;
}

.tbv-elementor-access__switch {
    margin: 12px 0 0;
}

.tbv-elementor-access__honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.tbv-elementor-voter-details {
    display: grid;
    align-content: start;
    min-width: 0;
}

.tbv-elementor-voter-details__year,
.tbv-elementor-voter-details__welcome,
.tbv-elementor-voter-details__name,
.tbv-elementor-voter-details__email,
.tbv-elementor-voter-details__organization {
    min-width: 0;
    overflow-wrap: anywhere;
}

.tbv-elementor-voter-details__organization {
    display: flex;
    flex-wrap: wrap;
    gap: 0.32em;
}

.tbv-elementor-voter-details__status {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.32em;
    margin-top: 8px;
    padding: 6px 10px;
}

.tbv-elementor-end-access__form {
    margin: 0;
}

@media (max-width: 767px) {
    .tbv-elementor-access__form,
    .tbv-elementor-access__code-form {
        grid-template-columns: 1fr;
    }

    .tbv-elementor-access__form-actions {
        grid-column: auto;
    }

    .tbv-elementor-access__form-actions .tbv-elementor-access__submit {
        width: 100%;
    }

    .tbv-elementor-access__code-form label {
        grid-column: auto;
    }
}


/*
 * ==============================
 * ELEMENTOR: VOTING CLOSED WIDGET
 * ==============================
 * Structural defaults only. Elementor widget controls own the visual design.
 */
.tbv-elementor-voting-closed[hidden] {
    display: none !important;
}

.tbv-elementor-voting-closed {
    width: 100%;
    min-width: 0;
}

.tbv-elementor-voting-closed__panel {
    width: 100%;
    box-sizing: border-box;
}

.tbv-elementor-voting-closed__year,
.tbv-elementor-voting-closed__title,
.tbv-elementor-voting-closed__message {
    margin-top: 0;
}

.tbv-elementor-voting-closed__year {
    margin-bottom: 8px;
}

.tbv-elementor-voting-closed__title {
    margin-bottom: 10px;
}

.tbv-elementor-voting-closed__message {
    margin-bottom: 0;
}

/* Organization metadata and rank-aware winner shortcodes. */
.tbv-winner-card__location {
    margin: 4px 0 12px;
    opacity: 0.82;
}

.tbv-winner-card__organization-image,
.tbv-winner-field-image {
    display: block;
    max-width: 180px;
    height: auto;
    margin: 10px 0 14px;
}

.tbv-winner-field-video {
    display: inline-block;
}

/* Elementor winner announcement and congratulations widgets. */
.tbv-elementor-winner-announcement,
.tbv-elementor-winner-congratulations {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.tbv-elementor-winner-announcement__prefix,
.tbv-elementor-winner-announcement__details {
    overflow-wrap: anywhere;
}

.tbv-elementor-winner-announcement__image-wrap {
    display: block;
    margin: 0 0 14px;
}

.tbv-elementor-winner-announcement__image {
    display: block;
    width: 180px;
    max-width: 100%;
    height: auto;
}

.tbv-elementor-winner-announcement__image-wrap + .tbv-elementor-winner-announcement__prefix,
.tbv-elementor-winner-announcement__image-wrap + .tbv-elementor-winner-announcement__details {
    margin-left: 0;
}

.tbv-elementor-winner-announcement__details + .tbv-elementor-winner-announcement__image-wrap {
    margin-top: 14px;
    margin-bottom: 0;
}

.tbv-elementor-winner-announcement__organization,
.tbv-elementor-winner-congratulations__organization {
    overflow-wrap: anywhere;
}

.tbv-elementor-winner-congratulations__heading {
    margin: 0;
}

.tbv-elementor-winner-congratulations__location {
    margin: 8px 0 18px;
    overflow-wrap: anywhere;
}

.tbv-elementor-winner-congratulations__video-button {
    cursor: pointer;
    border: 0;
    padding: 11px 17px;
    background: #075b96;
    color: #fff;
    font: inherit;
}

.tbv-elementor-winner-congratulations__video-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.tbv-elementor-winner-congratulations__modal[hidden] {
    display: none !important;
}

.tbv-elementor-winner-congratulations__modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 24px;
}

.tbv-elementor-winner-congratulations__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 22, 35, 0.78);
}

.tbv-elementor-winner-congratulations__dialog {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
    max-height: min(720px, 92vh);
    overflow: auto;
    box-sizing: border-box;
    padding: 28px;
    background: #fff;
    color: #111827;
    box-shadow: 0 18px 70px rgba(0, 0, 0, 0.28);
}

.tbv-elementor-winner-congratulations__close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
}

.tbv-elementor-winner-congratulations__modal-title {
    margin: 0 42px 18px 0;
}

.tbv-elementor-winner-congratulations__video {
    width: 100%;
}

.tbv-elementor-winner-congratulations__video video,
.tbv-elementor-winner-congratulations__video iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 360px;
    border: 0;
    aspect-ratio: 16 / 9;
    background: #000;
}

body.tbv-video-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .tbv-elementor-winner-congratulations__modal {
        padding: 12px;
    }

    .tbv-elementor-winner-congratulations__dialog {
        padding: 22px 16px 16px;
    }

    .tbv-elementor-winner-congratulations__video video,
    .tbv-elementor-winner-congratulations__video iframe {
        min-height: 210px;
    }
}

/* 0.16.9: organization image in the Winner Congratulations widget. */
.tbv-elementor-winner-congratulations__image-wrap {
    display: block;
    margin: 0 0 16px;
}

.tbv-elementor-winner-congratulations__image {
    display: block;
    width: 260px;
    max-width: 100%;
    height: auto;
}

.tbv-elementor-winner-congratulations__image--placeholder {
    min-height: 120px;
    background: rgba(0, 0, 0, 0.06);
}

/* 0.16.11: submission hero + organization logo treatment for winner widgets. */
.tbv-elementor-winner-announcement__image,
.tbv-elementor-winner-congratulations__image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.tbv-elementor-winner-announcement__logo-wrap,
.tbv-elementor-winner-congratulations__logo-wrap {
    display: block;
}

.tbv-elementor-winner-announcement__logo,
.tbv-elementor-winner-congratulations__logo {
    display: block;
    width: 110px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.tbv-elementor-winner-announcement__logo--placeholder,
.tbv-elementor-winner-congratulations__logo--placeholder {
    min-height: 64px;
    background: rgba(0, 0, 0, 0.06);
}

.tbv-elementor-winner-announcement__video-button {
    margin-top: 14px;
}

.tbv-elementor-winner-announcement__image-wrap--below {
    margin-top: 14px;
    margin-bottom: 0;
}

/* v0.18.1: keep the confirmation close glyph optically centered in its button. */
.vote-confirm-modal__close {
    display: grid;
    place-items: center;
    padding: 0;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1;
}

/*
 * ==============================
 * 0.18.3 MOBILE / TABLET FRONTEND PASS
 * ==============================
 * Responsive presentation only. Voting state, ranking, submission and
 * Elementor widget settings remain owned by the existing plugin logic.
 */

/* Keep media inside Elementor-built voting cards fluid at every width. */
.vote-card__video,
.vote-card__video .elementor-wrapper,
.vote-card__video .elementor-video,
.vote-card__video iframe,
.vote-card__video video,
.vote-card__video img {
    max-width: 100%;
    box-sizing: border-box;
}

.vote-card__video iframe,
.vote-card__video video,
.vote-card__video img {
    width: 100%;
}

@media (max-width: 900px) {
    /* Give the ballot more breathing room on tablets and narrow laptops. */
    .voting-layout,
    .voting-layout.tbv-podium-layout--side,
    .voting-layout.tbv-podium-layout--top {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 24px;
    }

    .voting-sidebar {
        position: static !important;
        top: auto !important;
        width: 100%;
        margin-bottom: 18px;
    }

    /* Elementor Loop Grid: two useful columns on tablet-sized screens. */
    .card-pool .elementor-loop-container {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .vote-card-item .vote-card__title,
    .vote-card-item .vote-card__title .elementor-heading-title {
        font-size: clamp(1rem, 2.2vw, 1.2rem) !important;
        line-height: 1.25 !important;
    }

    .vote-card-item .vote-card__hospital,
    .vote-card-item .vote-card__hospital * {
        font-size: clamp(0.82rem, 1.8vw, 0.96rem) !important;
        line-height: 1.35 !important;
    }

    .vote-confirm-modal {
        width: min(760px, calc(100vw - 32px));
    }

    .vote-confirm-modal__panel {
        padding: 24px;
    }
}

@media (max-width: 767px) {
    /* Elementor organization identity banner helper introduced in 0.17.2. */
    .tbv-org-banner {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center;
        gap: 14px !important;
    }

    .tbv-org-banner img {
        max-width: min(180px, 70vw);
        height: auto;
    }

    /* One entry per row on phones. */
    .card-pool .elementor-loop-container {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 18px !important;
    }

    .vote-card-item,
    .vote-card-item > .vote-card,
    .vote-card-item .vote-card__content {
        width: 100%;
        max-width: 100%;
    }

    .vote-card-item .vote-card__title,
    .vote-card-item .vote-card__title .elementor-heading-title {
        font-size: clamp(1.05rem, 5vw, 1.3rem) !important;
        line-height: 1.25 !important;
    }

    .vote-card-item .vote-card__hospital,
    .vote-card-item .vote-card__hospital * {
        font-size: clamp(0.88rem, 4vw, 1rem) !important;
        line-height: 1.4 !important;
    }

    .vote-card-lock-badge {
        top: 8px;
        left: 8px;
        right: 8px;
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    /* Rank/podium regions become a readable vertical ballot on phones. */
    .voting-sidebar .ranking-area,
    .voting-layout.tbv-podium-layout--top .voting-sidebar .ranking-area {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
    }

    .rank-slot {
        width: 100%;
        min-width: 0;
    }

    .rank-slot__marker {
        min-height: 48px;
        padding: 11px 12px;
        font-size: 0.78rem;
        line-height: 1.25;
    }

    /* Access + details widgets: readable forms and thumb-friendly actions. */
    .tbv-voter-access__register-panel,
    .tbv-voter-access__code-panel,
    .tbv-voter-access__closed {
        padding: 18px;
    }

    .tbv-voter-access__field input,
    .tbv-voter-access__field select,
    .tbv-voter-access__code-form input,
    .tbv-elementor-access__field input,
    .tbv-elementor-access__field select,
    .tbv-elementor-access__code-form input {
        min-height: 48px;
        font-size: 16px;
    }

    .tbv-voter-access__submit,
    .tbv-voter-access__logout-button,
    .tbv-elementor-access__submit,
    .tbv-elementor-end-access__button {
        min-height: 48px;
        width: 100%;
        padding: 12px 16px;
    }

    .tbv-voter-access__verified .tbv-voter-access__logout-button,
    .tbv-voter-access__actions,
    .tbv-elementor-access__form-actions,
    .tbv-elementor-end-access__form {
        width: 100%;
    }

    .tbv-elementor-voter-details {
        row-gap: 6px;
    }

    .tbv-elementor-voter-details__status,
    .tbv-voter-access__ballot-status {
        padding: 8px 12px;
        line-height: 1.35;
    }

    /* Confirmation dialog becomes a compact phone sheet. */
    .vote-confirm-modal {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        margin: auto;
    }

    .vote-confirm-modal__panel {
        max-height: calc(100dvh - 20px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 22px 16px 18px;
        border-radius: 14px;
    }

    .vote-confirm-modal__header {
        margin-bottom: 18px;
        padding-right: 46px;
    }

    .vote-confirm-modal__title {
        font-size: clamp(1.25rem, 6vw, 1.55rem);
        line-height: 1.2;
    }

    .vote-confirm-modal__text {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .vote-confirm-modal__close {
        top: 10px;
        right: 10px;
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        display: grid;
        place-items: center;
        padding: 0;
        font-size: 28px;
        line-height: 1;
    }

    .vote-confirm-podium {
        gap: 14px;
        margin-bottom: 20px;
    }

    .vote-confirm-podium__card-wrap {
        margin-bottom: 8px;
    }

    .vote-confirm-podium__base,
    .vote-confirm-podium__base--first,
    .vote-confirm-podium__base--second,
    .vote-confirm-podium__base--third {
        min-height: 52px;
        border-radius: 10px 10px 0 0;
    }

    .vote-summary-card__content {
        padding: 14px;
    }

    .vote-confirm-modal__actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 10px;
    }

    .vote-confirm-modal__button {
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 1rem;
        font-weight: 700;
    }

    .tbv-voting-gate,
    .tbv-voting-gate--success {
        margin-left: 0;
        margin-right: 0;
    }

    .tbv-voting-gate--success {
        padding: 22px 18px;
        border-left-width: 4px;
    }
}

@media (max-width: 480px) {
    .tbv-voter-access__verified,
    .tbv-voter-access__register-panel,
    .tbv-voter-access__code-panel,
    .tbv-voter-access__closed {
        padding-left: 15px;
        padding-right: 15px;
    }

    .vote-confirm-modal {
        width: calc(100vw - 12px);
        max-height: calc(100dvh - 12px);
    }

    .vote-confirm-modal__panel {
        max-height: calc(100dvh - 12px);
        padding-left: 14px;
        padding-right: 14px;
    }
}


/*
 * 0.18.4 — Mobile tap-to-rank
 * Desktop retains the existing drag/drop ballot. Phones get large, explicit
 * rank buttons on each entry card so voters never have to drag across a long
 * scrolling page.
 */
.tbv-mobile-rank-controls {
    display: none;
}

@media (max-width: 767px) {
    .vote-card-item {
        cursor: default;
        touch-action: pan-y !important;
        flex-direction: column;
    }

    .tbv-mobile-rank-controls {
        display: grid;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        padding: 14px 14px 15px;
        border: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.10);
        border-radius: 0;
        background: transparent;
    }

    /* The controls now live inside the Elementor visual card so the entry
       and its ranking actions read as one continuous component. */
    .vote-card-item > .vote-card {
        overflow: hidden;
    }

    .tbv-mobile-rank-controls__label {
        display: block;
        margin: 0;
        font-size: 0.95rem;
        font-weight: 700;
        line-height: 1.3;
    }

    .tbv-mobile-rank-controls__buttons {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .tbv-mobile-rank-controls button {
        min-width: 0;
        min-height: 48px;
        margin: 0;
        padding: 10px 8px;
        border: 2px solid #d6dbe3;
        border-radius: 10px;
        background: #fff;
        color: #202733;
        font: inherit;
        font-size: 0.95rem;
        font-weight: 750;
        line-height: 1.15;
        text-align: center;
        cursor: pointer;
        touch-action: manipulation;
    }

    .tbv-mobile-rank-controls button:hover,
    .tbv-mobile-rank-controls button:focus-visible {
        border-color: currentColor;
        outline: 3px solid rgba(31, 111, 235, 0.22);
        outline-offset: 1px;
    }

    .tbv-mobile-rank-controls button.is-selected {
        border-color: #1769aa;
        background: #eaf4fc;
        color: #0b4f83;
        box-shadow: inset 0 0 0 1px #1769aa;
    }

    .tbv-mobile-rank-controls button.is-selected::before {
        content: "✓ ";
    }

    .tbv-mobile-rank-controls .tbv-mobile-rank-remove {
        grid-column: 1 / -1;
        min-height: 44px;
        border-width: 1px;
        background: #f6f7f7;
        font-weight: 650;
    }

    .tbv-mobile-rank-controls .tbv-mobile-rank-remove:disabled {
        display: none;
    }

    .vote-card-item--locked .tbv-mobile-rank-controls {
        display: none;
    }

    /* Once selected, keep the same tap controls available inside the podium so
       voters can change 1st/2nd/3rd or remove the entry without dragging. */
    .ranking-area .tbv-mobile-rank-controls,
    .rank-slot .tbv-mobile-rank-controls {
        display: grid !important;
    }
}


/*
 * 0.18.6 - Compact "Your Rankings" review panel
 * The old 2 / 1 / 3 medal-podium presentation is now a natural 1 / 2 / 3
 * ballot summary. The existing .rank-slot elements remain the actual desktop
 * drop targets, so voting behavior and ballot data are unchanged.
 */
.tbv-rankings-heading {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    margin: 0 0 4px;
}

.tbv-rankings-heading__title {
    color: #20252d;
    font-size: 1.15rem;
    font-weight: 750;
    line-height: 1.2;
}

.tbv-rankings-heading__help {
    color: #59616c;
    font-size: 0.86rem;
    line-height: 1.35;
}

.tbv-rank-slot-label {
    display: block;
    width: 100%;
    margin: 0 0 7px;
    color: #20252d;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

.rank-slot {
    min-height: 82px !important;
    padding: 10px !important;
    border-radius: 12px !important;
}

.rank-slot__marker {
    min-height: 40px;
    padding: 8px 10px;
}

/* A ranked entry is a summary here, not a second full-size video card. */
.rank-slot .vote-card__video {
    display: none !important;
}

.rank-slot .vote-card-item,
.rank-slot .vote-card-item > .vote-card,
.rank-slot .vote-card-item .vote-card__content {
    min-height: 0 !important;
    height: auto !important;
}

.rank-slot .vote-card-item > .vote-card {
    border-width: 2px !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}

.rank-slot .vote-card-item .vote-card__content {
    padding: 10px 11px !important;
    gap: 3px !important;
}

.rank-slot .vote-card-item .vote-card__title,
.rank-slot .vote-card-item .vote-card__title *,
.rank-slot .vote-card-item .vote-card__title .elementor-heading-title {
    margin: 0 !important;
    font-size: 0.98rem !important;
    line-height: 1.25 !important;
}

.rank-slot .vote-card-item .vote-card__hospital,
.rank-slot .vote-card-item .vote-card__hospital * {
    margin: 0 !important;
    font-size: 0.82rem !important;
    line-height: 1.3 !important;
}

/* Natural reading order even when the Elementor widget is configured as Top. */
.voting-layout.tbv-podium-layout--top .voting-sidebar .ranking-area {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 767px) {
    .tbv-rankings-heading {
        margin-bottom: 2px;
    }

    .tbv-rankings-heading__title {
        font-size: 1.1rem;
    }

    .tbv-rankings-heading__help {
        font-size: 0.84rem;
    }

    .voting-sidebar .ranking-area,
    .voting-layout.tbv-podium-layout--top .voting-sidebar .ranking-area {
        gap: 9px !important;
    }

    .rank-slot {
        min-height: 68px !important;
        padding: 9px !important;
    }

    .tbv-rank-slot-label {
        margin-bottom: 5px;
        font-size: 0.76rem;
    }

    .rank-slot__marker {
        min-height: 38px;
        padding: 8px 9px;
        font-size: 0.72rem;
    }

    /* Keep rank-changing actions available, but compact once the entry has
       moved into the summary panel. */
    .rank-slot .tbv-mobile-rank-controls {
        gap: 6px;
        padding: 8px 9px 9px;
    }

    .rank-slot .tbv-mobile-rank-controls__label {
        display: none;
    }

    .rank-slot .tbv-mobile-rank-controls__buttons {
        gap: 5px;
    }

    .rank-slot .tbv-mobile-rank-controls button {
        min-height: 40px;
        padding: 7px 5px;
        font-size: 0.82rem;
        border-radius: 8px;
    }

    .rank-slot .tbv-mobile-rank-controls .tbv-mobile-rank-remove {
        min-height: 38px;
    }
}

/*
 * 0.18.7 - Mobile sticky rankings bar
 * A compact, expandable summary for phone voters. It mirrors the existing
 * ballot state and never stores a second copy of rank data.
 */
@media (max-width: 767px) {
    body.tbv-sticky-ballot-active {
        padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    }

    #tbv-sticky-ballot.tbv-sticky-ballot {
        display: flex !important;
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        z-index: 99990;
        width: auto;
        max-width: none;
        transform: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        overflow: hidden;
        border: 1px solid rgba(7, 91, 150, 0.18);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 10px 34px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(12px);
    }

    .tbv-sticky-ballot__bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-height: 58px;
        padding: 8px;
    }

    .tbv-sticky-ballot__progress {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        flex: 1 1 auto;
        min-width: 0;
    }

    #tbv-sticky-ballot .tbv-sticky-ballot__rank {
        min-width: 0;
        min-height: 42px;
        padding: 8px 6px;
        border: 1px solid #d7dce4;
        border-radius: 10px;
        background: #ffffff;
        color: #303744;
        font-size: 0.78rem;
        font-weight: 800;
        line-height: 1;
    }

    #tbv-sticky-ballot .tbv-sticky-ballot__rank.is-filled {
        border-color: var(--vote-access-accent);
        background: color-mix(in srgb, var(--vote-access-accent) 8%, white);
        color: var(--vote-access-accent);
    }

    #tbv-sticky-ballot .tbv-sticky-ballot__view {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 9px 11px;
        border: 0;
        border-radius: 10px;
        background: var(--vote-access-accent);
        color: #ffffff;
        font-size: 0.78rem;
        font-weight: 800;
        line-height: 1.1;
    }

    .tbv-sticky-ballot__drawer {
        border-top: 1px solid #e4e7ec;
        padding: 12px;
        background: #ffffff;
    }

    .tbv-sticky-ballot__drawer[hidden] {
        display: none !important;
    }

    .tbv-sticky-ballot__drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 9px;
        color: #20252d;
        font-size: 1rem;
    }

    #tbv-sticky-ballot .tbv-sticky-ballot__close {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: #f1f3f6;
        color: #20252d;
        font-size: 1.45rem;
        font-weight: 500;
        line-height: 1;
    }

    .tbv-sticky-ballot__rows {
        display: grid;
        gap: 7px;
    }

    #tbv-sticky-ballot .tbv-sticky-ballot__row {
        display: grid;
        grid-template-columns: 46px minmax(0, 1fr);
        align-items: center;
        gap: 9px;
        width: 100%;
        min-height: 48px;
        padding: 7px 9px;
        border: 1px solid #e0e4e9;
        border-radius: 10px;
        background: #ffffff;
        color: #20252d;
        text-align: left;
        white-space: normal;
    }

    .tbv-sticky-ballot__place {
        font-size: 0.8rem;
        font-weight: 850;
        color: var(--vote-access-accent);
    }

    .tbv-sticky-ballot__selection {
        overflow: hidden;
        color: #20252d;
        font-size: 0.9rem;
        font-weight: 700;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tbv-sticky-ballot__selection.is-empty {
        color: #6b7280;
        font-weight: 600;
    }

    #tbv-sticky-ballot .tbv-sticky-ballot__action {
        width: 100%;
        min-height: 48px;
        margin-top: 10px;
        padding: 10px 14px;
        border: 1px solid #d7dce4;
        border-radius: 10px;
        background: #f4f5f7;
        color: #20252d;
        font-size: 0.9rem;
        font-weight: 800;
    }

    #tbv-sticky-ballot .tbv-sticky-ballot__action.is-ready {
        border-color: var(--vote-access-accent);
        background: var(--vote-access-accent);
        color: #ffffff;
    }

    #tbv-sticky-ballot button:focus-visible {
        outline: 3px solid color-mix(in srgb, var(--vote-access-accent) 34%, transparent);
        outline-offset: 2px;
    }
}

@media (min-width: 768px) {
    #tbv-sticky-ballot.tbv-sticky-ballot {
        display: none !important;
    }
}

/*
 * 0.18.8 - Sticky ranking visibility hardening.
 * Older paused sticky-ballot rules intentionally hide the legacy helper.
 * When the current mobile helper is active, explicitly restore visibility.
 */
@media (max-width: 767px) {
    body.tbv-sticky-ballot-active #tbv-sticky-ballot.tbv-sticky-ballot {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}


/*
 * 0.18.10 - Mobile spacing, sticky summary detail, and review modal scaling.
 * Give the ranking area more breathing room on phones, show organization names
 * in the sticky drawer, and make the final review videos render full-width in a
 * stacked mobile layout.
 */
.vote-summary-card__organization {
    font-size: 0.95rem;
    line-height: 1.4;
    opacity: 0.82;
}

.vote-summary-card__video-host .elementor-widget-video,
.vote-summary-card__video-host .elementor-widget-video > div,
.vote-summary-card__video-host .elementor-widget-video .elementor-wrapper,
.vote-summary-card__video-host .elementor-video,
.vote-summary-card__video-host .elementor-fit-aspect-ratio,
.vote-summary-card__video-host .elementor-fit-aspect-ratio iframe,
.vote-summary-card__video-host .elementor-fit-aspect-ratio video {
    width: 100% !important;
    max-width: 100% !important;
}

.vote-summary-card__video-host .elementor-widget-video .elementor-wrapper,
.vote-summary-card__video-host .elementor-fit-aspect-ratio,
.vote-summary-card__video-host .vote-card__video {
    position: relative;
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
    min-height: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
}

.vote-summary-card__video-host .elementor-widget-video iframe,
.vote-summary-card__video-host .elementor-widget-video video,
.vote-summary-card__video-host .elementor-fit-aspect-ratio iframe,
.vote-summary-card__video-host .elementor-fit-aspect-ratio video,
.vote-summary-card__video-host .vote-card__video iframe,
.vote-summary-card__video-host .vote-card__video video,
.vote-summary-card__video-host .vote-card__video img,
.vote-summary-card__video-host .elementor-video,
.vote-summary-card__video-host .elementor-custom-embed-image-overlay {
    position: absolute !important;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover;
}

@media (max-width: 767px) {
    .voting-sidebar {
        padding-left: 10px;
        padding-right: 10px;
    }

    .voting-layout.tbv-podium-layout--top .voting-sidebar,
    .voting-layout.tbv-podium-layout--side .voting-sidebar {
        margin-left: 0;
        margin-right: 0;
    }

    .vote-confirm-modal {
        width: calc(100vw - 28px);
        max-height: calc(100dvh - 28px);
    }

    .vote-confirm-modal__panel {
        max-height: calc(100dvh - 28px);
        padding: 18px 14px 16px;
        border-radius: 16px;
    }

    .vote-confirm-podium {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 18px;
    }

    .vote-confirm-podium__column,
    .vote-confirm-podium__card-wrap {
        width: 100%;
        max-width: none;
    }

    .vote-confirm-podium__column {
        align-items: stretch;
        transform: none !important;
    }

    .vote-confirm-podium__base,
    .vote-confirm-podium__base--first,
    .vote-confirm-podium__base--second,
    .vote-confirm-podium__base--third {
        min-height: 44px;
    }

    #tbv-sticky-ballot .tbv-sticky-ballot__row {
        grid-template-columns: 46px minmax(0, 1fr);
        align-items: start;
        min-height: 58px;
    }

    .tbv-sticky-ballot__selection {
        display: flex;
        flex-direction: column;
        gap: 2px;
        white-space: normal;
    }

    .tbv-sticky-ballot__selection-title {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.92rem;
        font-weight: 750;
        line-height: 1.25;
    }

    .tbv-sticky-ballot__selection-org {
        display: block;
        overflow: hidden;
        color: #59616c;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1.25;
    }
}

@media (max-width: 480px) {
    .voting-sidebar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .vote-confirm-modal {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
    }

    .vote-confirm-modal__panel {
        max-height: calc(100dvh - 20px);
        padding: 18px 12px 14px;
    }
}


/*
 * 0.18.11 - Confirm modal place-banner polish.
 * Put the 1st / 2nd / 3rd place banner above each review card so the rounded
 * cap visually points upward instead of feeling like a downward arrow.
 */
.vote-confirm-podium__column {
    flex-direction: column-reverse;
}

.vote-confirm-podium__card-wrap {
    margin-bottom: 0;
    margin-top: 12px;
}

@media (max-width: 767px) {
    .vote-confirm-podium__card-wrap {
        margin-top: 8px;
    }
}
