.forum-shell {
    width: min(1060px, 100%);
}

@media (min-width: 761px) {
    body.forum-index-page .site-main {
        margin-top: 14px;
    }

    .forum-index-shell {
        gap: 14px;
    }

    .forum-index-shell .forum-header {
        display: none;
    }
}

.topic-detail-layout {
    width: min(1060px, 100%);
}

.topic-form-layout {
    width: min(820px, 100%);
}

.forum-header,
.category-header {
    align-items: center;
}

.forum-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(420px, 100%);
    margin: 0;
    height: 40px;
    min-height: 40px;
    min-width: 0;
    padding: 0 12px;
    box-sizing: border-box;
    background: #2d2d2d;
    border: 1px solid rgb(63, 63, 63);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 160ms ease;
}

.forum-search:focus-within {
    border-color: rgb(110, 110, 110);
    box-shadow: none;
}

.forum-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0 !important;
    color: #fff;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    font: inherit;
}

.forum-search input:focus {
    box-shadow: none !important;
}

.forum-search input::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.forum-search-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
    height: 100%;
    min-height: 0;
    padding: 0 !important;
    margin: 0;
    color: var(--muted);
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    cursor: pointer;
    transition: color 160ms ease;
}

.forum-search-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 160ms ease;
}

.forum-search-button:hover,
.forum-search-button:focus-visible,
.forum-search:focus-within .forum-search-button {
    color: #fff;
    background: transparent !important;
    box-shadow: none !important;
    transform: none;
}

.forum-search:has(input:not(:placeholder-shown)) .forum-search-button {
    color: #fff;
    background: transparent !important;
    box-shadow: none !important;
    transform: none;
}

@media (min-width: 761px) {
    .forum-controls {
        width: 100%;
    }

    .forum-controls .forum-search {
        width: 100%;
    }
}

.forum-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
}

.category-card {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 14px;
    min-width: 0;
    min-height: 142px;
    height: 100%;
    padding: 15px 16px;
    color: var(--text);
    background: rgba(8, 13, 19, 0.62);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.category-card:hover,
.category-card.is-active {
    color: var(--text-strong);
    background: var(--ic-accent-soft, rgba(152, 164, 179, 0.08));
    border-color: rgba(157, 178, 200, 0.34);
    transform: translateY(-1px);
}

.category-card strong,
.category-card small {
    display: block;
}

.category-card-copy {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
}

.category-card strong {
    color: var(--text-strong);
}

.category-card small {
    margin-top: 0;
    color: var(--muted);
}

.category-card-description {
    display: -webkit-box;
    min-height: 2.8em;
    overflow: hidden;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.category-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3px;
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.type-tabs,
.category-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.type-tabs {
    padding: 5px;
    width: fit-content;
    max-width: 100%;
    background: rgba(8, 13, 19, 0.64);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
}

.type-tabs a,
.category-strip a {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 6px 11px;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 850;
}

.type-tabs a:hover,
.type-tabs a.is-active,
.category-strip a:hover,
.category-strip a.is-active {
    color: var(--text-strong);
    background: var(--ic-accent-soft, rgba(152, 164, 179, 0.09));
    border-color: rgba(157, 178, 200, 0.34);
}

.topic-list,
.compact-topic-list {
    display: grid;
    gap: 4px;
}

.topic-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) minmax(150px, auto);
    align-items: center;
    gap: 14px;
    min-width: 0;
    margin-inline: -10px;
    padding: 14px 10px;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.topic-card.has-image-preview {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
}

.topic-card:first-child {
    margin-top: -6px;
}

.topic-card:last-child {
    margin-bottom: -6px;
}

.topic-card:hover {
    background: rgba(152, 164, 179, 0.065);
    transform: translateY(-1px);
}

.topic-card:focus-visible {
    outline: 2px solid var(--ic-focus, rgba(157, 178, 200, 0.42));
    outline-offset: 4px;
    border-radius: var(--radius);
}

.topic-card-avatar {
    align-self: start;
    padding-top: 2px;
}

.topic-card-main {
    min-width: 0;
}

.topic-card-badges,
.topic-badge-row,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.topic-card h3 {
    margin: 0 0 7px;
    font-size: clamp(1.02rem, 1.2vw, 1.16rem);
}

.topic-card h3 a {
    color: var(--text-strong);
}

.topic-card h3 a:hover {
    color: var(--accent-strong);
}

.topic-excerpt {
    max-width: 760px;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.9rem;
    overflow-wrap: break-word;
}

.topic-card-image-preview {
    display: block;
    width: min(100%, 560px);
    margin: 2px 0 9px;
    overflow: hidden;
    background: rgba(6, 10, 15, 0.72);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
}

.topic-card-image-preview img {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: cover;
}

.topic-card-image-preview:hover {
    border-color: rgba(157, 178, 200, 0.34);
}

.topic-author-name,
.author-display-name {
    color: var(--text-strong);
    font-weight: 850;
}

.topic-card-side {
    display: grid;
    justify-items: end;
    gap: 10px;
    min-width: 0;
}

.topic-card.has-image-preview .topic-card-side {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 10px;
    padding-top: 0;
}

.topic-card-side .topic-card-badges {
    justify-content: flex-end;
}

.topic-card.has-image-preview .topic-card-badges {
    order: 2;
    justify-content: flex-start;
}

.topic-card-stats {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 92px;
    padding-top: 4px;
}

.topic-card.has-image-preview .topic-card-stats {
    order: 1;
    justify-content: flex-start;
    min-width: 0;
    padding-top: 0;
}

.metric,
.icon-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.metric strong {
    color: var(--text-strong);
}

.icon-action {
    min-height: 31px;
    padding: 5px 10px;
    color: var(--muted);
    background: rgba(8, 13, 19, 0.68);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    cursor: pointer;
    font-weight: 850;
    line-height: 1;
}

.icon-action:hover {
    color: var(--text-strong);
    background: var(--surface-hover);
    border-color: rgba(157, 178, 200, 0.32);
}

.icon-action:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.consent-action.is-active,
.wall-action.is-active {
    color: #071018;
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.inline-action,
.forum-form,
.reply-composer form {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.topic-detail-card {
    display: grid;
    gap: 18px;
}

.topic-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.topic-header-main {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.topic-header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.55rem);
    overflow-wrap: break-word;
}

.author-row {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.author-row-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.author-row .user-name-link {
    color: var(--text-strong);
    font-weight: 900;
}

.topic-actions-menu {
    flex: 0 0 auto;
}

.tag-row {
    margin-top: -4px;
}

.muted-tag {
    opacity: 0.72;
}

.rich-copy {
    min-width: 0;
    color: var(--text);
    line-height: 1.72;
    overflow-wrap: break-word;
    word-break: normal;
}

.rich-copy p,
.rich-copy blockquote,
.rich-copy ul,
.rich-copy ol,
.rich-copy pre {
    margin: 0 0 0.85em;
}

.rich-copy p:last-child,
.rich-copy blockquote:last-child,
.rich-copy ul:last-child,
.rich-copy ol:last-child,
.rich-copy pre:last-child {
    margin-bottom: 0;
}

.rich-copy a {
    color: var(--accent-strong);
    text-decoration: underline;
    text-decoration-color: rgba(196, 212, 228, 0.34);
    text-underline-offset: 3px;
}

.rich-copy blockquote {
    padding: 10px 13px;
    color: var(--accent-strong);
    background: rgba(157, 178, 200, 0.08);
    border-left: 2px solid rgba(157, 178, 200, 0.46);
    border-radius: 12px;
}

.rich-copy code,
.rich-copy pre {
    color: #e6c993;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    font-family: Consolas, "Courier New", monospace;
}

.rich-copy code {
    padding: 1px 5px;
    font-size: 0.92em;
}

.rich-copy pre {
    padding: 11px 12px;
    overflow-x: auto;
}

.rich-copy ul,
.rich-copy ol {
    padding-left: 1.35rem;
}

.rich-copy img,
.rich-copy .forum-topic-image,
.editor-canvas img,
.editor-canvas .forum-topic-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0.85rem auto;
    border-radius: 10px;
}

.rt-size-small,
.rt-size-14 {
    font-size: 0.875rem;
}

.rt-size-16 {
    font-size: 1rem;
}

.rt-size-large,
.rt-size-18 {
    font-size: 1.125rem;
}

.rt-size-heading,
.rt-size-22 {
    font-size: 1.375rem;
    line-height: 1.35;
}

.rt-color-default {
    color: var(--text);
}

.rt-color-red {
    color: #df7f7f;
}

.rt-color-green {
    color: #83c99a;
}

.rt-color-blue {
    color: #8eb0d8;
}

.rt-color-purple {
    color: #b49ad8;
}

.rt-color-gold {
    color: #d8bf7a;
}

.rt-color-muted {
    color: var(--muted);
}

.topic-copy {
    font-size: 1rem;
}

.topic-reaction-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.composer-card {
    padding: 20px;
}

.composer {
    display: grid;
    gap: 13px;
}

.composer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.composer-header h2 {
    margin: 0;
}

.composer-actions {
    display: flex;
    justify-content: flex-end;
}

.editor-shell {
    position: relative;
    display: grid;
    overflow: visible;
    background: rgba(6, 10, 15, 0.82);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.editor-toolbar {
    position: relative;
    z-index: 40;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    overflow: visible;
    padding: 8px;
    background: rgba(19, 26, 36, 0.92);
    border-bottom: 1px solid var(--line-soft);
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

.editor-toolbar button {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 0.86rem;
    font-weight: 850;
}

.editor-toolbar-select {
    min-height: 32px;
    max-width: 112px;
    padding: 0 26px 0 9px;
    color: var(--muted);
    background: rgba(6, 10, 15, 0.46);
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 850;
}

.editor-toolbar-select:hover,
.editor-toolbar-select:focus-visible {
    color: var(--text-strong);
    background: rgba(152, 164, 179, 0.12);
    border-color: var(--line-soft);
}

.editor-toolbar button:hover,
.editor-toolbar button:focus-visible,
.editor-toolbar button.is-active {
    color: var(--text-strong);
    background: rgba(152, 164, 179, 0.14);
    border-color: var(--line-soft);
}

.editor-toolbar button.is-active {
    border-color: rgba(157, 178, 200, 0.42);
    box-shadow: 0 0 0 1px rgba(157, 178, 200, 0.14) inset;
}

.editor-toolbar-popover-wrap {
    position: relative;
    display: inline-flex;
}

.toolbar-size-icon,
.toolbar-color-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1;
}

.toolbar-size-icon {
    font-size: 0.78rem;
}

.toolbar-color-icon {
    position: relative;
    font-size: 0.9rem;
}

.toolbar-color-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 14px;
    height: 2px;
    background: var(--text-strong);
    border-radius: 999px;
    transform: translateX(-50%);
}

.editor-format-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 160;
    display: grid;
    min-width: 132px;
    padding: 5px;
    background: rgba(8, 13, 19, 0.98);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.editor-format-menu[hidden] {
    display: none;
}

.editor-format-menu button {
    justify-content: flex-start;
    width: 100%;
    height: auto;
    min-height: 30px;
    padding: 6px 8px;
    border-radius: 7px;
    font-size: 0.8rem;
    text-align: left;
}

.editor-color-menu button {
    display: flex;
    gap: 8px;
}

.color-swatch {
    width: 11px;
    height: 11px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.color-default {
    background: var(--text);
}

.color-red {
    background: #df7f7f;
}

.color-green {
    background: #83c99a;
}

.color-blue {
    background: #8eb0d8;
}

.color-purple {
    background: #b49ad8;
}

.color-gold {
    background: #d8bf7a;
}

.color-muted {
    background: var(--muted);
}

.toolbar-underline {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.toolbar-image-icon {
    position: relative;
    display: block;
    width: 16px;
    height: 13px;
    border: 2px solid currentColor;
    border-radius: 3px;
}

.toolbar-image-icon::before {
    content: "";
    position: absolute;
    right: 2px;
    top: 2px;
    width: 3px;
    height: 3px;
    background: currentColor;
    border-radius: 999px;
}

.toolbar-image-icon::after {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 2px;
    height: 5px;
    background: currentColor;
    clip-path: polygon(0 100%, 36% 28%, 56% 68%, 72% 42%, 100% 100%);
}

.editor-toolbar .editor-image-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    line-height: 1;
}

.editor-toolbar .editor-image-button.has-image {
    color: var(--danger);
}

.editor-image-button .toolbar-image-icon,
.editor-image-button .toolbar-delete-icon {
    flex: 0 0 auto;
}

.editor-image-button .toolbar-delete-icon {
    display: none;
    align-items: center;
    justify-content: center;
}

.editor-image-button.has-image .toolbar-image-icon {
    display: none;
}

.editor-image-button.has-image .toolbar-delete-icon {
    display: inline-flex;
}

.editor-image-button .toolbar-delete-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.editor-file-input {
    display: none;
}

.editor-upload-status {
    align-self: center;
    min-width: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.editor-upload-status.is-error {
    color: var(--danger);
}

.editor-canvas {
    min-height: 170px;
    padding: 13px 14px;
    color: var(--text);
    outline: none;
    line-height: 1.62;
    overflow-wrap: break-word;
}

.editor-canvas[data-empty]::before {
    content: attr(data-placeholder);
    display: block;
    float: left;
    height: 0;
    color: var(--muted-2);
    pointer-events: none;
}

.editor-canvas:focus {
    box-shadow: 0 0 0 2px rgba(157, 178, 200, 0.2) inset;
}

.editor-canvas p,
.editor-canvas blockquote,
.editor-canvas ul,
.editor-canvas ol {
    margin: 0 0 0.75em;
}

.editor-canvas p:last-child,
.editor-canvas blockquote:last-child,
.editor-canvas ul:last-child,
.editor-canvas ol:last-child {
    margin-bottom: 0;
}

.editor-canvas ul,
.editor-canvas ol {
    padding-left: 1.35rem;
}

.editor-canvas blockquote {
    padding: 9px 11px;
    color: var(--accent-strong);
    background: rgba(157, 178, 200, 0.08);
    border-left: 2px solid rgba(157, 178, 200, 0.42);
    border-radius: 10px;
}

.rich-editor-source {
    display: none;
}

.forum-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.86);
    opacity: 0;
    animation: forum-lightbox-in 160ms ease-out forwards;
}

.forum-image-lightbox__image {
    display: block;
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
}

.forum-image-lightbox__close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    color: var(--text-strong);
    background: transparent;
    border: 0;
    border-radius: 0;
}

.forum-image-lightbox__close::before,
.forum-image-lightbox__close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 24px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transform-origin: center;
}

.forum-image-lightbox__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.forum-image-lightbox__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.forum-image-lightbox__close:hover,
.forum-image-lightbox__close:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

body.forum-lightbox-open {
    overflow: hidden;
}

@keyframes forum-lightbox-in {
    to {
        opacity: 1;
    }
}

.replies-panel {
    display: grid;
    gap: 16px;
}

.thread-list {
    display: grid;
    gap: 0;
}

.thread-list > .comment {
    padding: 18px 0;
    border-top: 1px solid var(--line-soft);
}

.thread-list > .comment:first-child {
    padding-top: 0;
    border-top: 0;
}

.thread-list > .comment:last-child {
    padding-bottom: 0;
}

.comment {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    min-width: 0;
}

.comment-avatar {
    position: relative;
    z-index: 1;
    padding-top: 2px;
}

.comment-body {
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    margin-bottom: 8px;
}

.comment-meta-block {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.comment-author-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.comment-author-row .user-name-link {
    color: var(--text-strong);
    font-weight: 900;
}

.reply-context {
    margin: 0;
    color: var(--muted-2);
    font-size: 0.78rem;
}

.comment-copy {
    max-width: 100%;
}

.comment-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-top: 10px;
}

.reply-composer {
    min-width: 0;
}

.reply-composer[open] {
    flex: 1 1 100%;
}

.reply-composer summary {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 5px 10px;
    color: var(--muted);
    background: rgba(8, 13, 19, 0.64);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 850;
    list-style: none;
}

.reply-composer summary:hover {
    color: var(--text-strong);
    background: var(--surface-hover);
}

.reply-composer summary::-webkit-details-marker {
    display: none;
}

.nested-composer {
    width: min(100%, 680px);
    margin-top: 10px;
}

.nested-composer .editor-canvas {
    min-height: 112px;
}

.nested-composer .composer-actions {
    justify-content: start;
}

.comment.is-accepted > .comment-body {
    padding: 12px;
    background: rgba(112, 176, 133, 0.055);
    border: 1px solid rgba(112, 176, 133, 0.16);
    border-radius: var(--radius);
}

.comment-children {
    position: relative;
    display: grid;
    gap: 0;
    margin-top: 14px;
    margin-left: -28px;
    padding-left: 30px;
}

.comment-children > .comment {
    padding: 12px 0 0;
}

.comment-children .comment-children {
    margin-left: -24px;
    padding-left: 28px;
}

.topic-form {
    display: grid;
    gap: 18px;
}

.topic-form-section {
    display: grid;
    gap: 10px;
}

.choice-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.type-choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-card {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 56px;
    margin: 0;
    padding: 12px 13px;
    color: var(--text);
    background: rgba(8, 13, 19, 0.64);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    cursor: pointer;
}

.choice-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-card span {
    color: var(--muted);
    font-weight: 900;
}

.choice-card:has(input:checked) {
    background: rgba(157, 178, 200, 0.12);
    border-color: rgba(157, 178, 200, 0.46);
}

.choice-card:has(input:checked) span {
    color: var(--text-strong);
}

@media (max-width: 760px) {
    .topic-form .topic-category-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .topic-form .topic-category-choice-card {
        align-items: center;
        min-height: 44px;
        padding: 7px 9px;
        background: rgba(8, 13, 19, 0.64);
        border-color: var(--line-soft);
        border-radius: 11px;
    }

    .topic-form .topic-category-choice-card span {
        display: block;
        min-width: 0;
        overflow: visible;
        color: var(--text-strong);
        font-size: clamp(0.8rem, 3.35vw, 0.92rem);
        line-height: 1.15;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .topic-form .topic-category-choice-card:has(input:checked) {
        background: rgba(157, 178, 200, 0.12);
        border-color: rgba(157, 178, 200, 0.46);
        box-shadow: 0 0 0 1px rgba(157, 178, 200, 0.08) inset;
    }
}

@media (max-width: 340px) {
    .topic-form .topic-category-choice-grid {
        grid-template-columns: 1fr;
    }
}

.topic-form-actions,
.inline-confirm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

    @media (max-width: 760px) {
    .forum-header,
    .category-header {
        align-items: start;
    }

    .forum-search {
        width: 100%;
        min-width: 0;
    }

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

    .topic-card {
        grid-template-columns: 36px minmax(0, 1fr);
        align-items: start;
        margin-inline: -8px;
        padding-inline: 8px;
    }

    .topic-card-side {
        grid-column: 2;
        justify-items: start;
        padding-top: 0;
    }

    .topic-card-side .topic-card-badges,
    .topic-card-stats {
        justify-content: flex-start;
    }

    .topic-header {
        align-items: start;
    }

    .choice-card-grid,
    .type-choice-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .forum-search {
        display: flex;
    }

    .forum-category-grid {
        grid-template-columns: 1fr;
    }

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

    .comment-children {
        margin-left: -20px;
        padding-left: 22px;
    }

    .comment-children .comment-children {
        margin-left: -18px;
        padding-left: 20px;
    }

    .composer-actions,
    .nested-composer .composer-actions {
        justify-content: stretch;
    }

    .composer-actions .btn {
        width: 100%;
    }

    .topic-header {
        gap: 10px;
    }

    .topic-header h1 {
        font-size: 1.75rem;
    }
}

/* Focused topic detail correction pass */
.topic-detail-layout {
    gap: 14px;
}

.topic-detail-card,
.composer-card,
.replies-panel {
    min-width: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.topic-detail-card {
    display: grid;
    gap: 14px;
    padding: 8px 0 18px;
    border-bottom: 1px solid var(--line-soft);
}

.topic-header {
    align-items: start;
}

.topic-header-main {
    gap: 12px;
}

.topic-badge-row {
    align-items: center;
}

.topic-actions-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 2px 4px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.08rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1;
}

.topic-actions-trigger:hover {
    color: var(--text-strong);
    background: rgba(152, 164, 179, 0.08);
}

.topic-actions-menu .action-menu-panel {
    top: calc(100% + 6px);
}

.action-menu-panel .inline-action {
    width: 100%;
}

.topic-actions-menu .action-menu-button {
    justify-content: flex-start;
    padding: 7px 9px;
    text-align: left;
}

.topic-copy {
    line-height: 1.68;
}

.topic-reaction-row {
    margin-top: -2px;
}

.composer-card {
    padding: 2px 0 14px;
    border-bottom: 1px solid var(--line-soft);
}

.composer-note {
    padding: 8px 0 2px;
}

.composer {
    gap: 0;
}

.compact-composer .editor-shell {
    background: rgba(6, 10, 15, 0.72);
    border-color: var(--line-soft);
    border-radius: 14px;
}

.compact-composer .editor-toolbar {
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 5px;
    background: rgba(14, 20, 28, 0.86);
}

.editor-toolbar-spacer {
    flex: 1 1 auto;
    min-width: 8px;
}

.editor-toolbar .editor-submit {
    width: auto;
    height: auto;
    min-height: 30px;
    padding: 5px 12px;
    color: #071018;
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    border-radius: 999px;
    font-size: 0.8rem;
}

.editor-toolbar .editor-submit:hover,
.editor-toolbar .editor-submit:focus-visible {
    color: #071018;
    background: #c4d2e1;
    border-color: #c4d2e1;
}

.compact-composer .editor-canvas {
    min-height: 44px;
    padding: 10px 12px;
    line-height: 1.5;
}

.nested-composer .editor-canvas {
    min-height: 42px;
}

.replies-panel {
    display: grid;
    gap: 10px;
    padding-top: 2px;
}

.replies-panel .section-title-row h2 {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    letter-spacing: 0;
}

.thread-list {
    gap: 0;
    position: relative;
}

.thread-list > .comment {
    padding: 13px 0;
    border-top: 1px solid var(--line-soft);
}

.thread-list > .comment:first-child {
    padding-top: 0;
}

.thread-list > .thread-connectors + .comment {
    padding-top: 0;
    border-top: 0;
}

.thread-connectors {
    position: absolute;
    inset: 0 auto auto 0;
    z-index: 0;
    display: block;
    overflow: visible;
    pointer-events: none;
}

.thread-connectors[hidden] {
    display: none !important;
}

.thread-connectors path {
    fill: none;
    stroke: rgba(157, 178, 200, 0.2);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.comment {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    z-index: 1;
}

.comment-avatar {
    z-index: 2;
}

.comment-body {
    min-width: 0;
}

.comment-header {
    align-items: center;
    margin-bottom: 4px;
}

.comment-author-row {
    gap: 6px;
}

.reply-context {
    font-size: 0.76rem;
}

.comment-copy {
    line-height: 1.62;
}

.comment-actions {
    display: grid;
    gap: 8px;
    margin-top: 6px;
}

.comment-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.comment-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 29px;
    padding: 5px 9px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 850;
    line-height: 1;
}

.comment-action-link:hover,
.comment-action-link.is-active {
    color: var(--text-strong);
    background: rgba(152, 164, 179, 0.08);
    border-color: var(--line-soft);
}

.nested-reply-composer {
    width: min(100%, 650px);
    margin-top: 2px;
}

.nested-reply-composer[hidden] {
    display: none !important;
}

.comment.is-accepted > .comment-body {
    padding: 0 0 0 10px;
    background: transparent;
    border: 0;
    border-left: 2px solid rgba(131, 184, 148, 0.62);
    border-radius: 0;
}

.comment-children {
    margin-top: 10px;
    margin-left: -46px;
    padding-left: 46px;
}

.comment-children > .comment {
    padding: 10px 0 0;
}

.comment-children .comment-children {
    margin-left: -46px;
    padding-left: 46px;
}

.comment-children .comment-children .comment-children {
    margin-left: -42px;
    padding-left: 42px;
}

.comment-children .comment-children .comment-children .comment-children {
    margin-left: -38px;
    padding-left: 38px;
}

@media (max-width: 760px) {
    .topic-header {
        gap: 10px;
    }

    .topic-detail-card {
        padding-top: 2px;
    }
}

@media (max-width: 560px) {
    .topic-detail-layout {
        gap: 12px;
    }

    .topic-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .compact-composer .editor-toolbar {
        flex-wrap: wrap;
    }

    .editor-toolbar .editor-submit {
        min-height: 29px;
        padding-inline: 10px;
    }

    .compact-composer .editor-canvas {
        min-height: 42px;
        padding: 9px 11px;
    }

    .comment {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 8px;
    }

    .comment-action-row {
        gap: 4px;
    }

    .comment-action-link,
    .comment-actions .icon-action {
        min-height: 28px;
        padding: 4px 7px;
        font-size: 0.78rem;
    }

    .comment-children {
        margin-left: -40px;
        padding-left: 40px;
    }

    .comment-children .comment-children,
    .comment-children .comment-children .comment-children,
    .comment-children .comment-children .comment-children .comment-children {
        margin-left: -36px;
        padding-left: 36px;
    }
}

/* Final thread layout cap: keep recursive replies readable on narrow screens. */
.thread-list,
.comment-children {
    min-width: 0;
}

.comment-children,
.comment-children .comment-children,
.comment-children .comment-children .comment-children,
.comment-children .comment-children .comment-children .comment-children {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
}

.thread-list .comment {
    width: auto;
    max-width: 100%;
}

.thread-list .reply-depth-0 {
    margin-left: 0;
}

.thread-list .reply-depth-1 {
    margin-left: 24px;
}

.thread-list .reply-depth-2 {
    margin-left: 48px;
}

.thread-list .reply-depth-3 {
    margin-left: 72px;
}

.comment,
.comment-body,
.comment-copy,
.comment-actions,
.nested-reply-composer,
.nested-composer,
.editor-shell,
.editor-canvas {
    min-width: 0;
}

.comment-header,
.comment-action-row {
    flex-wrap: wrap;
}

.comment-copy,
.rich-copy,
.editor-canvas,
.reply-context,
.comment-author-row,
.comment-author-row .author-display-name,
.comment-author-row .user-name-link {
    overflow-wrap: anywhere;
    word-break: normal;
}

.nested-reply-composer,
.nested-composer {
    width: 100%;
    max-width: 650px;
}

@media (max-width: 760px) {
    .thread-list .reply-depth-1 {
        margin-left: 12px;
    }

    .thread-list .reply-depth-2 {
        margin-left: 20px;
    }

    .thread-list .reply-depth-3 {
        margin-left: 24px;
    }

    .comment-header {
        align-items: start;
    }

    .comment-header .badge {
        max-width: 100%;
        white-space: normal;
    }

    .editor-toolbar {
        min-width: 0;
    }

    .editor-toolbar .editor-submit {
        flex: 0 0 auto;
    }
}

@media (max-width: 360px) {
    .comment {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 7px;
    }

    .thread-list .reply-depth-1 {
        margin-left: 8px;
    }

    .thread-list .reply-depth-2,
    .thread-list .reply-depth-3 {
        margin-left: 16px;
    }

    .comment-action-link,
    .comment-actions .icon-action {
        padding-inline: 6px;
    }
}

/* Mobile-safe constraints for the restored curved connector thread. */
.thread-connectors {
    max-width: 100%;
}

.comment,
.comment-body,
.comment-copy,
.comment-actions,
.comment-action-row,
.nested-reply-composer,
.nested-composer,
.editor-shell,
.editor-toolbar,
.editor-canvas {
    box-sizing: border-box;
    min-width: 0;
}

.comment-action-row {
    row-gap: 6px;
}

.comment-action-row .inline-action,
.comment-action-row .like-button-form {
    flex: 0 0 auto;
}

.comment-copy,
.rich-copy,
.editor-canvas,
.reply-context,
.comment-author-row,
.comment-author-row .author-display-name,
.comment-author-row .user-name-link {
    overflow-wrap: anywhere;
    word-break: normal;
}

.nested-reply-composer,
.nested-composer {
    width: 100%;
    max-width: 650px;
}

@media (max-width: 760px) {
    .thread-list {
        overflow: hidden;
    }

    .thread-connectors {
        overflow: hidden;
    }

    .thread-connectors path {
        stroke-width: 0.9;
    }

    .thread-list .reply-depth-1 {
        margin-left: 20px;
    }

    .thread-list .reply-depth-2 {
        margin-left: 28px;
    }

    .thread-list .reply-depth-3 {
        margin-left: 32px;
    }

    .nested-reply-composer,
    .nested-composer {
        max-width: 100%;
    }

    .nested-reply-composer .editor-toolbar {
        align-items: center;
        flex-wrap: wrap;
    }

    .nested-reply-composer .editor-submit {
        flex: 0 0 auto;
        margin-left: auto;
    }
}

@media (max-width: 360px) {
    .thread-list .reply-depth-1 {
        margin-left: 14px;
    }

    .thread-list .reply-depth-2 {
        margin-left: 20px;
    }

    .thread-list .reply-depth-3 {
        margin-left: 22px;
    }
}

/* Mobile forum index polish */
@media (max-width: 760px) {
    .forum-shell {
        gap: 14px;
    }

    .forum-shell .content-card {
        padding: 14px;
        border-radius: 14px;
    }

    .forum-shell .section-title-row {
        margin-bottom: 10px;
    }

    .forum-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .forum-category-grid .category-card {
        grid-template-rows: auto auto;
        gap: 7px;
        min-height: 76px;
        padding: 10px;
        border-radius: 12px;
    }

    .forum-category-grid .category-card-copy {
        gap: 3px;
    }

    .forum-category-grid .category-card strong {
        font-size: 0.95rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .forum-category-grid .category-card-description {
        display: none;
    }

    .forum-category-grid .category-card-meta {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 3px 6px;
        font-size: 0.72rem;
        line-height: 1.25;
        white-space: normal;
    }

    .forum-shell .topic-list,
    .forum-shell .compact-topic-list {
        gap: 0;
    }

    .forum-shell .topic-card {
        grid-template-columns: 34px minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        margin-inline: 0;
        padding: 12px 0;
        border-bottom: 1px solid var(--line-soft);
        border-radius: 0;
    }

    .forum-shell .topic-card:first-child {
        margin-top: 0;
        padding-top: 0;
    }

    .forum-shell .topic-card:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: 0;
    }

    .forum-shell .topic-card:hover {
        transform: none;
    }

    .forum-shell .topic-card-avatar {
        padding-top: 1px;
    }

    .forum-shell .topic-card-main {
        display: grid;
        gap: 5px;
    }

    .forum-shell .topic-card h3 {
        margin: 0;
        font-size: 1rem;
        line-height: 1.28;
    }

    .forum-shell .topic-card h3 a {
        overflow-wrap: anywhere;
    }

    .forum-shell .topic-excerpt {
        display: -webkit-box;
        margin: 0;
        overflow: hidden;
        color: var(--muted);
        font-size: 0.84rem;
        line-height: 1.45;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .forum-shell .topic-meta {
        gap: 4px 7px;
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .forum-shell .topic-author-name::before {
        content: "by ";
        color: var(--muted);
        font-weight: 500;
    }

    .forum-shell .topic-card-side {
        grid-column: 2;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 7px 8px;
        padding-top: 0;
    }

    .forum-shell .topic-card-side .topic-card-badges {
        order: 2;
        justify-content: flex-start;
        gap: 5px;
    }

    .forum-shell .topic-card-stats {
        order: 1;
        justify-content: flex-start;
        gap: 8px;
        min-width: 0;
        padding-top: 0;
    }

    .forum-shell .topic-card .metric {
        font-size: 0.78rem;
    }

    .forum-shell .topic-card .badge {
        max-width: 100%;
        min-height: 22px;
        padding: 3px 7px;
        overflow-wrap: anywhere;
        font-size: 0.68rem;
        white-space: normal;
    }
}

@media (max-width: 340px) {
    .forum-category-grid {
        grid-template-columns: 1fr;
    }

    .forum-category-grid .category-card {
        min-height: 64px;
    }
}

/* Compact mobile forum landing controls */
.forum-category-accordion {
    display: none;
    margin: 0;
}

.forum-category-grid-desktop {
    display: grid;
}

.forum-category-grid-mobile {
    display: none;
}

.forum-controls {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.forum-category-accordion > summary {
    display: none;
}

@media (max-width: 760px) {
    .forum-shell {
        --forum-mobile-stack-gap: 10px;
    }

    body.forum-page .site-main {
        width: min(100% - 14px, var(--content));
        margin-top: 4px;
        margin-bottom: 24px;
    }

    .forum-shell {
        gap: var(--forum-mobile-stack-gap);
    }

    .forum-controls {
        gap: var(--forum-mobile-stack-gap);
    }

    .forum-header {
        display: block;
        margin: 0;
    }

    .forum-search {
        display: flex;
        width: 100%;
        min-width: 0;
        height: 40px;
        min-height: 40px;
        padding: 0 12px;
    }

    .forum-search input {
        height: 100%;
        min-height: 0;
        margin: 0;
        padding: 0 !important;
        border-radius: 0;
        font-size: 16px;
    }

    .forum-search-button {
        display: inline-flex;
        width: 28px;
        min-width: 28px;
        height: 100%;
        min-height: 0;
    }

    .forum-categories-panel {
        padding: 0 !important;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .forum-categories-title {
        display: none;
    }

    .forum-category-grid-desktop {
        display: none;
    }

    .forum-category-accordion {
        display: grid;
        gap: 0;
        min-width: 0;
    }

    .forum-category-accordion > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 40px;
        padding: 8px 12px;
        color: var(--text-strong);
        background: #2d2d2d;
        border: 1px solid rgb(63, 63, 63);
        border-radius: 10px;
        box-shadow: none;
        cursor: pointer;
        font-weight: 950;
        list-style: none;
    }

    .forum-category-accordion > summary:hover,
    .forum-category-accordion > summary:focus-visible {
        border-color: rgb(110, 110, 110);
        outline: none;
    }

    .forum-category-accordion > summary::-webkit-details-marker {
        display: none;
    }

    .forum-category-chevron {
        position: relative;
        flex: 0 0 auto;
        width: 18px;
        height: 18px;
        color: var(--muted);
        transition: transform 160ms ease, color 160ms ease;
    }

    .forum-category-chevron::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 43%;
        width: 8px;
        height: 8px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .forum-category-accordion[open] .forum-category-chevron {
        color: var(--text-strong);
        transform: rotate(180deg);
    }

    .forum-category-accordion:not([open]) > .forum-category-grid {
        display: none;
    }

    .forum-category-accordion[open] > .forum-category-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-top: 6px;
    }

    .forum-category-grid .category-card {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 7px 9px;
        border-radius: 11px;
    }

    .forum-category-grid .category-card-copy {
        display: block;
        min-width: 0;
    }

    .forum-category-grid .category-card strong {
        display: block;
        overflow: visible;
        font-size: clamp(0.8rem, 3.35vw, 0.92rem);
        line-height: 1.15;
        text-overflow: unset;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .forum-category-grid .category-card-description,
    .forum-category-grid .category-card-meta {
        display: none;
    }

    .forum-shell > .content-card:not(.forum-categories-panel) {
        padding: 12px;
        border-radius: 13px;
    }

    .forum-shell > .content-card:not(.forum-categories-panel) .section-title-row {
        margin-bottom: 8px;
    }

    .category-shortcuts-card {
        display: none;
    }
}

@media (max-width: 340px) {
    .forum-category-accordion[open] > .forum-category-grid {
        grid-template-columns: 1fr;
    }
}

/* Obsolete topic-detail mobile reply attempts disabled.
   The active scoped implementation lives at the end of design-system.css. */
@media not all {
/* Targeted nested reply depth fix. */
.thread-list {
    --reply-max-indent: 224px;
    overflow: visible;
}

.thread-list .comment-children {
    display: grid;
    gap: 0;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.thread-list .comment {
    --reply-indent: min(var(--reply-indent-desktop, 0px), var(--reply-max-indent));
    width: auto;
    max-width: calc(100% - var(--reply-indent));
    margin-left: var(--reply-indent);
}

.thread-list .comment[data-parent-id] {
    padding-top: 10px;
}

.thread-list .thread-connectors path {
    stroke: rgba(157, 178, 200, 0.24);
}

.thread-list .comment-copy,
.thread-list .rich-copy,
.thread-list .reply-context,
.thread-list .comment-author-row,
.thread-list .author-display-name,
.thread-list .user-name-link {
    overflow-wrap: anywhere;
    word-break: normal;
}

.reply-options-menu {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    z-index: 30;
    overflow: visible;
}

.reply-options-menu[open] {
    z-index: 1200;
}

.thread-list .comment:has(.reply-options-menu[open]) {
    z-index: 1100;
}

.reply-options-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
}

.reply-options-trigger::-webkit-details-marker {
    display: none;
}

.reply-options-trigger:hover,
.reply-options-trigger:focus-visible,
.reply-options-menu[open] .reply-options-trigger {
    color: var(--text-strong);
    background: rgba(152, 164, 179, 0.08);
}

.reply-options-icon {
    display: block;
    width: 16px;
    height: 16px;
    fill: currentColor;
    stroke: none;
}

.reply-options-icon circle {
    fill: currentColor;
    stroke: none;
}

.reply-options-panel {
    top: calc(100% + 5px);
    right: 0;
    z-index: 1250;
    min-width: 112px;
    padding: 4px;
    gap: 0;
    background: rgba(13, 18, 25, 0.98);
    border-color: rgba(178, 193, 209, 0.22);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.reply-options-panel .inline-action,
.reply-options-panel .reply-delete-form {
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.reply-options-panel .action-menu-button {
    justify-content: flex-start;
    min-height: 34px;
    padding: 7px 9px;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 0.84rem;
    line-height: 1.1;
    text-align: left;
    cursor: pointer;
}

.reply-options-panel .action-menu-button:hover,
.reply-options-panel .action-menu-button:focus-visible {
    color: var(--text-strong);
    background: rgba(152, 164, 179, 0.1);
}

.reply-options-panel .reply-delete-action {
    color: var(--danger) !important;
}

.reply-options-panel .reply-delete-action:hover,
.reply-options-panel .reply-delete-action:focus-visible {
    color: #ffb3b3 !important;
}

.comment-standing {
    display: none;
}

.reply-options-menu-mobile-only,
.reply-mobile-menu-action {
    display: none;
}

@media (max-width: 760px) {
    .topic-detail-layout .thread-list {
        --reply-max-indent: 40px;
        position: relative;
        overflow-x: hidden;
        overflow-y: visible;
        padding-left: 0;
    }

    .topic-detail-layout .thread-list .comment {
        --reply-indent: min(var(--reply-indent-mobile, 0px), var(--reply-max-indent));
        position: relative;
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 8px;
        width: auto;
        max-width: calc(100% - var(--reply-indent));
        margin-left: var(--reply-indent);
        padding: 10px 0 0;
        border-top: 0;
        overflow: visible;
    }

    .topic-detail-layout .thread-list > .comment {
        padding-top: 12px;
        border-top: 1px solid var(--line-soft);
    }

    .topic-detail-layout .thread-list > .comment:first-of-type,
    .topic-detail-layout .thread-list > .thread-connectors + .comment {
        padding-top: 0;
        border-top: 0;
    }

    .topic-detail-layout .thread-list .comment-children {
        display: grid;
        gap: 0;
        margin: 0;
        padding: 0;
        min-width: 0;
        position: relative;
        overflow: visible;
    }

    .topic-detail-layout .thread-list .comment-children::before {
        content: "";
        position: absolute;
        left: calc(min(var(--branch-indent-mobile, 14px), var(--reply-max-indent)) - 7px);
        top: 4px;
        bottom: 0;
        width: 1px;
        background: rgba(157, 178, 200, 0.2);
        pointer-events: none;
    }

    .topic-detail-layout .thread-connectors {
        display: none !important;
    }

    .topic-detail-layout .thread-list .comment[data-parent-id]::before {
        content: none;
        display: none;
    }

    .topic-detail-layout .thread-list .comment[data-parent-id]::after {
        content: "";
        position: absolute;
        left: -7px;
        top: 26px;
        width: 8px;
        height: 1px;
        background: rgba(157, 178, 200, 0.22);
        pointer-events: none;
    }

    .topic-detail-layout .comment-avatar {
        z-index: 2;
        padding-top: 0;
    }

    .topic-detail-layout .comment-avatar .avatar-sm,
    .topic-detail-layout .comment-avatar .user-preview-trigger {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
        font-size: 0.72rem;
    }

    .topic-detail-layout .comment-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        min-width: 0;
        margin-bottom: 3px;
    }

    .topic-detail-layout .comment-meta-block {
        gap: 1px;
        min-width: 0;
    }

    .topic-detail-layout .comment-author-row {
        gap: 5px;
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .topic-detail-layout .reply-context {
        font-size: 0.73rem;
        line-height: 1.25;
    }

    .topic-detail-layout .comment-header .badge {
        min-height: 19px;
        padding: 3px 6px;
        font-size: 0.66rem;
        line-height: 1;
    }

    .topic-detail-layout .comment.is-accepted > .comment-body {
        padding: 7px 0 7px 9px;
        background: transparent;
        border: 0;
        border-left: 2px solid rgba(131, 184, 148, 0.6);
        border-radius: 0;
    }

    .topic-detail-layout .comment-copy {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
        line-height: 1.5;
    }

    .topic-detail-layout .is-deleted-reply .comment-copy {
        color: var(--muted);
        font-size: 0.86rem;
    }

    .topic-detail-layout .comment-actions {
        position: relative;
        z-index: 8;
        display: flex;
        justify-content: flex-end;
        gap: 0;
        margin-top: 7px;
        overflow: visible;
    }

    .topic-detail-layout .comment-action-row {
        display: flex;
        flex-direction: row-reverse;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 6px;
        row-gap: 5px;
        align-items: center;
        width: 100%;
        min-width: 0;
        overflow: visible;
    }

    .topic-detail-layout .comment-action-link {
        min-height: 32px;
        padding: 5px 8px;
        border-radius: 8px;
        box-shadow: none;
        font-size: 0.8rem;
        line-height: 1;
        transform: none;
    }

    .topic-detail-layout .comment-action-link:hover,
    .topic-detail-layout .comment-action-link:focus-visible {
        transform: none;
    }

    .topic-detail-layout .comment-action-row .inline-action,
    .topic-detail-layout .comment-action-row .like-button-form {
        flex: 0 1 auto;
    }

    .topic-detail-layout .reply-answer-action {
        display: inline-flex;
    }

    .topic-detail-layout .reply-options-menu-mobile-only,
    .topic-detail-layout .reply-mobile-menu-action {
        display: none !important;
    }

    .topic-detail-layout .comment-actions .like-button {
        width: 58px;
        height: 32px;
        min-height: 32px;
        border-radius: 9px;
        box-shadow: none;
    }

    .topic-detail-layout .comment-actions .like-button .like-icon {
        width: 14px;
        height: 14px;
    }

    .topic-detail-layout .comment-actions .like-button-count {
        font-size: 0.76rem;
    }

    .topic-detail-layout .reply-options-trigger {
        width: 32px;
        min-width: 32px;
        height: 32px;
        min-height: 32px;
        border-radius: 8px;
    }

    .topic-detail-layout .reply-options-menu {
        position: relative;
        z-index: 20;
        overflow: visible;
    }

    .topic-detail-layout .reply-options-menu[open] {
        z-index: 1200;
    }

    .topic-detail-layout .reply-options-icon {
        width: 14px;
        height: 14px;
    }

    .topic-detail-layout .reply-options-panel {
        position: absolute;
        left: 0;
        right: auto;
        top: auto;
        bottom: calc(100% + 6px);
        z-index: 1300;
        min-width: 138px;
        padding: 6px;
    }

    .topic-detail-layout .reply-options-panel .action-menu-button {
        min-height: 30px;
        padding: 6px 8px;
        font-size: 0.8rem;
        line-height: 1.1;
        text-align: left;
    }

    .topic-detail-layout .nested-reply-composer {
        max-width: 100%;
    }
}

@media (max-width: 360px) {
    .topic-detail-layout .thread-list {
        --reply-max-indent: 34px;
    }

    .topic-detail-layout .thread-list .comment {
        --reply-indent: min(var(--reply-indent-tiny, 0px), var(--reply-max-indent));
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 6px;
    }

    .topic-detail-layout .comment-avatar .avatar-sm,
    .topic-detail-layout .comment-avatar .user-preview-trigger {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
    }

    .topic-detail-layout .comment-actions .like-button {
        width: 54px;
    }

    .topic-detail-layout .thread-list .comment-children::before {
        left: calc(min(var(--branch-indent-tiny, 12px), var(--reply-max-indent)) - 6px);
    }

    .topic-detail-layout .thread-list .comment[data-parent-id]::after {
        left: -6px;
        width: 7px;
    }
}

/* Readability and pagination refinements */
.topic-thread-surface {
    display: grid;
    gap: 16px;
    min-width: 0;
    padding: 22px;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(18, 24, 33, 0.96), rgba(9, 13, 19, 0.96));
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035) inset;
    backdrop-filter: blur(10px);
}

.topic-thread-surface .topic-detail-card {
    padding-top: 0;
}

.topic-thread-surface .replies-panel {
    padding-bottom: 2px;
}

.topic-form-layout .page-header {
    padding: 0 4px;
}

.topic-form-layout .topic-form {
    background:
        linear-gradient(180deg, rgba(18, 24, 33, 0.96), rgba(9, 13, 19, 0.96));
    border-color: rgba(178, 193, 209, 0.2);
    backdrop-filter: blur(10px);
}

.topic-form .choice-card {
    background: rgba(8, 13, 19, 0.78);
    border-color: rgba(178, 193, 209, 0.18);
}

.topic-form .choice-card:hover {
    background: rgba(152, 164, 179, 0.1);
    border-color: rgba(178, 193, 209, 0.3);
}

.topic-form input[type="text"],
.topic-form .editor-shell {
    background: rgba(6, 10, 15, 0.9);
    border-color: rgba(178, 193, 209, 0.24);
}

.pagination-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
}

.pagination-pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.pagination-link,
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 28px;
    padding: 2px 3px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1;
}

.pagination-arrow {
    width: 28px;
    min-width: 28px;
    padding-inline: 0;
}

.pagination-arrow svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pagination-link:hover,
.pagination-link:focus-visible {
    color: var(--text-strong);
    background: transparent;
    border-bottom-color: rgba(178, 193, 209, 0.42);
}

.pagination-link.is-current {
    color: var(--text-strong);
    background: transparent;
    border-bottom-color: currentColor;
    font-weight: 950;
}

.pagination-link.is-disabled,
.pagination-ellipsis {
    cursor: default;
    opacity: 0.58;
}

@media (max-width: 760px) {
    .topic-thread-surface,
    .topic-form-layout .topic-form {
        padding: 14px;
        border-radius: 14px;
        background:
            linear-gradient(180deg, rgba(17, 24, 33, 0.98), rgba(8, 12, 18, 0.98));
    }

    .topic-thread-surface {
        gap: 12px;
    }

    .pagination-nav {
        justify-content: center;
        gap: 8px;
        margin-top: 12px;
        padding-top: 10px;
    }

    .pagination-pages {
        gap: 8px;
    }

    .pagination-link,
    .pagination-ellipsis {
        min-height: 28px;
        padding: 2px;
    }

    .pagination-arrow {
        width: 28px;
        min-width: 28px;
    }
}

/* Mobile topic detail reply redesign. */
@media (max-width: 760px) {
    .topic-detail-layout {
        width: 100%;
    }

    .topic-detail-layout .topic-thread-surface {
        gap: 14px;
        overflow: visible;
    }

    .topic-detail-layout .topic-detail-card {
        gap: 14px;
        padding-bottom: 14px;
    }

    .topic-detail-layout .topic-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .topic-detail-layout .topic-header h1 {
        font-size: clamp(1.42rem, 8vw, 1.9rem);
        line-height: 1.12;
    }

    .topic-detail-layout .topic-copy {
        font-size: 0.96rem;
        line-height: 1.62;
    }

    .topic-detail-layout .composer-card {
        padding-bottom: 12px;
    }

    .topic-detail-layout .replies-panel {
        gap: 12px;
    }

    .topic-detail-layout .thread-list {
        --reply-max-indent: 24px;
        display: grid;
        gap: 10px;
        overflow: visible;
        padding: 0;
    }

    .topic-detail-layout .thread-connectors {
        display: none !important;
    }

    .topic-detail-layout .thread-list .comment-children,
    .topic-detail-layout .thread-list .comment-children .comment-children {
        display: grid;
        gap: 10px;
        min-width: 0;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .topic-detail-layout .thread-list .comment-children::before,
    .topic-detail-layout .thread-list .comment[data-parent-id]::before,
    .topic-detail-layout .thread-list .comment[data-parent-id]::after {
        content: none;
        display: none;
    }

    .topic-detail-layout .thread-list .comment {
        --reply-indent: min(var(--reply-indent-mobile, 0px), var(--reply-max-indent));
        position: relative;
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 10px;
        width: auto;
        max-width: calc(100% - var(--reply-indent));
        margin-left: var(--reply-indent);
        padding: 11px;
        overflow: visible;
        color: var(--text);
        background: rgba(8, 13, 19, 0.66);
        border: 1px solid rgba(178, 193, 209, 0.16);
        border-radius: 12px;
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035) inset;
    }

    .topic-detail-layout .thread-list > .comment {
        padding-top: 11px;
        border-top: 1px solid rgba(178, 193, 209, 0.16);
    }

    .topic-detail-layout .thread-list > .comment:first-of-type,
    .topic-detail-layout .thread-list > .thread-connectors + .comment {
        padding-top: 11px;
        border-top: 1px solid rgba(178, 193, 209, 0.16);
    }

    .topic-detail-layout .thread-list .comment[data-parent-id] {
        background: rgba(12, 18, 26, 0.72);
        border-left: 2px solid rgba(157, 178, 200, 0.34);
    }

    .topic-detail-layout .thread-list .reply-depth-capped {
        border-left-style: solid;
    }

    .topic-detail-layout .thread-list .comment:has(.reply-options-menu[open]) {
        z-index: 1400;
    }

    .topic-detail-layout .comment-avatar {
        z-index: 2;
        padding-top: 1px;
    }

    .topic-detail-layout .comment-avatar .avatar-sm,
    .topic-detail-layout .comment-avatar .avatar-image,
    .topic-detail-layout .comment-avatar .avatar-fallback,
    .topic-detail-layout .comment-avatar .user-preview-trigger {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
        font-size: 0.72rem;
    }

    .topic-detail-layout .comment-body {
        display: grid;
        gap: 8px;
        min-width: 0;
    }

    .topic-detail-layout .comment-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 8px;
        min-width: 0;
        margin: 0;
    }

    .topic-detail-layout .comment-meta-block {
        gap: 4px;
        min-width: 0;
    }

    .topic-detail-layout .comment-author-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 5px;
        min-width: 0;
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .topic-detail-layout .comment-author-row .author-display-name,
    .topic-detail-layout .comment-author-row .user-name-link {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .topic-detail-layout .comment-standing {
        display: inline-flex;
        align-items: center;
        min-height: 18px;
        max-width: 100%;
        padding: 2px 6px;
        overflow: hidden;
        color: var(--muted);
        background: rgba(152, 164, 179, 0.08);
        border: 1px solid rgba(178, 193, 209, 0.14);
        border-radius: 999px;
        font-size: 0.66rem;
        font-weight: 850;
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topic-detail-layout .reply-context {
        margin: 0;
        padding-left: 7px;
        color: var(--muted-2);
        border-left: 1px solid rgba(178, 193, 209, 0.2);
        font-size: 0.74rem;
        line-height: 1.3;
    }

    .topic-detail-layout .comment-header .badge {
        justify-self: end;
        max-width: 100%;
        min-height: 20px;
        padding: 3px 6px;
        white-space: normal;
        font-size: 0.66rem;
        line-height: 1;
    }

    .topic-detail-layout .comment.is-accepted {
        background: rgba(15, 24, 20, 0.76);
        border-color: rgba(131, 184, 148, 0.28);
    }

    .topic-detail-layout .comment.is-accepted > .comment-body {
        padding: 0;
        background: transparent;
        border: 0;
    }

    .topic-detail-layout .comment-copy {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
        font-size: 0.94rem;
        line-height: 1.58;
    }

    .topic-detail-layout .comment-copy img,
    .topic-detail-layout .rich-copy img {
        max-width: 100%;
        height: auto;
    }

    .topic-detail-layout .is-deleted-reply .comment-copy {
        color: var(--muted);
        font-size: 0.88rem;
    }

    .topic-detail-layout .comment-actions {
        position: relative;
        z-index: 4;
        display: grid;
        justify-content: stretch;
        justify-items: stretch;
        gap: 8px;
        width: 100%;
        margin-top: 0;
        overflow: visible;
    }

    .topic-detail-layout .comment-action-row {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: visible;
    }

    .topic-detail-layout .comment-action-link,
    .topic-detail-layout .comment-actions .icon-action {
        min-height: 34px;
        padding: 6px 9px;
        border-radius: 9px;
        font-size: 0.8rem;
        line-height: 1;
        transform: none;
    }

    .topic-detail-layout .comment-actions .like-button {
        width: 60px;
        min-width: 60px;
        height: 34px;
        min-height: 34px;
        border-radius: 9px;
        box-shadow: none;
    }

    .topic-detail-layout .comment-actions .like-button .like-icon {
        width: 14px;
        height: 14px;
    }

    .topic-detail-layout .reply-options-menu {
        position: relative;
        z-index: 30;
        margin-left: 0;
        overflow: visible;
    }

    .topic-detail-layout .reply-options-menu[open] {
        z-index: 1500;
    }

    .topic-detail-layout .reply-options-trigger {
        width: 34px;
        min-width: 34px;
        height: 34px;
        min-height: 34px;
        border-radius: 9px;
    }

    .topic-detail-layout .reply-options-panel {
        position: absolute;
        left: 0;
        right: auto;
        top: calc(100% + 6px);
        bottom: auto;
        z-index: 1600;
        min-width: 112px;
        padding: 4px;
    }

    .topic-detail-layout .reply-options-panel .action-menu-button {
        min-height: 34px;
        padding: 7px 9px;
        font-size: 0.82rem;
        line-height: 1.1;
    }

    .topic-detail-layout .nested-reply-composer {
        width: 100%;
        max-width: 100%;
        margin-top: 0;
    }

    .topic-detail-layout .nested-reply-composer .editor-shell {
        border-radius: 11px;
    }
}

@media (max-width: 360px) {
    .topic-detail-layout .thread-list {
        --reply-max-indent: 18px;
    }

    .topic-detail-layout .thread-list .comment {
        --reply-indent: min(var(--reply-indent-tiny, 0px), var(--reply-max-indent));
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .topic-detail-layout .comment-avatar .avatar-sm,
    .topic-detail-layout .comment-avatar .avatar-image,
    .topic-detail-layout .comment-avatar .avatar-fallback,
    .topic-detail-layout .comment-avatar .user-preview-trigger {
        width: 28px;
        min-width: 28px;
        height: 28px;
        min-height: 28px;
    }

    .topic-detail-layout .comment-actions .like-button {
        width: 56px;
        min-width: 56px;
    }
}

/* Final mobile thread-section layout based on the grouped reply sketch. */
@media (max-width: 760px) {
    .topic-detail-layout .thread-list {
        --reply-section-bg: rgba(8, 13, 19, 0.68);
        --reply-section-border: rgba(178, 193, 209, 0.17);
        --reply-row-line: rgba(178, 193, 209, 0.16);
        --reply-rail: rgba(157, 178, 200, 0.3);
        --reply-mobile-indent-cap: 28px;
        display: block;
        overflow: visible;
        padding: 0;
    }

    .topic-detail-layout .thread-connectors {
        display: none !important;
    }

    .topic-detail-layout .thread-list,
    .topic-detail-layout .thread-list .comment,
    .topic-detail-layout .thread-list .comment-children,
    .topic-detail-layout .thread-list .comment-body,
    .topic-detail-layout .thread-list .comment-copy,
    .topic-detail-layout .thread-list .comment-actions,
    .topic-detail-layout .thread-list .comment-action-row {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
    }

    .topic-detail-layout .thread-list .comment-children,
    .topic-detail-layout .thread-list .comment-children .comment-children {
        display: block;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .topic-detail-layout .thread-list .comment-children::before,
    .topic-detail-layout .thread-list .comment[data-parent-id]::before,
    .topic-detail-layout .thread-list .comment[data-parent-id]::after {
        content: none;
        display: none;
    }

    .topic-detail-layout .thread-list .comment {
        --reply-mobile-indent: min(var(--reply-indent-mobile, 0px), var(--reply-mobile-indent-cap));
        position: relative;
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 8px;
        width: 100%;
        margin: 0;
        padding: 9px 0 10px;
        overflow: visible;
        color: var(--text);
        background: transparent;
        border: 0;
        border-bottom: 1px solid var(--reply-row-line);
        border-radius: 0;
        box-shadow: none;
    }

    .topic-detail-layout .thread-list > .comment {
        margin-top: 12px;
        padding: 10px;
        background: var(--reply-section-bg);
        border: 1px solid var(--reply-section-border);
        border-radius: 15px;
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035) inset;
    }

    .topic-detail-layout .thread-list > .comment:first-of-type,
    .topic-detail-layout .thread-list > .thread-connectors + .comment {
        margin-top: 0;
    }

    .topic-detail-layout .thread-list > .comment:has(+ .comment-children) {
        border-bottom-color: var(--reply-row-line);
        border-radius: 15px 15px 0 0;
    }

    .topic-detail-layout .thread-list > .comment + .comment-children {
        width: 100%;
        margin: 0;
        padding: 0 10px 10px;
        overflow: visible;
        background: var(--reply-section-bg);
        border: 1px solid var(--reply-section-border);
        border-top: 0;
        border-radius: 0 0 15px 15px;
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset;
    }

    .topic-detail-layout .thread-list > .comment-children + .comment {
        margin-top: 12px;
    }

    .topic-detail-layout .thread-list > .comment + .comment-children > .comment:last-child:not(:has(+ .comment-children)),
    .topic-detail-layout .thread-list .comment-children > .comment:last-child:not(:has(+ .comment-children)) {
        border-bottom: 0;
    }

    .topic-detail-layout .thread-list .comment[data-parent-id] {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        padding-left: calc(7px + var(--reply-mobile-indent));
        background: transparent;
        border-left: 1px solid transparent;
    }

    .topic-detail-layout .thread-list .comment[data-parent-id]::before {
        content: "";
        display: block;
        position: absolute;
        left: max(5px, calc(var(--reply-mobile-indent) - 6px));
        top: 11px;
        bottom: 11px;
        width: 1px;
        background: var(--reply-rail);
        pointer-events: none;
    }

    .topic-detail-layout .thread-list .reply-depth-capped {
        --reply-mobile-indent: var(--reply-mobile-indent-cap);
    }

    .topic-detail-layout .comment-avatar {
        z-index: 2;
        padding-top: 0;
    }

    .topic-detail-layout .comment-avatar .avatar-sm,
    .topic-detail-layout .comment-avatar .avatar-image,
    .topic-detail-layout .comment-avatar .avatar-fallback,
    .topic-detail-layout .comment-avatar .user-preview-trigger {
        width: 28px;
        min-width: 28px;
        height: 28px;
        min-height: 28px;
        font-size: 0.68rem;
    }

    .topic-detail-layout .comment-body {
        position: relative;
        display: grid;
        gap: 6px;
        min-width: 0;
        padding-right: 0;
    }

    .topic-detail-layout .comment-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
        min-width: 0;
        margin: 0;
    }

    .topic-detail-layout .comment-meta-block {
        gap: 3px;
        min-width: 0;
    }

    .topic-detail-layout .comment-author-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 5px;
        min-width: 0;
        color: var(--muted);
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .topic-detail-layout .comment-author-row .author-display-name,
    .topic-detail-layout .comment-author-row .user-name-link {
        max-width: 100%;
        color: var(--text-strong);
        overflow-wrap: anywhere;
    }

    .topic-detail-layout .comment-standing {
        display: inline-flex;
        align-items: center;
        min-height: 17px;
        max-width: 100%;
        padding: 2px 6px;
        overflow: hidden;
        color: var(--muted);
        background: rgba(152, 164, 179, 0.08);
        border: 1px solid rgba(178, 193, 209, 0.14);
        border-radius: 999px;
        font-size: 0.64rem;
        font-weight: 850;
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topic-detail-layout .reply-context {
        margin: 0;
        color: var(--muted-2);
        font-size: 0.72rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .topic-detail-layout .comment-header .badge {
        justify-self: start;
        max-width: 100%;
        min-height: 18px;
        padding: 3px 6px;
        white-space: normal;
        font-size: 0.64rem;
        line-height: 1;
    }

    .topic-detail-layout .comment-copy {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .topic-detail-layout .comment-copy img,
    .topic-detail-layout .rich-copy img {
        max-width: 100%;
        height: auto;
    }

    .topic-detail-layout .comment.is-accepted {
        background: rgba(15, 24, 20, 0.74);
        border-color: rgba(131, 184, 148, 0.3);
    }

    .topic-detail-layout .comment.is-accepted > .comment-body {
        padding-top: 0;
        padding-bottom: 0;
        background: transparent;
        border: 0;
    }

    .topic-detail-layout .is-deleted-reply .comment-copy {
        color: var(--muted);
        font-size: 0.84rem;
    }

    .topic-detail-layout .comment-actions {
        position: static;
        display: grid;
        gap: 6px;
        width: 100%;
        margin: 0;
        overflow: visible;
    }

    .topic-detail-layout .comment-action-row {
        position: static;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 5px;
        row-gap: 5px;
        width: 100%;
        overflow: visible;
    }

    .topic-detail-layout .comment-action-link,
    .topic-detail-layout .comment-actions .icon-action {
        min-height: 30px;
        padding: 5px 8px;
        border-radius: 8px;
        font-size: 0.76rem;
        line-height: 1;
        transform: none;
    }

    .topic-detail-layout .comment-actions .like-button {
        width: 54px;
        min-width: 54px;
        height: 30px;
        min-height: 30px;
        border-radius: 8px;
        box-shadow: none;
    }

    .topic-detail-layout .comment-actions .like-button .like-icon {
        width: 13px;
        height: 13px;
    }

    .topic-detail-layout .comment-actions .like-button-count {
        font-size: 0.72rem;
    }

    .topic-detail-layout .reply-options-menu {
        position: relative;
        top: auto;
        right: auto;
        z-index: 40;
        margin: 0 0 0 auto;
        overflow: visible;
    }

    .topic-detail-layout .reply-options-menu[open] {
        z-index: 1600;
    }

    .topic-detail-layout .thread-list .comment:has(.reply-options-menu[open]) {
        z-index: 1500;
    }

    .topic-detail-layout .reply-options-trigger {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
        border-radius: 8px;
    }

    .topic-detail-layout .reply-options-icon {
        width: 13px;
        height: 13px;
    }

    .topic-detail-layout .reply-options-panel {
        position: absolute;
        left: auto;
        right: calc(100% + 5px);
        top: 0;
        bottom: auto;
        z-index: 1700;
        box-sizing: border-box;
        min-width: 108px;
        width: max-content;
        max-width: min(150px, calc(100vw - 24px));
        padding: 4px;
    }

    .topic-detail-layout .thread-list .comment .reply-options-menu .reply-options-panel {
        left: auto !important;
        right: calc(100% + 5px) !important;
        transform: none;
    }

    .topic-detail-layout .reply-options-panel .action-menu-button {
        min-height: 32px;
        padding: 7px 9px;
        font-size: 0.8rem;
        line-height: 1.1;
    }

    .topic-detail-layout .nested-reply-composer {
        width: 100%;
        max-width: 100%;
        margin-top: 2px;
    }

    .topic-detail-layout .nested-reply-composer .editor-shell {
        border-radius: 10px;
    }
}

@media (max-width: 360px) {
    .topic-detail-layout .thread-list {
        --reply-mobile-indent-cap: 22px;
    }

    .topic-detail-layout .thread-list > .comment,
    .topic-detail-layout .thread-list > .comment + .comment-children {
        border-radius: 13px;
    }

    .topic-detail-layout .thread-list > .comment:has(+ .comment-children) {
        border-radius: 13px 13px 0 0;
    }

    .topic-detail-layout .thread-list > .comment + .comment-children {
        border-radius: 0 0 13px 13px;
    }

    .topic-detail-layout .thread-list .comment {
        grid-template-columns: 26px minmax(0, 1fr);
        gap: 7px;
    }

    .topic-detail-layout .comment-avatar .avatar-sm,
    .topic-detail-layout .comment-avatar .avatar-image,
    .topic-detail-layout .comment-avatar .avatar-fallback,
    .topic-detail-layout .comment-avatar .user-preview-trigger {
        width: 26px;
        min-width: 26px;
        height: 26px;
        min-height: 26px;
    }
}

/* Mobile forum replies: compact Reddit-style comment thread. */
@media (max-width: 760px) {
    .topic-detail-layout .topic-thread-surface .thread-list {
        --reply-step: 12px;
        --reply-depth-1: var(--reply-step);
        --reply-depth-2: calc(var(--reply-step) * 2);
        --reply-depth-3: calc(var(--reply-step) * 3);
        display: grid;
        gap: 0;
        overflow: visible;
        padding: 0;
    }

    .topic-detail-layout .topic-thread-surface .thread-connectors {
        display: none !important;
    }

    .topic-detail-layout .topic-thread-surface .thread-list,
    .topic-detail-layout .topic-thread-surface .thread-list .comment,
    .topic-detail-layout .topic-thread-surface .thread-list .comment-children,
    .topic-detail-layout .topic-thread-surface .thread-list .comment-body,
    .topic-detail-layout .topic-thread-surface .thread-list .comment-copy,
    .topic-detail-layout .topic-thread-surface .thread-list .comment-actions,
    .topic-detail-layout .topic-thread-surface .thread-list .comment-action-row {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
    }

    .topic-detail-layout .topic-thread-surface .thread-list .comment-children,
    .topic-detail-layout .topic-thread-surface .thread-list .comment-children .comment-children {
        position: relative;
        display: grid;
        gap: 0;
        margin: 0;
        padding: 0;
        overflow: visible;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .topic-detail-layout .topic-thread-surface .thread-list > .comment + .comment-children {
        margin-bottom: 9px;
        padding: 0 !important;
    }

    .topic-detail-layout .topic-thread-surface .thread-list > .comment-children + .comment {
        padding-top: 13px;
    }

    .topic-detail-layout .topic-thread-surface .thread-list .comment-children::before {
        content: none !important;
        display: none !important;
    }

    .topic-detail-layout .topic-thread-surface .thread-list .comment-children-depth-0::before,
    .topic-detail-layout .topic-thread-surface .thread-list .comment-children-depth-1::before,
    .topic-detail-layout .topic-thread-surface .thread-list .comment-children-depth-2::before {
        content: "" !important;
        position: absolute;
        top: 7px;
        bottom: 0;
        display: block !important;
        width: 1px;
        background: rgba(157, 178, 200, 0.18);
        pointer-events: none;
    }

    .topic-detail-layout .topic-thread-surface .thread-list .comment-children-depth-0::before {
        left: 5px;
    }

    .topic-detail-layout .topic-thread-surface .thread-list .comment-children-depth-1::before {
        left: calc(var(--reply-depth-1) + 5px);
    }

    .topic-detail-layout .topic-thread-surface .thread-list .comment-children-depth-2::before {
        left: calc(var(--reply-depth-2) + 5px);
    }

    .topic-detail-layout .topic-thread-surface .thread-list .comment[data-parent-id]::before,
    .topic-detail-layout .topic-thread-surface .thread-list .comment[data-parent-id]::after {
        content: none !important;
        display: none !important;
    }

    .topic-detail-layout .topic-thread-surface .thread-list .comment {
        --reply-indent: 0px;
        position: relative;
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr);
        align-items: center;
        column-gap: 7px;
        row-gap: 4px;
        width: auto;
        max-width: calc(100% - var(--reply-indent));
        margin-left: var(--reply-indent);
        padding: 9px 0 0;
        overflow: visible;
        color: var(--text);
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .topic-detail-layout .topic-thread-surface .thread-list .reply-depth-1 {
        --reply-indent: var(--reply-depth-1);
    }

    .topic-detail-layout .topic-thread-surface .thread-list .reply-depth-2 {
        --reply-indent: var(--reply-depth-2);
    }

    .topic-detail-layout .topic-thread-surface .thread-list .reply-depth-3,
    .topic-detail-layout .topic-thread-surface .thread-list .reply-depth-capped {
        --reply-indent: var(--reply-depth-3);
    }

    .topic-detail-layout .topic-thread-surface .thread-list > .comment {
        margin-left: 0;
        max-width: 100%;
        padding: 13px 0;
        border-top: 1px solid var(--line-soft) !important;
    }

    .topic-detail-layout .topic-thread-surface .thread-list > .comment:first-of-type,
    .topic-detail-layout .topic-thread-surface .thread-list > .thread-connectors + .comment {
        padding-top: 0;
        border-top: 0 !important;
    }

    .topic-detail-layout .topic-thread-surface .thread-list > .comment:has(+ .comment-children) {
        padding-bottom: 7px;
    }

    .topic-detail-layout .topic-thread-surface .comment-avatar {
        z-index: 2;
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        padding-top: 0;
    }

    .topic-detail-layout .topic-thread-surface .comment-avatar .avatar-sm,
    .topic-detail-layout .topic-thread-surface .comment-avatar .avatar-image,
    .topic-detail-layout .topic-thread-surface .comment-avatar .avatar-fallback,
    .topic-detail-layout .topic-thread-surface .comment-avatar .user-preview-trigger {
        width: 28px;
        min-width: 28px;
        height: 28px;
        min-height: 28px;
        font-size: 0.68rem;
    }

    .topic-detail-layout .topic-thread-surface .comment-body {
        display: contents;
        min-width: 0;
        padding: 0;
    }

    .topic-detail-layout .topic-thread-surface .comment-header {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 7px;
        min-width: 0;
        margin: 0;
    }

    .topic-detail-layout .topic-thread-surface .comment-meta-block {
        display: flex;
        align-items: center;
        gap: 0;
        min-width: 0;
    }

    .topic-detail-layout .topic-thread-surface .comment-author-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0;
        min-width: 0;
        color: var(--muted);
        font-size: 0.78rem;
        line-height: 1.2;
    }

    .topic-detail-layout .topic-thread-surface .comment-author-row .author-display-name,
    .topic-detail-layout .topic-thread-surface .comment-author-row .user-name-link,
    .topic-detail-layout .topic-thread-surface .reply-context,
    .topic-detail-layout .topic-thread-surface .comment-copy {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .topic-detail-layout .topic-thread-surface .comment-author-row .author-display-name,
    .topic-detail-layout .topic-thread-surface .comment-author-row .user-name-link {
        color: var(--text-strong);
        font-weight: 850;
    }

    .topic-detail-layout .topic-thread-surface .comment-author-row time::before,
    .topic-detail-layout .topic-thread-surface .comment-author-row > span:not(.comment-standing)::before {
        content: "·";
        margin: 0 4px;
        color: var(--muted-2);
    }

    .topic-detail-layout .topic-thread-surface .comment-standing {
        display: none !important;
    }

    .topic-detail-layout .topic-thread-surface .reply-context {
        display: none;
    }

    .topic-detail-layout .topic-thread-surface .comment-header .badge {
        flex: 0 1 auto;
        max-width: 100%;
        min-height: 17px;
        padding: 2px 5px;
        white-space: normal;
        font-size: 0.62rem;
        line-height: 1;
    }

    .topic-detail-layout .topic-thread-surface .comment.is-accepted > .comment-body {
        display: contents;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
    }

    .topic-detail-layout .topic-thread-surface .comment-copy {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: 2px;
        padding-left: 1px;
        font-size: 0.93rem;
        line-height: 1.48;
    }

    .topic-detail-layout .topic-thread-surface .comment-copy img,
    .topic-detail-layout .topic-thread-surface .rich-copy img {
        max-width: 100%;
        height: auto;
    }

    .topic-detail-layout .topic-thread-surface .is-deleted-reply .comment-copy {
        color: var(--muted);
        font-size: 0.86rem;
    }

    .topic-detail-layout .topic-thread-surface .comment-actions {
        grid-column: 1 / -1;
        grid-row: 3;
        position: relative;
        z-index: 8;
        display: flex;
        justify-content: flex-end;
        width: 100%;
        margin-top: 5px;
        margin-bottom: 0;
        overflow: visible;
    }

    .topic-detail-layout .topic-thread-surface .comment-action-row {
        display: flex;
        flex-direction: row-reverse;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        row-gap: 4px;
        width: 100%;
        min-width: 0;
        overflow: visible;
    }

    .topic-detail-layout .topic-thread-surface .comment-action-row .inline-action,
    .topic-detail-layout .topic-thread-surface .comment-action-row .like-button-form {
        flex: 0 1 auto;
        min-width: 0;
    }

    .topic-detail-layout .topic-thread-surface .reply-answer-action {
        display: inline-flex;
    }

    .topic-detail-layout .topic-thread-surface .reply-options-menu-mobile-only,
    .topic-detail-layout .topic-thread-surface .reply-mobile-menu-action {
        display: none !important;
    }

    .topic-detail-layout .topic-thread-surface .comment-action-link,
    .topic-detail-layout .topic-thread-surface .comment-actions .icon-action {
        width: 28px;
        min-width: 28px;
        height: 28px;
        min-height: 28px;
        padding: 0;
        border-radius: 8px;
        font-size: 0.75rem;
        line-height: 1;
        text-align: center;
        transform: none;
        white-space: nowrap;
    }

    .topic-detail-layout .topic-thread-surface .reply-action-trigger .reply-action-label,
    .topic-detail-layout .topic-thread-surface .reply-answer-button .reply-action-label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    .topic-detail-layout .topic-thread-surface .reply-action-trigger::before {
        content: "\21A9";
        font-size: 1rem;
        line-height: 1;
    }

    .topic-detail-layout .topic-thread-surface .reply-answer-button::before {
        content: "\2713";
        font-size: 0.95rem;
        line-height: 1;
    }

    .topic-detail-layout .topic-thread-surface .comment-actions .like-button {
        width: 50px;
        min-width: 50px;
        height: 28px;
        min-height: 28px;
        border-radius: 8px;
        box-shadow: none;
    }

    .topic-detail-layout .topic-thread-surface .comment-actions .like-button .like-icon {
        width: 12px;
        height: 12px;
    }

    .topic-detail-layout .topic-thread-surface .comment-actions .like-button-count {
        font-size: 0.7rem;
    }

    .topic-detail-layout .topic-thread-surface .reply-options-menu {
        position: relative;
        z-index: 40;
        margin: 0 !important;
        overflow: visible;
    }

    .topic-detail-layout .topic-thread-surface .reply-options-menu[open],
    .topic-detail-layout .topic-thread-surface .thread-list .comment:has(.reply-options-menu[open]) {
        z-index: 1600;
    }

    .topic-detail-layout .topic-thread-surface .reply-options-trigger {
        width: 28px;
        min-width: 28px;
        height: 28px;
        min-height: 28px;
        border-radius: 8px;
    }

    .topic-detail-layout .topic-thread-surface .reply-options-icon {
        width: 12px;
        height: 12px;
    }

    .topic-detail-layout .topic-thread-surface .reply-options-panel {
        position: absolute;
        top: calc(100% + 5px) !important;
        right: auto !important;
        bottom: auto !important;
        left: 0 !important;
        z-index: 1700;
        box-sizing: border-box;
        min-width: 108px;
        max-width: min(150px, calc(100vw - 24px));
        padding: 4px;
        transform: none !important;
    }

    .topic-detail-layout .topic-thread-surface .reply-options-panel .action-menu-button {
        min-height: 32px;
        padding: 7px 9px;
        font-size: 0.8rem;
        line-height: 1.1;
    }

    .topic-detail-layout .topic-thread-surface .nested-reply-composer,
    .topic-detail-layout .topic-thread-surface .nested-composer {
        width: 100%;
        max-width: 100%;
        margin-top: 7px;
    }

    .topic-detail-layout .topic-thread-surface .nested-reply-composer .editor-shell {
        border-radius: 10px;
    }
}

@media (max-width: 360px) {
    .topic-detail-layout .topic-thread-surface .thread-list {
        --reply-step: 10px;
    }

    .topic-detail-layout .topic-thread-surface .thread-list .comment {
        grid-template-columns: 26px minmax(0, 1fr);
        column-gap: 6px;
        row-gap: 4px;
    }

    .topic-detail-layout .topic-thread-surface .thread-list .comment-children-depth-0::before,
    .topic-detail-layout .topic-thread-surface .thread-list .comment-children-depth-1::before,
    .topic-detail-layout .topic-thread-surface .thread-list .comment-children-depth-2::before {
        left: 4px;
    }

    .topic-detail-layout .topic-thread-surface .thread-list .comment-children-depth-1::before {
        left: calc(var(--reply-depth-1) + 4px);
    }

    .topic-detail-layout .topic-thread-surface .thread-list .comment-children-depth-2::before {
        left: calc(var(--reply-depth-2) + 4px);
    }

    .topic-detail-layout .topic-thread-surface .comment-avatar .avatar-sm,
    .topic-detail-layout .topic-thread-surface .comment-avatar .avatar-image,
    .topic-detail-layout .topic-thread-surface .comment-avatar .avatar-fallback,
    .topic-detail-layout .topic-thread-surface .comment-avatar .user-preview-trigger {
        width: 26px;
        min-width: 26px;
        height: 26px;
        min-height: 26px;
    }

    .topic-detail-layout .topic-thread-surface .comment-action-link,
    .topic-detail-layout .topic-thread-surface .comment-actions .icon-action {
        width: 27px;
        min-width: 27px;
        height: 27px;
        min-height: 27px;
        padding: 0;
    }

    .topic-detail-layout .topic-thread-surface .comment-actions .like-button {
        width: 48px;
        min-width: 48px;
        height: 27px;
        min-height: 27px;
    }

    .topic-detail-layout .topic-thread-surface .reply-options-trigger {
        width: 27px;
        min-width: 27px;
        height: 27px;
        min-height: 27px;
    }
}
}
