body:has(.forum-container) .main-container,
body:has(.forum-detail-container) .main-container,
body:has(.editor-wrapper) .main-container {
    padding-block: var(--space-8) var(--space-12);
}

.forum-container,
.forum-detail-container,
.editor-wrapper {
    width: min(100%, 960px);
    margin-inline: auto;
    display: grid;
    gap: var(--space-6);
    animation: fadeIn var(--transition-slow);
}

.forum-header,
.editor-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.forum-header {
    min-height: auto;
    padding: 14px 18px;
    border-radius: 28px !important;
}

.forum-header .np-kicker {
    margin: 0;
}

.forum-header h2 {
    margin: 0;
}

.forum-header #createPostBtn.btn-primary {
    background: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.forum-header #createPostBtn.btn-primary:hover,
.forum-header #createPostBtn.btn-primary:focus-visible {
    background: #111111 !important;
    border-color: #111111 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.forum-header #createPostBtn.btn-primary:active {
    background: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.forum-header h2,
.editor-hero-title,
.replies-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: var(--leading-tight);
}

.forum-posts,
.replies-list,
.reply-form-container,
.editor-card {
    display: grid;
    gap: 0;
}

.no-posts,
.message,
.helper-box {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: rgba(var(--color-white-rgb), 0.36);
    border: 1px dashed var(--color-border-strong);
    color: var(--text-secondary);
}

.no-posts {
    text-align: center;
}

.reply-form,
.editor-form,
.modal-form {
    display: grid;
    gap: var(--space-5);
}

.form-row,
.form-actions,
.editor-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.form-actions,
.editor-actions {
    justify-content: flex-end;
}

.form-group {
    display: grid;
    gap: var(--space-2);
}

.form-group label {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.reply-content-input {
    min-height: 132px;
}

/* Forum detail reply composer: nested fills preserve a complete G2 outline
   during first paint, focus, and textarea resizing. */
html body.forum-detail-page .reply-form-container .reply-input-shell {
    --reply-input-outline: var(--ds-t-hairline);
    position: relative;
    isolation: isolate;
    width: 100%;
    overflow: hidden;
    padding: 1px;
    border: 0;
    border-radius: clamp(18px, 1.8vw, 24px);
    corner-shape: squircle;
    corner-shape: superellipse(2);
    background: var(--reply-input-outline);
    box-shadow: none;
    transition: background-color 140ms ease;
}

html body.forum-detail-page .reply-form-container .reply-input-shell:focus-within {
    --reply-input-outline: color-mix(in srgb, var(--ds-t-ink) 28%, transparent);
}

html body.forum-detail-page .reply-form-container #replyForm#replyForm .reply-input-shell .reply-content-input.reply-content-input {
    display: block;
    width: 100%;
    min-height: 148px !important;
    max-height: 240px;
    margin: 0;
    padding: 18px 20px !important;
    overflow-y: auto;
    border: 0 !important;
    border-radius: 23px !important;
    corner-shape: squircle;
    corner-shape: superellipse(2);
    outline: 0 !important;
    background: var(--ds-t-surface) !important;
    box-shadow: none !important;
    resize: vertical;
}

html body.forum-detail-page .reply-form-container #replyForm#replyForm .reply-input-shell .reply-content-input.reply-content-input:is(:focus, :focus-visible, :active) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

html body.forum-detail-page .forum-detail-loading-post,
html body.forum-detail-page .forum-detail-loading-reply {
    pointer-events: none;
}

html body.forum-detail-page .forum-detail-skeleton-line,
html body.forum-detail-page .forum-detail-skeleton-meta > span,
html body.forum-detail-page .forum-detail-skeleton-copy > span {
    display: block;
    border-radius: 6px;
    background: color-mix(in srgb, var(--ds-t-ink) 8%, var(--ds-t-surface));
}

html body.forum-detail-page .forum-detail-skeleton-line--title {
    width: min(68%, 520px);
    height: 30px;
}

html body.forum-detail-page .forum-detail-skeleton-line--heading {
    width: 112px;
    height: 22px;
}

html body.forum-detail-page .forum-detail-skeleton-meta {
    display: flex;
    gap: 18px;
    margin-top: 18px;
}

html body.forum-detail-page .forum-detail-skeleton-meta > span {
    width: 108px;
    height: 14px;
}

html body.forum-detail-page .forum-detail-skeleton-copy {
    display: grid;
    gap: 11px;
    margin-top: 26px;
}

html body.forum-detail-page .forum-detail-skeleton-copy > span {
    width: 100%;
    height: 15px;
}

html body.forum-detail-page .forum-detail-skeleton-copy > span:nth-child(2) {
    width: 91%;
}

html body.forum-detail-page .forum-detail-skeleton-copy > span:nth-child(3) {
    width: 72%;
}

html body.forum-detail-page .forum-detail-loading-replies-header {
    min-height: 58px;
}

html body.forum-detail-page .forum-detail-loading-reply {
    min-height: 96px;
}

html body.forum-detail-page .forum-detail-loading-reply .forum-detail-skeleton-copy {
    width: 100%;
    margin-top: 0;
}

@media (max-width: 640px) {
    html body.forum-detail-page .reply-form-container .reply-input-shell {
        border-radius: 20px;
    }

    html body.forum-detail-page .reply-form-container #replyForm#replyForm .reply-input-shell .reply-content-input.reply-content-input {
        min-height: 132px !important;
        border-radius: 19px !important;
        padding: 16px !important;
    }
}

/* Forum detail destructive action must win over the global black button language. */
html body.forum-detail-page #postDetail#postDetail .post-title-row.post-title-row button.delete-post-btn.delete-post-btn.delete-post-btn {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    appearance: none !important;
    color: #c91f2b !important;
    background: rgba(239, 68, 68, 0.16) !important;
    background-color: rgba(239, 68, 68, 0.16) !important;
    background-image: none !important;
    box-shadow: none !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

html body.forum-detail-page #postDetail#postDetail .post-title-row.post-title-row button.delete-post-btn.delete-post-btn.delete-post-btn:is(:hover, :focus-visible) {
    color: #a91622 !important;
    background: rgba(239, 68, 68, 0.24) !important;
    background-color: rgba(239, 68, 68, 0.24) !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* Forum detail — flat, long-form reading layout. */
html body.forum-detail-page {
    --forum-reading-width: 790px;
    --forum-muted: color-mix(in srgb, var(--text-primary) 58%, transparent);
    background: var(--background-color) !important;
}

html body.forum-detail-page .forum-detail-main.main-container {
    width: 100% !important;
    max-width: none !important;
    padding: 58px 28px 96px !important;
    overflow: visible !important;
}

html body.forum-detail-page .forum-detail-container.forum-detail-container {
    width: min(100%, 1180px) !important;
    max-width: none !important;
    margin-inline: auto !important;
    display: block !important;
    animation: none !important;
}

html body.forum-detail-page .forum-article-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--forum-reading-width)) 210px;
    justify-content: center;
    align-items: start;
    gap: 86px;
}

html body.forum-detail-page .forum-article-flow {
    min-width: 0;
}

html body.forum-detail-page #postDetail,
html body.forum-detail-page .post-detail,
html body.forum-detail-page .replies-list,
html body.forum-detail-page .reply-form-container {
    width: 100% !important;
    max-width: none !important;
}

html body.forum-detail-page .post-detail.post-detail {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    corner-shape: initial !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

html body.forum-detail-page .post-detail::before,
html body.forum-detail-page .post-detail::after,
html body.forum-detail-page .replies-list::before,
html body.forum-detail-page .reply-form-container::before {
    content: none !important;
}

html body.forum-detail-page .post-header {
    margin: 0 0 34px;
}

html body.forum-detail-page .post-title-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

html body.forum-detail-page .post-detail .post-title.post-title {
    display: block !important;
    flex: 1;
    margin: 0 !important;
    color: var(--text-primary) !important;
    font-size: clamp(34px, 4vw, 52px) !important;
    font-weight: 760 !important;
    line-height: 1.16 !important;
    letter-spacing: -0.04em !important;
    cursor: text !important;
    text-wrap: balance;
}

html body.forum-detail-page .article-icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--forum-muted);
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

html body.forum-detail-page .article-icon-button:hover,
html body.forum-detail-page .article-icon-button:focus-visible {
    color: var(--danger-color);
    background: color-mix(in srgb, var(--danger-color) 8%, transparent);
}

html body.forum-detail-page .post-title-row .delete-post-btn.delete-post-btn {
    flex: 0 0 42px !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    color: #c91f2b !important;
    background: rgba(239, 68, 68, 0.16) !important;
    box-shadow: none !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    transition: color 140ms ease, background-color 140ms ease !important;
}

html body.forum-detail-page .post-title-row .delete-post-btn.delete-post-btn:is(:hover, :focus-visible) {
    color: #a91622 !important;
    background: rgba(239, 68, 68, 0.24) !important;
    box-shadow: none !important;
}

html body.forum-detail-page .post-title-row .delete-post-btn.delete-post-btn:active {
    color: #991b1b !important;
    background: rgba(220, 38, 38, 0.3) !important;
}

html :is(body.dark-mode, body[data-theme="dark"]).forum-detail-page .post-title-row .delete-post-btn.delete-post-btn {
    color: #fca5a5 !important;
    background: rgba(185, 28, 28, 0.26) !important;
}

html body.forum-detail-page .post-meta-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
    gap: 28px;
    margin-top: 28px;
}

html body.forum-detail-page .post-author-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

html body.forum-detail-page .forum-author-avatar {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    color: var(--text-primary);
    background: color-mix(in srgb, #ff615c 12%, var(--card-background));
    font-size: 15px;
    font-weight: 750;
}

html body.forum-detail-page .forum-author-avatar__fallback {
    display: inline-grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

html body.forum-detail-page .forum-author-avatar > img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    object-fit: cover;
}

html body.forum-detail-page .forum-author-avatar--reply {
    width: 34px;
    height: 34px;
    font-size: 13px;
    background: color-mix(in srgb, #ffd60a 15%, var(--card-background));
}

html body.forum-detail-page .post-author-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

html body.forum-detail-page .post-meta-label,
html body.forum-detail-page .post-meta-facts dt {
    color: var(--forum-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.04em;
}

html body.forum-detail-page .post-author {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    font-size: 14px;
    font-weight: 680;
}

html body.forum-detail-page .post-meta-facts {
    display: flex;
    align-items: end;
    gap: 32px;
    margin: 0;
}

html body.forum-detail-page .post-meta-facts > div {
    display: grid;
    gap: 4px;
}

html body.forum-detail-page .post-meta-facts dd {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text-primary);
    font-size: 13px;
}

html body.forum-detail-page .post-privacy-badge,
html body.forum-detail-page .question-tag {
    font-size: 12px !important;
}

html body.forum-detail-page .article-actions {
    position: sticky;
    top: 112px;
    z-index: 4;
    display: grid;
    width: 56px;
    height: 174px;
    margin: 0 0 -174px -88px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--text-primary) 12%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--card-background) 92%, transparent);
    box-shadow: 0 8px 24px color-mix(in srgb, #000 7%, transparent);
    backdrop-filter: blur(14px);
}

html body.forum-detail-page .article-action {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 0;
    padding: 8px 4px;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 9%, transparent);
    border-radius: 0;
    color: var(--forum-muted);
    background: transparent;
    font: inherit;
    font-size: 10px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

html body.forum-detail-page .article-action:last-child {
    border-bottom: 0;
}

html body.forum-detail-page .article-action i {
    font-size: 16px;
}

html body.forum-detail-page .article-action:hover,
html body.forum-detail-page .article-action:focus-visible,
html body.forum-detail-page .article-action.is-active {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--text-primary) 5%, transparent);
}

html body.forum-detail-page .article-action.is-active:first-child {
    color: #b88700;
}

html body.forum-detail-page .article-action.is-active:nth-child(2) {
    color: #d94a45;
}

html body.forum-detail-page .article-content.forum-markdown-body {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    -webkit-box-orient: initial !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    color: var(--text-primary) !important;
    font-size: 17px !important;
    line-height: 1.86 !important;
    letter-spacing: 0.004em;
}

/* 目录跳转需要稳定的正文几何。长帖已经完成 Markdown/KaTeX 渲染，
   不再让每个块反复进入/退出 content-visibility，避免目标坐标变化造成激活线来回修正。 */
html body.forum-detail-page .article-content.forum-markdown-body > * {
    content-visibility: visible !important;
    contain-intrinsic-size: auto !important;
}

/* 打印必须还原，否则视口外内容不进 PDF */
@media print {
    html body.forum-detail-page .article-content.forum-markdown-body > * {
        content-visibility: visible;
    }
}

html body.forum-detail-page .article-content.forum-markdown-body > :first-child {
    margin-top: 0 !important;
}

html body.forum-detail-page .article-content.forum-markdown-body :is(p, ul, ol, blockquote, pre, table, .katex-display) {
    margin-block: 18px !important;
}

html body.forum-detail-page .article-content.forum-markdown-body :is(h2, h3) {
    color: var(--text-primary) !important;
    font-weight: 750 !important;
    letter-spacing: -0.025em !important;
    scroll-margin-top: 100px;
}

html body.forum-detail-page .article-content.forum-markdown-body h2 {
    margin: 52px 0 20px !important;
    padding-bottom: 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 15%, transparent);
    font-size: 27px !important;
    line-height: 1.35 !important;
}

html body.forum-detail-page .article-content.forum-markdown-body h3 {
    margin: 38px 0 14px !important;
    font-size: 21px !important;
    line-height: 1.42 !important;
}

html body.forum-detail-page .article-content.forum-markdown-body :is(ul, ol) {
    padding-left: 1.55em !important;
}

html body.forum-detail-page .article-content.forum-markdown-body li + li {
    margin-top: 7px;
}

html body.forum-detail-page .article-content.forum-markdown-body blockquote {
    padding: 2px 0 2px 18px !important;
    border-left: 3px solid color-mix(in srgb, var(--text-primary) 24%, transparent) !important;
    color: color-mix(in srgb, var(--text-primary) 70%, transparent) !important;
    background: transparent !important;
}

html body.forum-detail-page .article-content.forum-markdown-body table {
    width: auto !important;
    max-width: 100%;
    border-collapse: collapse !important;
    border: 1px solid color-mix(in srgb, var(--text-primary) 18%, transparent) !important;
    font-size: 15px;
}

html body.forum-detail-page .article-content.forum-markdown-body :is(th, td) {
    padding: 9px 14px !important;
    border: 1px solid color-mix(in srgb, var(--text-primary) 18%, transparent) !important;
    text-align: left;
}

html body.forum-detail-page .article-content.forum-markdown-body th {
    background: color-mix(in srgb, var(--text-primary) 4%, transparent) !important;
    font-weight: 700;
}

html body.forum-detail-page .article-content.forum-markdown-body .katex-display {
    padding-block: 8px;
    overflow-x: auto;
    overflow-y: hidden;
}

html body.forum-detail-page .article-content.forum-markdown-body img,
html body.forum-detail-page .post-images img {
    display: block;
    width: auto;
    max-width: 100% !important;
    height: auto;
    margin-inline: auto;
    border-radius: 0 !important;
    box-shadow: none !important;
}

html body.forum-detail-page .post-images {
    display: grid;
    gap: 24px;
    margin-top: 30px;
}

html body.forum-detail-page .forum-image-preview-trigger {
    display: block;
    width: fit-content;
    margin-inline: auto;
}

html body.forum-detail-page .forum-article-toc {
    position: sticky;
    top: 92px;
    min-width: 0;
}

html body.forum-detail-page .forum-article-toc__inner {
    min-width: 0;
}

html body.forum-detail-page .forum-article-toc__eyebrow {
    display: none;
}

html body.forum-detail-page .forum-article-toc h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html body.forum-detail-page #articleToc {
    display: grid;
    gap: 0;
    width: 210px;
    /* 固定导航下方保留 24px 呼吸空间，目录不会贴到视口底边。 */
    max-height: calc(100dvh - 124px);
    padding: 4px 0 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

html body.forum-detail-page #articleToc.has-overflow-above {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 100%);
}

html body.forum-detail-page #articleToc.has-overflow-below {
    -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 18px), transparent 100%);
}

html body.forum-detail-page #articleToc.has-overflow-above.has-overflow-below {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

html body.forum-detail-page #articleToc::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

html body.forum-detail-page .forum-article-toc__link {
    --toc-marker-length: 22px;
    --toc-marker-scale: 0.55;
    --toc-marker-hover-scale: 0.65;
    position: relative;
    display: flex;
    align-items: center;
    /* 覆盖标记与常驻文字，让文字本身也可点击（52 起始 + 148 文字宽） */
    width: 200px;
    min-height: 20px;
    padding: 4px 0;
    overflow: visible;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}

html body.forum-detail-page .forum-article-toc__link[data-toc-level="1"] {
    --toc-marker-length: 30px;
    --toc-marker-scale: 0.75;
    --toc-marker-hover-scale: 0.85;
}

html body.forum-detail-page .forum-article-toc__link[data-toc-level="3"] {
    --toc-marker-length: 14px;
    --toc-marker-scale: 0.35;
    --toc-marker-hover-scale: 0.45;
}

html body.forum-detail-page .forum-article-toc__marker {
    display: block;
    flex: none;
    width: 40px;
    height: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-primary) 20%, transparent);
    transform: scaleX(var(--toc-marker-scale));
    transform-origin: left center;
    transition:
        transform 130ms cubic-bezier(0.22, 1, 0.36, 1),
        background-color 120ms ease-out;
}

html body.forum-detail-page .forum-article-toc__label {
    position: absolute;
    top: 50%;
    left: 52px;
    width: 148px;
    /* 常驻显示；一行放不下的直接裁切，不留省略号 */
    overflow: hidden;
    color: color-mix(in srgb, var(--text-primary) 76%, transparent);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    pointer-events: none;
    transform: translate3d(0, -50%, 0);
    transition: color 160ms ease-out;
}

html body.forum-detail-page .forum-article-toc__label :is(strong, b) {
    color: var(--text-primary);
    font-weight: 700;
}

html body.forum-detail-page .forum-article-toc__label :is(em, i) {
    font-style: italic;
}

html body.forum-detail-page .forum-article-toc__label code {
    padding: 1px 3px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--text-primary) 7%, transparent);
    font-size: 0.92em;
}

html body.forum-detail-page .forum-article-toc__label .katex {
    font-size: 1em;
}

html body.forum-detail-page .forum-article-toc__link:hover .forum-article-toc__label,
html body.forum-detail-page .forum-article-toc__link:focus-visible .forum-article-toc__label {
    color: var(--text-primary);
}

html body.forum-detail-page .forum-article-toc__link:hover .forum-article-toc__marker,
html body.forum-detail-page .forum-article-toc__link:focus-visible .forum-article-toc__marker {
    transform: scaleX(var(--toc-marker-hover-scale));
    background: color-mix(in srgb, var(--text-primary) 48%, transparent);
}

html body.forum-detail-page .forum-article-toc__link:focus-visible {
    outline: 1px solid color-mix(in srgb, var(--text-primary) 34%, transparent);
    outline-offset: 2px;
}

html body.forum-detail-page .forum-article-toc__link.is-active .forum-article-toc__marker {
    transform: scaleX(1);
    background: color-mix(in srgb, var(--text-primary) 82%, transparent);
}

/* 文字常驻后仅靠 2px 标记不足以认出当前节，文字同步加深（不动字重，避免宽度跳变） */
html body.forum-detail-page .forum-article-toc__link.is-active .forum-article-toc__label {
    color: var(--text-primary);
}

@media (prefers-reduced-motion: reduce) {
    html body.forum-detail-page #articleToc {
        scroll-behavior: auto;
    }

    html body.forum-detail-page .forum-article-toc__marker {
        transition: none;
    }

    html body.forum-detail-page .forum-article-toc__label {
        transition: none;
    }
}

html body.forum-detail-page .replies-list.replies-list,
html body.forum-detail-page .reply-form-container.reply-form-container {
    margin: 74px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    corner-shape: initial !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

html body.forum-detail-page .replies-header {
    display: flex !important;
    align-items: end !important;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 8px;
    padding: 0 0 18px !important;
    border: 0 !important;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 15%, transparent) !important;
    background: transparent !important;
}

html body.forum-detail-page .replies-kicker,
html body.forum-detail-page .reply-composer-kicker {
    margin: 0 0 5px;
    color: var(--forum-muted);
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.18em;
}

html body.forum-detail-page .replies-header h2,
html body.forum-detail-page .reply-composer-heading h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 24px;
    line-height: 1.25;
}

html body.forum-detail-page .reply-sort .filter-select {
    min-width: 118px;
    height: 36px;
    padding: 0 30px 0 12px;
    border-radius: 7px;
    font-size: 12px;
}

html body.forum-detail-page .post-reply.post-reply {
    position: relative;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: start !important;
    gap: 13px !important;
    margin: 0 !important;
    padding: 22px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 15px;
}

html body.forum-detail-page .reply-content-wrapper {
    display: block !important;
    min-width: 0;
}

html body.forum-detail-page .reply-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

html body.forum-detail-page .reply-author {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--text-primary);
    font-size: 14px;
}

html body.forum-detail-page .reply-time {
    color: var(--forum-muted);
    font-size: 12px;
}

html body.forum-detail-page .reply-content.reply-content {
    overflow: visible !important;
    color: var(--text-primary) !important;
    line-height: 1.72 !important;
    text-overflow: initial !important;
    white-space: normal !important;
}

html body.forum-detail-page .reply-content > :first-child,
html body.forum-detail-page .reply-content > :last-child {
    margin-block: 0;
}

html body.forum-detail-page .reply-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

html body.forum-detail-page .no-replies {
    padding: 34px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-size: 14px;
}

html body.forum-detail-page .reply-composer-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

html body.forum-detail-page .reply-limit-note {
    color: var(--forum-muted);
    font-size: 12px;
}

html body.forum-detail-page .reply-form.reply-form {
    display: grid;
    gap: 14px;
}

html body.forum-detail-page .reply-composer-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

html body.forum-detail-page .reply-composer-toolbar .form-group {
    min-width: 0;
}

html body.forum-detail-page .reply-image-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

html body.forum-detail-page .reply-composer-toolbar .form-actions {
    flex-wrap: nowrap;
}

@media (max-width: 1100px) {
    html body.forum-detail-page .forum-article-layout {
        grid-template-columns: minmax(0, var(--forum-reading-width));
    }

    html body.forum-detail-page .forum-article-toc {
        display: none;
    }
}

@media (max-width: 900px) {
    html body.forum-detail-page .forum-detail-main.main-container {
        padding-top: 36px !important;
    }

    html body.forum-detail-page .article-actions {
        position: static;
        display: flex;
        width: fit-content;
        height: auto;
        margin: 24px 0 28px;
        overflow: visible;
        border-radius: 8px;
        backdrop-filter: none;
    }

    html body.forum-detail-page .article-action {
        grid-template-columns: auto auto;
        gap: 7px;
        min-width: 78px;
        min-height: 42px;
        border-bottom: 0;
        border-right: 1px solid color-mix(in srgb, var(--text-primary) 9%, transparent);
        font-size: 12px;
    }

    html body.forum-detail-page .article-action:last-child {
        border-right: 0;
    }
}

@media (max-width: 640px) {
    html body.forum-detail-page .forum-detail-main.main-container {
        padding: 26px 18px 72px !important;
    }

    html body.forum-detail-page .post-detail .post-title.post-title {
        font-size: 31px !important;
        line-height: 1.2 !important;
    }

    html body.forum-detail-page .post-meta-grid {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 16px;
        margin-top: 22px;
    }

    html body.forum-detail-page .post-meta-facts {
        gap: 22px;
    }

    html body.forum-detail-page .article-content.forum-markdown-body {
        font-size: 16px !important;
        line-height: 1.8 !important;
    }

    html body.forum-detail-page .article-content.forum-markdown-body h2 {
        margin-top: 42px !important;
        font-size: 23px !important;
    }

    html body.forum-detail-page .article-content.forum-markdown-body h3 {
        font-size: 19px !important;
    }

    html body.forum-detail-page .article-content.forum-markdown-body table {
        min-width: 560px;
    }

    html body.forum-detail-page .article-content.forum-markdown-body .markdown-table-scroll {
        overflow-x: auto;
    }

    html body.forum-detail-page .replies-list.replies-list,
    html body.forum-detail-page .reply-form-container.reply-form-container {
        margin-top: 58px !important;
    }

    html body.forum-detail-page .post-reply.post-reply {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    html body.forum-detail-page .post-reply .article-icon-button {
        position: absolute;
        top: 18px;
        right: 0;
    }

    html body.forum-detail-page .reply-composer-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    html body.forum-detail-page .reply-composer-toolbar .form-actions {
        justify-content: flex-end;
    }
}

/* Forum index uses one continuous outer surface. Rows and the page toolbar stay flat. */
html body.forum-page .main-container.main-container {
    padding-block: 36px 84px !important;
}

html body.forum-page .forum-container.forum-container {
    width: min(100%, 1120px);
    gap: 24px !important;
}

html body.forum-page .forum-header.forum-header.forum-header {
    min-height: 0 !important;
    padding: 0 2px !important;
    border: 0 !important;
    border-radius: 0 !important;
    corner-shape: initial !important;
    background: transparent !important;
    box-shadow: none !important;
}

html body.forum-page .forum-header .np-kicker {
    display: none;
}

html body.forum-page .forum-header h2 {
    font-size: 28px;
}

html body.forum-page .forum-index {
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 24px;
    corner-shape: squircle;
    corner-shape: superellipse(2);
    background:
        linear-gradient(var(--ds-t-surface) 0 0) padding-box,
        linear-gradient(var(--ds-t-hairline) 0 0) border-box;
    box-shadow: none;
}

html body.forum-page .forum-index__header {
    display: flex;
    align-items: center;
    min-height: 88px;
    padding: 0 36px;
    border-bottom: 1px solid var(--ds-t-hairline-soft);
    background: var(--ds-t-surface);
}

html body.forum-page .forum-index__header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 650;
    line-height: 1.3;
}

html body.forum-page #forumPosts#forumPosts {
    display: grid !important;
    gap: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--ds-t-surface) !important;
}

html body.forum-page #forumPosts#forumPosts > .forum-post.forum-post {
    display: grid !important;
    min-height: 112px !important;
    padding: 25px 36px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--ds-t-hairline-soft) !important;
    border-radius: 0 !important;
    corner-shape: initial !important;
    background: var(--ds-t-surface) !important;
    box-shadow: none !important;
}

html body.forum-page #forumPosts#forumPosts > .forum-post.forum-post:last-child {
    border-bottom: 0 !important;
}

html body.forum-page #forumPosts .forum-post .post-header {
    display: block !important;
}

html body.forum-page #forumPosts .forum-post .post-header > div {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-content: center !important;
    gap: 10px !important;
}

html body.forum-page #forumPosts .forum-post h3 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 0;
    margin: 0;
    font-size: inherit;
}

html body.forum-page #forumPosts .forum-post .post-title.post-title {
    display: inline !important;
    overflow: visible !important;
    color: var(--ds-t-ink) !important;
    font-size: 19px !important;
    font-weight: 620 !important;
    line-height: 1.4 !important;
    text-decoration: none;
    text-overflow: clip !important;
    white-space: normal !important;
}

html body.forum-page #forumPosts .forum-post .question-tag.question-tag {
    display: inline-flex !important;
    max-width: min(100%, 520px) !important;
    min-height: var(--ds-tag-height, 32px) !important;
    padding: 0 var(--ds-tag-padding-inline, 9px) !important;
    border-radius: var(--ds-tag-radius, 4px) !important;
    font-size: var(--ds-tag-font-size, 13px) !important;
    overflow: hidden;
    border: 1px solid var(--ds-t-hairline) !important;
    border-radius: 4px !important;
    background: color-mix(in srgb, var(--ds-t-ink) 5%, var(--ds-t-surface)) !important;
    color: color-mix(in srgb, var(--ds-t-ink) 72%, transparent) !important;
    font-size: 13px !important;
    font-weight: 560 !important;
    line-height: 1.2 !important;
    text-overflow: ellipsis;
    white-space: nowrap !important;
}

html body.forum-page #forumPosts .forum-post .post-meta.post-meta {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px 20px !important;
    min-width: 0 !important;
    margin: 0 !important;
    color: color-mix(in srgb, var(--ds-t-ink) 58%, transparent) !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    white-space: normal !important;
}

html body.forum-page #forumPosts .forum-post .post-meta > span:last-child {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

html body.forum-page #forumPosts .forum-post .forum-post-author {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

html body:is(.forum-page, .forum-detail-page) :is(
    .forum-post-author,
    .post-author,
    .reply-author
) .role-tag {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    margin-left: 0 !important;
    padding: 0 5px !important;
    border: 0 !important;
    border-radius: 2px !important;
    font-family: var(--ds-font) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 18px !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap !important;
    box-shadow: none !important;
}

html body.forum-page #forumPosts .forum-post .forum-post-author {
    gap: 2px;
}

html body.forum-page #forumPosts[data-page-skeleton="forum"] .page-skeleton__stack {
    align-content: center;
    gap: 12px;
}

html body.forum-page #forumPosts[data-page-skeleton="forum"] .page-skeleton__block {
    border-radius: 5px;
}

html body.forum-page #forumPosts[data-page-skeleton="forum"] .page-skeleton__block--title {
    width: min(58%, 360px);
    height: 19px;
}

html body.forum-page #forumPosts[data-page-skeleton="forum"] .page-skeleton__meta {
    gap: 20px;
}

html body.forum-page #forumPosts > .page-state {
    min-height: 240px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

html body.forum-page .forum-index__load-more {
    display: block !important;
    width: 100%;
    min-height: 44px;
    padding: 10px 20px;
    border: 0;
    border-top: 1px solid var(--ds-t-hairline-soft);
    background: var(--ds-t-surface);
    color: color-mix(in srgb, var(--ds-t-ink) 62%, transparent);
    font: inherit;
    cursor: pointer;
}

html body.forum-page .forum-index__load-more[hidden] {
    display: none !important;
}

html body.forum-page .forum-index__load-more:is(:hover, :focus-visible) {
    background: color-mix(in srgb, var(--ds-t-ink) 4%, var(--ds-t-surface));
    color: var(--ds-t-ink);
}

html body.forum-page .forum-index__load-more[data-state="loading"] {
    cursor: progress;
}

@media (max-width: 640px) {
    html body.forum-page .main-container.main-container {
        padding-block: 24px 56px !important;
    }

    html body.forum-page .forum-container.forum-container {
        gap: 18px !important;
    }

    html body.forum-page .forum-header.forum-header.forum-header {
        flex-direction: row;
        align-items: center;
        padding-inline: 1px !important;
    }

    html body.forum-page .forum-header h2 {
        font-size: 24px;
    }

    html body.forum-page .forum-header .btn {
        width: auto;
    }

    html body.forum-page .forum-index {
        border-radius: 20px;
    }

    html body.forum-page .forum-index__header {
        min-height: 68px;
        padding-inline: 20px;
    }

    html body.forum-page .forum-index__header h3 {
        font-size: 19px;
    }

    html body.forum-page #forumPosts#forumPosts > .forum-post.forum-post {
        min-height: 100px !important;
        padding: 20px !important;
    }

    html body.forum-page #forumPosts .forum-post .post-title.post-title {
        font-size: 17px !important;
    }

    html body.forum-page #forumPosts .forum-post .question-tag.question-tag {
        max-width: 100% !important;
    }

    html body.forum-page #forumPosts .forum-post .post-meta.post-meta {
        gap: 6px 14px !important;
        font-size: 13px !important;
    }
}

.replies-list,
.reply-form-container,
.post-detail-card {
    padding: var(--space-5);
    border-radius: var(--mr-radius);
    background: var(--card-background);
    box-shadow: var(--mr-shadow-sm);
}

.editor-hero-sub,
.form-text,
.helper-box,
.post-detail-meta {
    color: var(--text-secondary);
}

body.dark-mode .no-posts,
body.dark-mode .message,
body.dark-mode .helper-box,
[data-theme="dark"] .no-posts,
[data-theme="dark"] .message,
[data-theme="dark"] .helper-box {
    background: rgba(15, 23, 42, 0.46);
}

@media (max-width: 640px) {

    .forum-header,
    .editor-hero,
    .form-row,
    .form-actions,
    .editor-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .forum-header .btn,
    .editor-actions .btn,
    .form-actions .btn {
        width: 100%;
    }
}

html body.forum-create-page .main-container {
    padding-block: 40px 88px !important;
}

html body.forum-create-page .main-container.main-container.main-container.main-container {
    width: 100% !important;
    max-width: none !important;
}

html body.forum-create-page .forum-container {
    width: min(100% - 48px, var(--ds-container)) !important;
    max-width: var(--ds-container) !important;
    gap: 44px !important;
}

html body.forum-create-page .forum-container.forum-container.forum-container.forum-container {
    width: min(100% - 48px, var(--ds-container)) !important;
    max-width: var(--ds-container) !important;
    margin-inline: auto !important;
}

html body.forum-create-page .forum-create-header.forum-create-header.forum-create-header {
    min-height: 112px !important;
    padding: 28px 32px !important;
    border-radius: 8px !important;
    background: var(--ds-t-surface-soft) !important;
}

html body.forum-create-page .forum-create-header h2 {
    font-size: clamp(2rem, 4vw, 3.25rem) !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
}

.post-editor {
    padding-inline: 32px;
}

.post-editor-form {
    display: grid;
    gap: 32px !important;
}

.post-title-field {
    width: min(72%, 820px);
}

html body.forum-create-page #postCreateForm#postCreateForm :is(.form-group > label, .post-visibility-label) {
    display: flex;
    align-items: center;
    min-height: 22px;
    margin: 0;
    color: var(--ds-t-ink) !important;
    font-family: var(--ds-font) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
}

html body.forum-create-page .forum-container #postCreateForm :is(input[type="text"], textarea) {
    border-radius: 8px !important;
}

html body.forum-create-page .forum-container #postCreateForm textarea {
    min-height: 300px !important;
    height: min(40vh, 420px) !important;
    padding: 18px 20px !important;
}

.post-image-field {
    gap: 12px !important;
}

.post-image-row,
.post-image-preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.post-image-preview:empty {
    display: none;
}

.post-image-button,
html body.forum-create-page .forum-container #postCreateForm#postCreateForm .post-image-button.post-image-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;
    width: auto !important;
    min-width: 142px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    border: 0 !important;
    border-radius: 22px !important;
    outline: 0 !important;
    background: var(--ds-t-primary) !important;
    color: var(--ds-t-on-primary) !important;
    box-shadow: none !important;
    cursor: pointer;
    font-size: 16px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.post-image-button > :is(span, i) {
    color: var(--ds-t-on-primary) !important;
}

.post-image-button::before,
.post-image-button::after {
    content: none !important;
    display: none !important;
}

.post-publish-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--ds-t-hairline);
}

.post-publish-settings {
    display: grid;
    grid-template-columns: minmax(180px, 220px) 240px;
    align-items: end;
    gap: 18px;
}

.post-question-field,
.post-visibility-fieldset {
    display: grid;
    grid-template-rows: 22px 44px;
    gap: 10px !important;
    min-width: 0;
    margin: 0 !important;
}

.post-visibility-fieldset {
    padding: 0;
    border: 0;
}

.post-question-field input {
    width: 100%;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.post-visibility-switch {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 240px;
    height: 44px;
    padding: 3px;
    box-sizing: border-box;
    border: 0;
    border-radius: 22px;
    background: var(--ds-t-surface-soft);
    isolation: isolate;
}

.post-visibility-slider {
    position: absolute;
    z-index: -1;
    inset: 3px auto 3px 3px;
    width: calc((100% - 6px) / 2);
    border-radius: 19px;
    background: var(--ds-t-primary);
    transition: transform 180ms ease;
}

.post-visibility-switch:has(input[value="private"]:checked) .post-visibility-slider {
    transform: translateX(100%);
}

.post-visibility-switch label {
    position: relative;
    display: block;
    cursor: pointer;
}

.post-visibility-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.post-visibility-switch label > span {
    display: grid;
    width: 100%;
    height: 38px;
    padding: 0 16px;
    place-items: center;
    box-sizing: border-box;
    color: var(--ds-t-ink);
    font-size: 16px !important;
    font-weight: var(--ds-weight-button);
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
    transition: color 150ms ease;
}

.post-visibility-switch label:has(input:checked) > span {
    color: var(--ds-t-on-primary) !important;
}

html body.forum-create-page .forum-container #postCreateForm .form-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    padding: 0 !important;
}

html body.forum-create-page .forum-container #postCreateForm#postCreateForm .form-actions.form-actions > .btn,
html body.forum-create-page .forum-back-button {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 18px !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    white-space: nowrap;
}

html body.forum-create-page .forum-container #postCreateForm#postCreateForm .post-submit-button {
    padding-inline: 20px !important;
}

html body.forum-create-page :is(.btn, button, label.btn) {
    transition: background-color var(--ds-transition-fast), color var(--ds-transition-fast), transform 120ms ease !important;
}

html body.forum-create-page :is(.btn, button, label.btn):is(:hover, :focus, :focus-visible, :active) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

html body.forum-create-page :is(.btn-primary, .btn-secondary, .post-image-button):hover {
    background: #171717 !important;
    color: #ffffff !important;
}

html body.forum-create-page :is(.btn-primary, .btn-secondary, .post-image-button):active {
    transform: translateY(1px) !important;
}

.post-privacy-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid currentColor;
    border-radius: var(--ds-rounded-pill);
    font-family: var(--ds-font-mono);
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}

@media (max-width: 900px) {
    .post-title-field {
        width: 100%;
    }

    .post-publish-bar {
        grid-template-columns: 1fr;
    }

    html body.forum-create-page .forum-container #postCreateForm .form-actions {
        justify-content: flex-start !important;
    }
}

/* Form-specific height lock beats the shared compatibility bridge without
 * changing the global textarea contract. */
html body.forum-create-page #postCreateForm#postCreateForm#postCreateForm#postCreateForm#postCreateForm textarea#postContent {
    min-height: 280px !important;
    height: clamp(280px, 42vh, 360px) !important;
    padding: 12px !important;
    line-height: 1.35 !important;
}

@media (max-width: 640px) {
    html body.forum-create-page #postCreateForm#postCreateForm#postCreateForm#postCreateForm#postCreateForm textarea#postContent {
        min-height: 230px !important;
        height: min(28vh, 250px) !important;
    }
}

@media (max-width: 640px) {
    html body.forum-create-page .main-container {
        padding-block: 24px 56px !important;
    }

    html body.forum-create-page .forum-container {
        width: min(100% - 24px, var(--ds-container)) !important;
        gap: 28px !important;
    }

    html body.forum-create-page .forum-create-header.forum-create-header.forum-create-header {
        display: flex !important;
        flex-direction: column !important;
        min-height: auto !important;
        padding: 22px 20px !important;
        align-items: flex-start !important;
        gap: 18px !important;
    }

    html body.forum-create-page .forum-create-header h2 {
        font-size: 2rem !important;
    }

    html body.forum-create-page .forum-back-button {
        align-self: flex-start;
    }

    .post-editor {
        padding-inline: 4px;
    }

    .post-editor-form {
        gap: 26px !important;
    }

    html body.forum-create-page .forum-container #postCreateForm textarea {
        min-height: 260px !important;
        height: 42vh !important;
    }

    .post-publish-settings {
        grid-template-columns: 1fr;
    }

    .post-visibility-switch {
        width: min(100%, 280px);
    }

    html body.forum-create-page .forum-container #postCreateForm .form-actions {
        flex-direction: row !important;
        align-items: center !important;
    }
}

/* Forum composer: DESIGN.md editorial workbench, selected Product Design direction 2. */
html body.forum-create-page .main-container {
    width: 100% !important;
    max-width: none !important;
    padding-inline: 0 !important;
    padding-block: 32px 96px !important;
}

html body.forum-create-page .forum-container {
    width: min(100% - 48px, var(--ds-container)) !important;
    max-width: var(--ds-container) !important;
    gap: 52px !important;
}

html body.forum-create-page .forum-create-header.forum-create-header.forum-create-header {
    min-height: 180px !important;
    padding: 40px 48px !important;
    border-radius: var(--ds-rounded-lg) !important;
    background: var(--ds-t-block-cream, #f4ecd6) !important;
}

html body.forum-create-page .forum-create-header h2 {
    font-size: clamp(2.75rem, 4vw, 3.5rem) !important;
    font-weight: 540 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
}

html body.forum-create-page .post-editor {
    padding-inline: 24px;
}

html body.forum-create-page .post-editor-form {
    display: block !important;
    padding: 0 !important;
}

html body.forum-create-page .post-workbench {
    display: grid;
    grid-template-columns: minmax(0, 2.6fr) minmax(280px, 1fr);
    align-items: stretch;
    gap: 40px;
}

html body.forum-create-page .post-writing-column {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
    gap: 44px;
    min-width: 0;
}

html body.forum-create-page .post-title-field {
    width: 100%;
    max-width: none;
}

html body.forum-create-page #postCreateForm#postCreateForm :is(.form-group > label, .post-visibility-label) {
    min-height: 24px;
    font-size: 16px !important;
    font-weight: 540 !important;
    line-height: 1.45 !important;
}

html body.forum-create-page .forum-container #postCreateForm :is(input[type="text"], textarea) {
    border-radius: var(--ds-rounded-md) !important;
    font-size: 16px !important;
    line-height: 1.45 !important;
}

html body.forum-create-page .forum-container #postCreateForm textarea {
    min-height: 430px !important;
    height: min(50vh, 500px) !important;
    padding: 18px !important;
}

html body.forum-create-page .post-publish-rail {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-left: 40px;
    border-left: 1px solid var(--ds-t-hairline);
}

html body.forum-create-page .post-image-field {
    gap: 16px !important;
}

html body.forum-create-page .post-image-preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

html body.forum-create-page .forum-container #postCreateForm#postCreateForm .post-image-button.post-image-button {
    justify-self: start !important;
    align-self: start !important;
    width: auto !important;
    min-width: 184px !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    border-radius: var(--ds-rounded-pill) !important;
}

html body.forum-create-page .post-question-field,
html body.forum-create-page .post-visibility-fieldset {
    display: grid;
    grid-template-rows: 24px 48px;
    gap: 12px !important;
    width: 100%;
    min-width: 0;
}

html body.forum-create-page .post-question-field {
    margin-top: 68px !important;
}

html body.forum-create-page .post-visibility-fieldset {
    margin-top: 64px !important;
}

html body.forum-create-page .post-question-field input {
    width: 100%;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
}

html body.forum-create-page .post-visibility-switch {
    width: 100%;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: var(--ds-rounded-pill);
}

html body.forum-create-page .post-visibility-slider {
    inset: 0 auto 0 0;
    width: 50%;
    border-radius: var(--ds-rounded-pill);
}

html body.forum-create-page .post-visibility-switch label > span {
    height: 48px;
    font-size: 16px !important;
}

html body.forum-create-page .forum-container #postCreateForm .form-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 18px !important;
    margin-top: auto !important;
    padding: 72px 0 0 !important;
}

html body.forum-create-page .forum-container #postCreateForm#postCreateForm .form-actions.form-actions > .btn,
html body.forum-create-page .forum-back-button {
    width: auto !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

html body.forum-create-page .forum-container #postCreateForm#postCreateForm .post-submit-button {
    min-width: 168px !important;
    padding-inline: 24px !important;
}

html body.forum-create-page .forum-container #postCreateForm#postCreateForm .post-cancel-button {
    min-width: auto !important;
    padding-inline: 12px !important;
    background: transparent !important;
    color: var(--ds-t-ink) !important;
}

html body.forum-create-page .forum-container #postCreateForm#postCreateForm .post-cancel-button:hover {
    background: var(--ds-t-surface-soft) !important;
    color: var(--ds-t-ink) !important;
}

@media (max-width: 900px) {
    html body.forum-create-page .post-workbench {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    html body.forum-create-page .post-publish-rail {
        display: grid;
        grid-template-columns: minmax(140px, 0.75fr) minmax(180px, 1fr) minmax(220px, 1.15fr);
        align-items: end;
        gap: 20px;
        padding: 32px 0 0;
        border-top: 1px solid var(--ds-t-hairline);
        border-left: 0;
    }

    html body.forum-create-page :is(.post-question-field, .post-visibility-fieldset) {
        margin-top: 0 !important;
    }

    html body.forum-create-page .forum-container #postCreateForm .form-actions {
        grid-column: 1 / -1;
        justify-content: flex-end !important;
        margin-top: 8px !important;
        padding-top: 16px !important;
    }
}

@media (max-width: 640px) {
    html body.forum-create-page .main-container {
        padding-block: 24px 56px !important;
    }

    html body.forum-create-page .forum-container {
        width: min(100% - 24px, var(--ds-container)) !important;
        gap: 28px !important;
    }

    html body.forum-create-page .forum-create-header.forum-create-header.forum-create-header {
        min-height: auto !important;
        padding: 24px !important;
        border-radius: var(--ds-rounded-lg) !important;
    }

    html body.forum-create-page .forum-create-header h2 {
        font-size: 2.25rem !important;
    }

    html body.forum-create-page .post-editor {
        padding-inline: 4px;
    }

    html body.forum-create-page .post-writing-column {
        gap: 28px;
    }

    html body.forum-create-page .forum-container #postCreateForm textarea {
        min-height: 300px !important;
        height: 44vh !important;
    }

    html body.forum-create-page .post-publish-rail {
        display: grid;
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: 28px;
    }

    html body.forum-create-page .post-visibility-switch {
        width: min(100%, 320px);
    }

    html body.forum-create-page .forum-container #postCreateForm .form-actions {
        grid-column: auto;
        justify-content: flex-start !important;
        gap: 12px !important;
        margin-top: 0 !important;
        padding-top: 4px !important;
    }

    html body.forum-create-page .forum-container #postCreateForm#postCreateForm .post-submit-button {
        min-width: 150px !important;
    }
}

/* Compact composer header: a quiet application bar instead of a display
 * banner. It keeps the G2 card language while removing the oversized pastel
 * block and excess vertical distance before the editor. */
html body.forum-create-page .main-container.main-container {
    padding-block: 24px 72px !important;
}

html body.forum-create-page .forum-container.forum-container {
    gap: 22px !important;
}

html body.forum-create-page .forum-container .forum-create-header.forum-create-header.forum-create-header {
    box-sizing: border-box !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 72px !important;
    padding: 14px 16px !important;
    overflow: clip !important;
    border: 1px solid transparent !important;
    border-radius: var(--ds-ui-card-radius, 24px) !important;
    corner-shape: superellipse(2) !important;
    background:
        linear-gradient(var(--ds-t-surface) 0 0) padding-box,
        linear-gradient(var(--ds-t-hairline) 0 0) border-box !important;
    color: var(--ds-t-ink) !important;
    box-shadow: none !important;
}

html body.forum-create-page .forum-container .forum-create-header h2 {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    color: var(--ds-t-ink) !important;
    font-family: var(--ds-font) !important;
    font-size: clamp(24px, 3vw, 27px) !important;
    font-weight: 680 !important;
    line-height: 1.05 !important;
    letter-spacing: -.035em !important;
}

html body.forum-create-page .forum-container .forum-back-button.forum-back-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: auto !important;
    min-width: 0 !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 0 12px !important;
    border: 1px solid var(--ds-t-hairline) !important;
    border-radius: var(--ds-rounded-full) !important;
    background: var(--ds-t-surface) !important;
    color: var(--ds-t-ink) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    box-shadow: none !important;
}

html body.forum-create-page .forum-container .forum-back-button.forum-back-button:is(:hover, :focus-visible) {
    border-color: var(--ds-t-hairline) !important;
    background: var(--ds-t-surface-soft) !important;
    color: var(--ds-t-ink) !important;
}

html body.forum-create-page .forum-container .forum-back-button i {
    color: currentColor !important;
    font-size: 10px !important;
}

html body.forum-create-page .forum-container #cancelBtn#cancelBtn#cancelBtn#cancelBtn#cancelBtn.forum-back-button {
    box-sizing: border-box !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0 10px !important;
    border: 1px solid #111111 !important;
    background: #111111 !important;
    color: #ffffff !important;
    font-size: 11px !important;
}

html body.forum-create-page .forum-container #cancelBtn#cancelBtn#cancelBtn#cancelBtn#cancelBtn.forum-back-button:is(:hover, :focus-visible) {
    border-color: #2b2b2b !important;
    background: #2b2b2b !important;
    color: #ffffff !important;
}

@media (max-width: 640px) {
    html body.forum-create-page .main-container.main-container {
        padding-block: 18px 52px !important;
    }

    html body.forum-create-page .forum-container.forum-container {
        gap: 18px !important;
    }

    html body.forum-create-page .forum-container .forum-create-header.forum-create-header.forum-create-header {
        flex-direction: row !important;
        align-items: center !important;
        min-height: 64px !important;
        padding: 12px 13px !important;
        gap: 12px !important;
    }

    html body.forum-create-page .forum-container .forum-create-header h2 {
        font-size: 23px !important;
    }

    html body.forum-create-page .forum-container #cancelBtn#cancelBtn#cancelBtn#cancelBtn#cancelBtn.forum-back-button {
        align-self: center !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        padding-inline: 9px !important;
        font-size: 11px !important;
    }
}

/* Final compact composer layout. */
html body.forum-create-page .main-container.main-container {
    padding-block: 18px 52px !important;
}

html body.forum-create-page .forum-container.forum-container {
    gap: 16px !important;
}

html body.forum-create-page .forum-container .forum-create-header.forum-create-header.forum-create-header {
    min-height: 64px !important;
    padding: 12px 14px !important;
}

html body.forum-create-page .forum-container .forum-create-header h2 {
    font-size: 24px !important;
    line-height: 1 !important;
}

html body.forum-create-page .post-editor {
    padding: 4px 14px 0 !important;
    border: 0 !important;
    background: transparent !important;
}

html body.forum-create-page .post-editor-form {
    gap: 0 !important;
}

html body.forum-create-page .post-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px) !important;
    align-items: start !important;
    gap: 24px !important;
}

html body.forum-create-page .post-writing-column {
    grid-template-rows: auto auto !important;
    gap: 14px !important;
}

html body.forum-create-page #postCreateForm#postCreateForm :is(.form-group > label, .post-visibility-label) {
    min-height: 17px !important;
    font-size: 13px !important;
    font-weight: 620 !important;
    line-height: 1.2 !important;
}

html body.forum-create-page .forum-container #postCreateForm :is(input[type="text"], textarea) {
    font-size: 14px !important;
    line-height: 1.35 !important;
}

html body.forum-create-page .forum-container #postCreateForm textarea {
    min-height: 280px !important;
    height: clamp(280px, 42vh, 360px) !important;
    padding: 12px !important;
}

html body.forum-create-page .post-publish-rail {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-content: start !important;
    gap: 16px !important;
    padding: 0 !important;
    border: 0 !important;
}

html body.forum-create-page .post-image-field {
    gap: 6px !important;
}

html body.forum-create-page .forum-container #postCreateForm#postCreateForm .post-image-button.post-image-button {
    min-width: 0 !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding-inline: 12px !important;
    font-size: 13px !important;
}

html body.forum-create-page .post-question-field,
html body.forum-create-page .post-visibility-fieldset {
    grid-template-rows: 17px 36px !important;
    gap: 6px !important;
    margin: 0 !important;
}

html body.forum-create-page .post-question-field input {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
}

html body.forum-create-page .post-visibility-switch {
    width: 100% !important;
    height: 36px !important;
    padding: 3px !important;
}

html body.forum-create-page .post-visibility-slider {
    inset: 3px auto 3px 3px !important;
    width: calc((100% - 6px) / 2) !important;
}

html body.forum-create-page .post-visibility-switch label > span {
    height: 30px !important;
    padding-inline: 10px !important;
    font-size: 13px !important;
}

html body.forum-create-page .forum-container #postCreateForm .form-actions {
    justify-content: flex-end !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 2px 0 0 !important;
}

html body.forum-create-page .forum-container #postCreateForm#postCreateForm .form-actions.form-actions > .btn {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding-inline: 12px !important;
    font-size: 13px !important;
}

html body.forum-create-page .forum-container #postCreateForm#postCreateForm .post-submit-button {
    min-width: 0 !important;
}

@media (max-width: 900px) {
    html body.forum-create-page .post-workbench {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    html body.forum-create-page .post-publish-rail {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        align-items: end !important;
        gap: 12px !important;
        padding: 0 !important;
        border: 0 !important;
    }

    html body.forum-create-page .forum-container #postCreateForm .form-actions {
        grid-column: 1 / -1 !important;
        padding-top: 0 !important;
    }
}

@media (max-width: 640px) {
    html body.forum-create-page .main-container.main-container {
        padding-block: 14px 42px !important;
    }

    html body.forum-create-page .forum-container.forum-container {
        gap: 12px !important;
    }

    html body.forum-create-page .forum-container .forum-create-header.forum-create-header.forum-create-header {
        min-height: 58px !important;
        padding: 10px 12px !important;
    }

    html body.forum-create-page .forum-container .forum-create-header h2 {
        font-size: 21px !important;
    }

    html body.forum-create-page .post-editor {
        padding-inline: 2px !important;
    }

    html body.forum-create-page .post-writing-column {
        gap: 12px !important;
    }

    html body.forum-create-page .forum-container #postCreateForm textarea {
        min-height: 230px !important;
        height: 36vh !important;
    }

    html body.forum-create-page .post-publish-rail {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    html body.forum-create-page .forum-container #postCreateForm .form-actions {
        grid-column: auto !important;
        justify-content: flex-start !important;
    }
}
