:root {
    --font-family: "Inter", sans-serif;
    --third-family: "Arial", sans-serif;
    --font10: "Manrope", sans-serif;
}

body.fiwork-changelog-page {
    --changelog-bg: #ffffff;
    --changelog-surface: #f5f7fa;
    --changelog-raised: #ffffff;
    --changelog-border: #e4e8ee;
    --changelog-text: #1c1f24;
    --changelog-secondary: #5e6874;
    --changelog-muted: #89929e;
    --changelog-accent: #0177ff;
    width: 100%;
    color: var(--changelog-text);
    background: var(--changelog-bg);
    font-family: var(--font-family);
    overflow-x: clip;
}

.fiwork-changelog-page .main-block {
    box-sizing: border-box;
    padding: 0;
    background: var(--changelog-bg);
}

.fiwork-changelog-page .main-block > .main-container {
    box-sizing: border-box;
    width: min(1240px, calc(100% - 40px));
    max-width: 1240px;
    padding: 0;
    overflow: visible;
    background: transparent;
}

.changelog-page,
.changelog-page *,
.changelog-page *::before,
.changelog-page *::after {
    box-sizing: border-box;
}

.changelog-page {
    width: 100%;
    max-width: 1240px;
    margin: 48px auto 72px;
}

.changelog-hero {
    width: 100%;
    display: block;
    padding: 52px;
    border: 1px solid #dce9f7;
    border-radius: 32px;
    background:
        radial-gradient(circle at 88% 18%, rgba(1, 119, 255, .14), transparent 34%),
        linear-gradient(135deg, #f7fbff 0%, #edf6ff 100%);
    overflow: hidden;
}

.changelog-hero__copy {
    max-width: 760px;
}

.changelog-hero h1 {
    margin: 0;
    color: var(--changelog-text);
    font-family: var(--font10);
    font-size: clamp(44px, 5vw, 64px);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -.035em;
}

.changelog-hero h1 span {
    display: inline-block;
    color: var(--changelog-accent);
}

.changelog-hero p {
    max-width: 610px;
    margin: 20px 0 0;
    color: var(--changelog-secondary);
    font-family: var(--third-family);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.55;
}

.changelog-stream {
    margin-top: 28px;
}

.changelog-stream__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 18px;
}

.changelog-stream__heading {
    min-width: 0;
}

.changelog-stream__heading h2 {
    margin: 0;
    color: var(--changelog-text);
    font-family: var(--font10);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.changelog-stream__heading p {
    margin: 7px 0 0;
    color: var(--changelog-secondary);
    font-family: var(--third-family);
    font-size: 15px;
    line-height: 1.5;
}

.changelog-filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: none;
}

.changelog-filters::-webkit-scrollbar {
    display: none;
}

.changelog-filters a {
    flex: 0 0 auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid var(--changelog-border);
    border-radius: 12px;
    color: var(--changelog-secondary);
    background: var(--changelog-raised);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}

.changelog-filters a:hover,
.changelog-filters a:focus-visible {
    border-color: #bdd9f6;
    color: var(--changelog-accent);
    outline: none;
}

.changelog-filters a.is-active {
    border-color: var(--changelog-accent);
    color: #ffffff;
    background: var(--changelog-accent);
}

.changelog-feed {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 14px;
}

.changelog-entry {
    min-width: 0;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    padding: 26px;
    border: 1px solid var(--changelog-border);
    border-radius: 22px;
    background: var(--changelog-surface);
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}

.changelog-entry:hover {
    border-color: #bdd9f6;
    background: #f0f7ff;
    transform: translateY(-2px);
}

.changelog-entry__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.changelog-entry__meta time {
    color: var(--changelog-muted);
    font-family: var(--third-family);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}

.changelog-entry__labels {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.changelog-entry__type,
.changelog-entry__version {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.changelog-entry__type {
    color: #1475c8;
    background: #dcecfb;
}

.changelog-entry__type i {
    width: 15px;
    height: 15px;
    display: grid;
    place-items: center;
    font-style: normal;
}

.changelog-entry__type svg {
    width: 15px;
    height: 15px;
}

.changelog-entry__version {
    color: #657487;
    background: #e9edf2;
}

.changelog-entry--fix .changelog-entry__type {
    color: #15794d;
    background: #dff4e9;
}

.changelog-entry--announcement .changelog-entry__type {
    color: #6949bc;
    background: #eee8ff;
}

.changelog-entry--feature .changelog-entry__type {
    color: #a3640d;
    background: #fff0d7;
}

.changelog-entry__content {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.changelog-entry__content > h2 {
    margin: 0;
    color: var(--changelog-text);
    font-family: var(--third-family);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.changelog-entry__excerpt {
    margin: 9px 0 0;
    color: var(--changelog-secondary);
    font-family: var(--third-family);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.changelog-entry__body {
    margin-top: 17px;
    color: var(--changelog-secondary);
    font-family: var(--third-family);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.62;
    overflow-wrap: anywhere;
}

.changelog-entry__body > :first-child {
    margin-top: 0;
}

.changelog-entry__body > :last-child {
    margin-bottom: 0;
}

.changelog-entry__body h2,
.changelog-entry__body h3,
.changelog-entry__body h4 {
    margin: 20px 0 9px;
    color: var(--changelog-text);
    font-family: var(--third-family);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
}

.changelog-entry__body ul,
.changelog-entry__body ol {
    margin: 10px 0;
    padding-left: 21px;
}

.changelog-entry__body li + li {
    margin-top: 5px;
}

.changelog-entry__body a {
    color: var(--changelog-accent);
}

.changelog-entry__body img,
.changelog-entry__body video {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

.changelog-poll {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--changelog-border);
    transition: opacity .2s ease;
}

.changelog-poll.is-loading {
    opacity: .6;
    pointer-events: none;
}

.changelog-poll__heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.changelog-poll__icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--changelog-accent);
    background: #e2f0ff;
}

.changelog-poll__icon svg {
    width: 18px;
    height: 18px;
}

.changelog-poll__heading div > span {
    color: var(--changelog-muted);
    font-family: var(--font-family);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
}

.changelog-poll__heading h3 {
    margin: 2px 0 0;
    color: var(--changelog-text);
    font-family: var(--third-family);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.changelog-poll__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.changelog-poll__vote {
    min-width: 0;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid var(--changelog-border);
    border-radius: 10px;
    color: var(--changelog-secondary);
    background: var(--changelog-raised);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}

.changelog-poll__vote strong {
    color: var(--changelog-muted);
    font-size: 12px;
}

.changelog-poll__vote:hover,
.changelog-poll__vote:focus-visible,
.changelog-poll__vote.is-selected {
    border-color: #8ec4f6;
    color: var(--changelog-accent);
    outline: none;
}

.changelog-poll__vote.is-selected {
    background: #eaf5ff;
}

.changelog-poll__vote:disabled {
    cursor: default;
    opacity: .72;
}

.changelog-poll__footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 13px;
}

.changelog-poll__bar {
    min-width: 80px;
    height: 4px;
    flex: 1 1 auto;
    overflow: hidden;
    border-radius: 999px;
    background: #dde4eb;
}

.changelog-poll__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--changelog-accent);
    transition: width .3s ease;
}

.changelog-poll__total {
    flex: 0 0 auto;
    margin: 0;
    color: var(--changelog-muted);
    font-family: var(--third-family);
    font-size: 12px;
    line-height: 1.4;
}

.changelog-poll__login {
    margin-top: 12px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    color: var(--changelog-accent);
    background: transparent;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.changelog-empty {
    grid-column: 1 / -1;
    width: 100%;
    padding: 36px;
    border: 1px solid var(--changelog-border);
    border-radius: 24px;
    background: var(--changelog-surface);
    text-align: left;
}

.changelog-empty > span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 13px;
    color: var(--changelog-accent);
    background: #e2f0ff;
}

.changelog-empty svg {
    width: 24px;
    height: 24px;
}

.changelog-empty h2 {
    margin: 0 0 9px;
    color: var(--changelog-text);
    font-family: var(--font10);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
}

.changelog-empty p {
    margin: 0;
    color: var(--changelog-secondary);
    font-family: var(--third-family);
    font-size: 15px;
    line-height: 1.55;
}

.changelog-pagination {
    margin-top: 28px;
}

html[data-theme="dark"] body.fiwork-changelog-page {
    --changelog-bg: #101214;
    --changelog-surface: #181b1f;
    --changelog-raised: #1d2126;
    --changelog-border: #2b3036;
    --changelog-text: #f2f4f7;
    --changelog-secondary: #b3bdc8;
    --changelog-muted: #89939f;
    --changelog-accent: #4aa8f7;
    background: var(--changelog-bg);
}

html[data-theme="dark"] .fiwork-changelog-page .changelog-hero {
    border-color: #293b4d;
    background:
        radial-gradient(circle at 88% 18%, rgba(74, 168, 247, .18), transparent 34%),
        linear-gradient(135deg, #151a20 0%, #17222c 100%);
}

html[data-theme="dark"] .fiwork-changelog-page .changelog-entry:hover {
    border-color: #365b79;
    background: #192630;
}

html[data-theme="dark"] .fiwork-changelog-page .changelog-entry__type {
    color: #76b8ff;
    background: rgba(63, 138, 224, .14);
}

html[data-theme="dark"] .fiwork-changelog-page .changelog-entry--fix .changelog-entry__type {
    color: #70d4a2;
    background: rgba(45, 158, 99, .15);
}

html[data-theme="dark"] .fiwork-changelog-page .changelog-entry--announcement .changelog-entry__type {
    color: #aa98ff;
    background: rgba(115, 92, 230, .14);
}

html[data-theme="dark"] .fiwork-changelog-page .changelog-entry--feature .changelog-entry__type {
    color: #ffbd5b;
    background: rgba(255, 160, 0, .12);
}

html[data-theme="dark"] .fiwork-changelog-page .changelog-entry__version {
    color: #a9b4bf;
    background: #242a30;
}

html[data-theme="dark"] .fiwork-changelog-page .changelog-poll__icon,
html[data-theme="dark"] .fiwork-changelog-page .changelog-empty > span {
    background: #193650;
}

html[data-theme="dark"] .fiwork-changelog-page .changelog-poll__vote.is-selected {
    background: #173550;
}

html[data-theme="dark"] .fiwork-changelog-page .changelog-poll__bar {
    background: #343c45;
}

@media (max-width: 960px) {
    .changelog-stream__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .changelog-filters {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    body.fiwork-changelog-page {
        width: 100%;
        overflow-x: hidden;
    }

    .fiwork-changelog-page .main-block {
        padding: 0 12px 48px;
        overflow: visible;
    }

    .fiwork-changelog-page .main-block > .main-container {
        width: 100%;
        overflow: visible;
    }

    .changelog-page {
        max-width: none;
        margin: 18px 0 0;
    }

    .changelog-hero {
        padding: 28px 22px;
        border-radius: 24px;
    }

    .changelog-hero h1 {
        font-size: clamp(34px, 10vw, 46px);
        line-height: 1.06;
        letter-spacing: -.035em;
    }

    .changelog-hero p {
        margin-top: 16px;
        font-size: 16px;
        line-height: 1.5;
    }

    .changelog-stream {
        margin-top: 22px;
    }

    .changelog-stream__header {
        gap: 13px;
        margin-bottom: 15px;
    }

    .changelog-stream__heading h2 {
        font-size: 25px;
    }

    .changelog-stream__heading p {
        margin-top: 6px;
        font-size: 14px;
    }

    .changelog-filters {
        width: calc(100% + 24px);
        margin: 0 -12px;
        padding: 2px 12px 4px;
    }

    .changelog-filters a {
        min-height: 38px;
        padding: 8px 12px;
        border-radius: 10px;
        font-size: 13px;
    }

    .changelog-feed {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .changelog-entry {
        min-height: 0;
        padding: 20px;
        border-radius: 20px;
    }

    .changelog-entry:hover {
        transform: none;
    }

    .changelog-entry__meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 14px;
    }

    .changelog-entry__content > h2 {
        font-size: 20px;
        line-height: 1.3;
    }

    .changelog-entry__excerpt,
    .changelog-entry__body {
        font-size: 14px;
        line-height: 1.52;
    }

    .changelog-entry__body {
        margin-top: 14px;
    }

    .changelog-poll {
        padding-top: 17px;
    }

    .changelog-poll__actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .changelog-poll__footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .changelog-poll__bar {
        width: 100%;
    }

    .changelog-empty {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .changelog-empty h2 {
        font-size: 24px;
    }
}

@media (max-width: 390px) {
    .changelog-hero {
        padding: 24px 18px;
        border-radius: 20px;
    }

    .changelog-hero h1 {
        font-size: 32px;
    }

    .changelog-entry {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .changelog-entry,
    .changelog-filters a,
    .changelog-poll,
    .changelog-poll__vote,
    .changelog-poll__bar span {
        transition: none;
    }
}
