.aql-contests,
.aql-reminder-modal {
    --aql-border: #e2e8f0;
    --aql-muted: #64748b;
    --aql-ink: #0f172a;
    --aql-panel: #f8fafc;
    --aql-green: #18aa50;
    --aql-green-dark: #159447;
    --aql-lime: #d0ed39;
    --aql-gradient: linear-gradient(105deg, #48bd54 0%, #d0ed39 100%);
}

.aql-contests {
    width: 100%;
    box-sizing: border-box;
    color: var(--aql-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.aql-contests *,
.aql-contests *::before,
.aql-contests *::after {
    box-sizing: border-box;
}

.aql-contests__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.aql-contests__header h1,
.aql-contests__header h2,
.aql-contests__header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .35px;
    line-height: 1.3;
    text-transform: uppercase;
}

.aql-contests__view-all {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 0 7px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #334155;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .25px;
    line-height: 1.1;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color .2s ease, transform .2s ease;
}

.aql-contests__view-all svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.aql-contests__view-all:hover,
.aql-contests__view-all:focus-visible {
    background: transparent;
    box-shadow: none;
    color: var(--aql-green-dark);
    text-decoration: none;
    transform: translateX(2px);
}

.aql-contests__empty {
    margin: 12px 0;
    color: var(--aql-muted);
    text-align: center;
}

.aql-contests--carousel {
    margin: 24px 0;
}

.aql-contests--carousel .aql-contest-card {
    width: calc(33.333% - 14px);
    min-height: 224px;
    margin-right: 20px;
}

.aql-contests--sidebar {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--aql-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, .05);
}

.aql-contests__list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.aql-contest-card {
    min-width: 0;
}

.aql-contest-card__inner {
    display: flex;
    height: 100%;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid var(--aql-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, .04);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.aql-contests--sidebar .aql-contest-card__inner {
    padding: 12px;
    border-radius: 8px;
    background: var(--aql-panel);
}

.aql-contest-card__inner:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 20px -3px rgba(15, 23, 42, .08);
    transform: translateY(-2px);
}

.aql-contest-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    margin-bottom: 12px;
}

.aql-contest-card__name {
    min-width: 0;
    margin: 0;
    color: #1e293b;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.aql-contests--sidebar .aql-contest-card__name {
    font-size: 15px;
}

.aql-contest-card__name a {
    color: inherit;
    text-decoration: none;
}

.aql-contest-card__name a:hover,
.aql-contest-card__name a:focus-visible {
    color: #0284c7;
}

.aql-contest-card__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
}

.aql-contest-card__bell,
.aql-contest-card__share {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
    color: #334155;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.aql-contest-card__bell svg,
.aql-contest-card__share svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.aql-contest-card__bell:hover,
.aql-contest-card__bell:focus-visible,
.aql-contest-card__share:hover,
.aql-contest-card__share:focus-visible {
    border-color: #0284c7;
    color: #0284c7;
    transform: translateY(-1px);
}

.aql-contest-card__bell.is-active {
    border-color: #0284c7;
    background: #e0f2fe;
    color: #0369a1;
}

.aql-contest-card__badge {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .25px;
    line-height: 1.15;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
}

.aql-contest-card__badge.badge-upcoming { background: #4f46e5; }
.aql-contest-card__badge.badge-open { background: #008a68; }
.aql-contest-card__badge.badge-judging { background: #9a6700; }
.aql-contest-card__badge.badge-completed { background: #64748b; }

.aql-contest-card__countdown {
    margin: 8px 0 14px;
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: var(--aql-panel);
    text-align: center;
}

.aql-contests--sidebar .aql-contest-card__countdown {
    background: #fff;
}

.aql-contest-card__countdown span {
    display: block;
    margin-bottom: 4px;
    color: var(--aql-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.aql-contest-card__countdown strong {
    display: block;
    color: var(--aql-ink);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -.35px;
}

.aql-contest-card__dates {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    color: var(--aql-muted);
    font-size: 11px;
}

.aql-contest-card__dates div {
    min-width: 48px;
    text-align: center;
}

.aql-contest-card__dates span {
    display: block;
    margin-top: 2px;
    color: #334155;
    font-weight: 700;
}

.aql-contests .flickity-prev-next-button {
    width: 36px;
    height: 36px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .15);
}

.aql-contests--page {
    margin: 24px 0 40px;
}

.aql-contests--page .aql-contests__header {
    align-items: flex-end;
    margin-bottom: 20px;
}

.aql-contests--page .aql-contests__header h1 {
    color: var(--aql-green);
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
}

.aql-contests__intro {
    max-width: 760px;
    margin: 7px 0 0;
    color: var(--aql-muted);
    line-height: 1.6;
}

.aql-page-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.aql-page-share__label {
    margin-right: 2px;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.aql-page-share__native,
.aql-page-share__network {
    display: inline-flex;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    transition: box-shadow .2s ease, transform .2s ease;
}

.aql-page-share__native {
    gap: 7px;
    padding: 0 15px;
    border: 0;
    background: var(--aql-gradient);
    box-shadow: 0 5px 13px rgba(89, 177, 62, .2);
    color: #fff;
    font-size: 13px;
}

.aql-page-share__native svg,
.aql-page-share__network svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.aql-page-share__network {
    width: 38px;
    border: 1px solid currentColor;
    background: #fff;
    font-size: 15px;
}

.aql-page-share__network.is-facebook {
    color: #1877f2;
    font-family: Arial, sans-serif;
    font-size: 21px;
    font-weight: 800;
}

.aql-page-share__network.is-x {
    color: #111827;
    font-size: 14px;
}

.aql-page-share__network.is-whatsapp {
    color: #128c4a;
    font-size: 10px;
}

.aql-page-share__network.is-telegram {
    color: #229ed9;
}

.aql-page-share__network.is-pinterest {
    color: #e60023;
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: 800;
}

.aql-page-share__native:hover,
.aql-page-share__native:focus-visible,
.aql-page-share__network:hover,
.aql-page-share__network:focus-visible {
    box-shadow: 0 7px 16px rgba(15, 23, 42, .16);
    text-decoration: none;
    transform: translateY(-2px);
}

.aql-page-share__native:hover,
.aql-page-share__native:focus-visible {
    background: linear-gradient(105deg, #31aa48 0%, #bddd29 100%);
    color: #fff;
}

.aql-contests__toolbar {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 22px;
    padding: 14px;
    border: 1px solid var(--aql-border);
    border-radius: 12px;
    background: linear-gradient(120deg, rgba(72, 189, 84, .055), rgba(208, 237, 57, .075));
}

.aql-contests__toolbar > label {
    display: grid;
    align-content: end;
    gap: 4px;
    margin: 0;
}

.aql-contests__field-label {
    display: block;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.aql-contests__search,
.aql-contests__year {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--aql-ink);
    font: inherit;
}

.aql-contests__search:focus,
.aql-contests__year:focus {
    border-color: #4fbd54;
    box-shadow: 0 0 0 3px rgba(72, 189, 84, .14);
    outline: 0;
}

.aql-contests__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    min-height: 42px;
}

.aql-contests__filter {
    min-height: 42px;
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.aql-contests__filter.is-active,
.aql-contests__filter:hover,
.aql-contests__filter:focus-visible {
    border-color: transparent;
    background: var(--aql-gradient);
    color: #fff;
    box-shadow: 0 5px 12px rgba(89, 177, 62, .18);
}

.aql-contests__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.aql-contests__grid .aql-contest-card__inner {
    min-height: 224px;
}

.aql-contest-card__page-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.aql-contests__no-results {
    display: none;
    margin: 26px 0;
    color: var(--aql-muted);
    text-align: center;
}

.aql-contests__no-results.is-visible {
    display: block;
}

body.aql-reminder-modal-open {
    overflow: hidden;
}

.aql-reminder-modal {
    position: fixed;
    z-index: 10020;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(3px);
}

.aql-reminder-modal__panel {
    position: relative;
    width: min(100%, 480px);
    padding: 28px;
    overflow: hidden;
    border: 1px solid rgba(72, 189, 84, .28);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 65px rgba(15, 23, 42, .25);
    color: #334155;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-align: center;
}

.aql-reminder-modal__panel::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 6px;
    background: var(--aql-gradient);
    content: "";
}

.aql-reminder-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 27px;
    line-height: 1;
}

.aql-reminder-modal__close:hover,
.aql-reminder-modal__close:focus-visible {
    background: #effbe8;
    color: var(--aql-green-dark);
}

.aql-reminder-modal__icon {
    display: inline-flex;
    width: 54px;
    height: 54px;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--aql-gradient);
    box-shadow: 0 7px 18px rgba(89, 177, 62, .22);
    color: #fff;
}

.aql-reminder-modal__icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.aql-reminder-modal__panel h2 {
    margin: 0 36px 6px;
    background: var(--aql-gradient);
    background-clip: text;
    color: var(--aql-green-dark);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
}

.aql-reminder-modal__panel p {
    margin: 10px 0;
    line-height: 1.55;
}

.aql-reminder-modal__contest {
    color: var(--aql-green-dark);
    font-size: 15px;
    font-weight: 750;
}

.aql-reminder-modal__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.aql-reminder-modal__google,
.aql-reminder-modal__ics {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid #52b94f;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.25;
    text-decoration: none;
}

.aql-reminder-modal__google {
    border-color: transparent;
    background: var(--aql-gradient);
    box-shadow: 0 7px 16px rgba(89, 177, 62, .2);
    color: #fff;
}

.aql-reminder-modal__ics {
    background: #fff;
    color: var(--aql-green-dark);
}

.aql-reminder-modal__google:hover,
.aql-reminder-modal__google:focus-visible {
    background: linear-gradient(105deg, #31aa48 0%, #bddd29 100%);
    color: #fff;
    transform: translateY(-1px);
}

.aql-reminder-modal__ics:hover,
.aql-reminder-modal__ics:focus-visible {
    background: linear-gradient(105deg, rgba(72, 189, 84, .1), rgba(208, 237, 57, .16));
    color: #117f3d;
}

.aql-reminder-modal__panel .aql-reminder-modal__note {
    margin-bottom: 0;
    color: #64748b;
    font-size: 12px;
}

.aql-contests__toast {
    position: fixed;
    z-index: 10000;
    right: 18px;
    bottom: 18px;
    max-width: min(360px, calc(100vw - 36px));
    padding: 11px 14px;
    border-radius: 9px;
    background: #0f172a;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .22);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}

.aql-contests__toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

[data-contest-card][hidden] {
    display: none !important;
}

@media (max-width: 992px) {
    .aql-contests--carousel .aql-contest-card {
        width: calc(50% - 10px);
    }

    .aql-contests__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .aql-contests__toolbar {
        grid-template-columns: 1fr 180px;
    }

    .aql-contests__filters {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .aql-contests--carousel .aql-contest-card {
        width: 87%;
        margin-right: 14px;
    }

    .aql-contests__grid,
    .aql-contests__toolbar {
        grid-template-columns: 1fr;
    }

    .aql-contests__filters {
        grid-column: auto;
    }

    .aql-contests:not(.aql-contests--page) .aql-contests__header {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 14px;
        padding-bottom: 14px;
    }

    .aql-contests:not(.aql-contests--page) .aql-contests__view-all {
        width: auto;
        min-height: 0;
        align-self: flex-end;
    }

    .aql-contest-card__header {
        gap: 8px;
    }

    .aql-contest-card__actions {
        align-items: flex-end;
        flex-direction: column;
    }

    .aql-contests--page .aql-contest-card__actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .aql-contest-card__badge {
        white-space: normal;
    }

    .aql-page-share {
        gap: 7px;
    }

    .aql-page-share__label {
        width: 100%;
        margin-bottom: 2px;
    }

    .aql-reminder-modal {
        align-items: flex-end;
        padding: 12px;
    }

    .aql-reminder-modal__panel {
        padding: 25px 18px 20px;
        border-radius: 16px;
    }

    .aql-reminder-modal__actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aql-contests *,
    .aql-contests *::before,
    .aql-contests *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
