.flashnews-wrap {
    --flashnews-accent: #ff4d00;
    --flashnews-columns: 5;
    --flashnews-card-bg: #ffffff;
    --flashnews-text: #111827;
    --flashnews-muted: #6b7280;
    --flashnews-border: rgba(17, 24, 39, 0.1);
    --flashnews-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
    --flashnews-radius: 14px;
}

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

.flashnews-card {
    background: var(--flashnews-card-bg);
    border: 1px solid var(--flashnews-border);
    border-radius: var(--flashnews-radius);
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    min-height: 112px;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    outline: none;
}

.flashnews-card:hover,
.flashnews-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: var(--flashnews-shadow);
    border-color: color-mix(in srgb, var(--flashnews-accent), transparent 60%);
}

.flashnews-card:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--flashnews-accent), transparent 72%), var(--flashnews-shadow);
}

.flashnews-card__bar {
    background: var(--flashnews-accent);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 7px 12px;
    line-height: 1.2;
}

.flashnews-card__body {
    padding: 15px 14px 17px;
}

.flashnews-card__title {
    color: var(--flashnews-text);
    font-size: 16px;
    line-height: 1.35;
    margin: 0;
    font-weight: 800;
}

.flashnews-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0);
    backdrop-filter: blur(0px);
    transition: background 210ms ease, backdrop-filter 210ms ease;
}

.flashnews-overlay[hidden],
.flashnews-modal[hidden] {
    display: none !important;
}

.flashnews-overlay {
    pointer-events: none;
}

.flashnews-overlay.is-visible {
    pointer-events: auto;
}

.flashnews-overlay.is-visible {
    background: rgba(2, 6, 23, 0.68);
    backdrop-filter: blur(2px);
}

.flashnews-modal {
    position: relative;
    width: min(760px, 100%);
    max-height: min(82vh, 860px);
    background: #ffffff;
    color: var(--flashnews-text);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
    transform-origin: center center;
    opacity: 0;
    display: flex;
    flex-direction: column;
}

.flashnews-modal.is-opening,
.flashnews-modal.is-open {
    opacity: 1;
}

.flashnews-modal__bar {
    background: var(--flashnews-accent);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    padding: 10px 22px;
}

.flashnews-modal__inner {
    padding: 24px;
    overflow: auto;
}

.flashnews-modal__title {
    margin: 0 42px 16px 0;
    font-size: clamp(24px, 4vw, 36px);
    line-height: 1.1;
    font-weight: 900;
    color: var(--flashnews-text);
}

.flashnews-modal__image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    margin: 0 0 20px;
}

.flashnews-modal__content {
    font-size: 17px;
    line-height: 1.68;
    color: #1f2937;
}

.flashnews-modal__content > *:first-child {
    margin-top: 0;
}

.flashnews-modal__content > *:last-child {
    margin-bottom: 0;
}

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

.flashnews-modal__content iframe {
    border-radius: 12px;
}

.flashnews-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 2;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
    transition: transform 160ms ease, background 160ms ease;
}

.flashnews-modal__close:hover,
.flashnews-modal__close:focus-visible {
    transform: scale(1.06);
    background: #ffffff;
}

body.flashnews-modal-lock {
    overflow: hidden;
}

@media (max-width: 1024px) {
    .flashnews-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    }
}

@media (max-width: 720px) {
    .flashnews-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .flashnews-card__title {
        font-size: 15px;
    }

    .flashnews-overlay {
        padding: 14px;
        place-items: end center;
    }

    .flashnews-modal {
        max-height: 88vh;
        border-radius: 18px 18px 0 0;
    }

    .flashnews-modal__inner {
        padding: 20px;
    }
}

@media (max-width: 460px) {
    .flashnews-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flashnews-card,
    .flashnews-overlay,
    .flashnews-modal,
    .flashnews-modal__close {
        transition: none !important;
        animation: none !important;
    }
}
