.news-widget {
    position: fixed;
    top: 112px;
    right: clamp(12px, 2vw, 24px);
    z-index: 1000;

    width: min(320px, calc(100vw - 24px));

    color: var(--text, #e6edf3);
    font-family: inherit;

    pointer-events: none;
}

.news-toast,
.news-panel {
    border: 1px solid var(--border, #30363d);
    background:
        linear-gradient(
            145deg,
            rgba(139, 92, 246, 0.16),
            rgba(22, 27, 34, 0.98) 42%
        );
    box-shadow:
        0 18px 48px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.news-toast {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;

    width: 100%;
    min-height: 76px;
    padding: 11px 13px;

    border-radius: 15px;

    color: inherit;
    font: inherit;
    text-align: left;

    cursor: pointer;
    pointer-events: auto;

    opacity: 0;
    transform: translateX(calc(100% + 28px));

    transition:
        opacity 240ms ease,
        transform 320ms ease,
        visibility 240ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.news-widget.is-ready .news-toast {
    opacity: 1;
    transform: translateX(0);
}

.news-toast:hover,
.news-toast:focus-visible {
    border-color: rgba(139, 92, 246, 0.72);
    box-shadow:
        0 20px 52px rgba(0, 0, 0, 0.38),
        0 0 0 3px rgba(139, 92, 246, 0.12);
}

.news-toast:focus-visible,
.news-close:focus-visible,
.news-action:focus-visible {
    outline: 2px solid var(--accent-secondary, #a78bfa);
    outline-offset: 3px;
}

.news-toast-icon {
    position: relative;

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

    width: 38px;
    height: 38px;
    flex: 0 0 auto;

    border: 1px solid rgba(139, 92, 246, 0.52);
    border-radius: 11px;

    background: rgba(139, 92, 246, 0.18);
    color: var(--accent-bright, #c4b5fd);

    font-size: 0.9rem;
    font-weight: 900;
}

.news-toast-icon::after {
    position: absolute;
    top: -3px;
    right: -3px;

    width: 9px;
    height: 9px;

    border: 2px solid var(--surface, #161b22);
    border-radius: 50%;

    background: #48d56f;
    content: "";
}

.news-toast-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.news-toast-kicker,
.news-panel-label {
    color: var(--accent-bright, #c4b5fd);

    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
}

.news-toast-title {
    overflow: hidden;

    color: var(--text, #e6edf3);

    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-toast-hint {
    color: var(--muted, #9da7b4);

    font-size: 0.73rem;
    line-height: 1.2;
}

.news-toast-chevron {
    width: 9px;
    height: 9px;
    margin-right: 3px;

    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;

    color: var(--accent-bright, #c4b5fd);

    transform: rotate(45deg);
    transition: transform 160ms ease;
}

.news-toast:hover .news-toast-chevron {
    transform: translateX(2px) rotate(45deg);
}

.news-panel {
    position: absolute;
    top: 0;
    right: 0;

    width: min(380px, calc(100vw - 24px));
    max-height: calc(100vh - 136px);
    overflow-y: auto;
    padding: 20px;

    border-radius: 18px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(22px) scale(0.98);
    transform-origin: top right;

    transition:
        opacity 220ms ease,
        transform 280ms ease,
        visibility 220ms ease;
}

.news-widget.is-open .news-toast {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(18px);
}

.news-widget.is-open .news-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0) scale(1);
}

.news-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.news-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    padding: 0;

    border: 1px solid var(--border, #30363d);
    border-radius: 10px;

    background: rgba(13, 17, 23, 0.62);
    color: var(--muted, #9da7b4);

    font: inherit;
    font-size: 1.25rem;
    line-height: 1;

    cursor: pointer;

    transition:
        border-color 160ms ease,
        background 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.news-close:hover {
    border-color: rgba(139, 92, 246, 0.58);
    background: rgba(139, 92, 246, 0.12);
    color: var(--text, #e6edf3);
    transform: rotate(5deg);
}

.news-panel-visual {
    position: relative;

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

    min-height: 118px;
    margin-bottom: 20px;
    overflow: hidden;

    border: 1px solid rgba(139, 92, 246, 0.34);
    border-radius: 15px;

    background:
        radial-gradient(
            circle at 24% 22%,
            rgba(167, 139, 250, 0.34),
            transparent 38%
        ),
        linear-gradient(
            135deg,
            rgba(88, 55, 160, 0.56),
            rgba(13, 17, 23, 0.92)
        );
}

.news-panel-visual::before,
.news-panel-visual::after {
    position: absolute;
    border: 1px solid rgba(196, 181, 253, 0.16);
    border-radius: 50%;
    content: "";
}

.news-panel-visual::before {
    width: 170px;
    height: 170px;
}

.news-panel-visual::after {
    width: 96px;
    height: 96px;
}

.news-play-mark {
    position: relative;
    z-index: 1;

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

    width: 56px;
    height: 40px;

    border-radius: 12px;

    background: #ff3b4f;
    box-shadow: 0 12px 30px rgba(255, 59, 79, 0.28);
}

.news-play-mark::after {
    width: 0;
    height: 0;
    margin-left: 3px;

    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 13px solid white;
    content: "";
}

.news-panel-title {
    margin: 0;

    color: var(--text, #e6edf3);

    font-size: clamp(1.45rem, 4vw, 1.9rem);
    line-height: 1.08;
}

.news-panel-description {
    margin: 13px 0 20px;

    color: var(--muted, #9da7b4);

    font-size: 0.93rem;
    line-height: 1.65;
}

.news-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 46px;
    padding: 10px 16px;

    border: 1px solid rgba(255, 59, 79, 0.55);
    border-radius: 11px;

    background: rgba(255, 59, 79, 0.13);
    color: #ff9aa5;

    font-size: 0.88rem;
    font-weight: 800;

    transition:
        background 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.news-action:hover {
    border-color: rgba(255, 59, 79, 0.82);
    background: rgba(255, 59, 79, 0.2);
    transform: translateY(-1px);
}

@media (max-width: 760px) {
    .news-widget {
        top: auto;
        right: 10px;
        bottom: 10px;
        width: min(340px, calc(100vw - 20px));
    }

    .news-panel {
        top: auto;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: calc(100vh - 20px);
        padding: 18px;
        transform-origin: bottom right;
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-toast,
    .news-panel,
    .news-toast-chevron,
    .news-close,
    .news-action {
        transition: none;
    }
}
