:root {
    --posts-gap: 22px;
    --posts-card-padding: 20px;
    --posts-card-shadow: 0 24px 60px rgba(8, 10, 20, 0.45);
    --posts-chip-bg: rgba(255, 255, 255, 0.06);
    --posts-chip-color: var(--text-muted);
}

.posts-feed {
    display: flex;
    flex-direction: column;
    gap: var(--posts-gap);
    width: 100%;
}

.posts-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.posts-feed-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.posts-feed-filters {
    display: inline-flex;
    gap: 10px;
}

.posts-feed-filters button {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
}

.posts-feed-filters button.is-active {
    background: var(--accent);
    color: #09131c;
    border-color: var(--accent);
}

.posts-card {
    background: var(--panel);
    border-radius: var(--radius-md);
    border: 1px solid var(--panel-border);
    padding: var(--posts-card-padding);
    box-shadow: var(--posts-card-shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.posts-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
}

.posts-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
}

.posts-card-divider {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 14px;
}

.posts-card-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.posts-card-user strong {
    font-size: 1rem;
}

.posts-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.posts-card-edited {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    background-color: #fcfcfc0a;
    padding: 1px 5px 1px 5px;
    border-radius: 8px;
    cursor: help;
}

.posts-card-status {
    padding: 2px 10px;
    font-size: 0.7rem;
    /* 
    border-radius: 999px;
    background: var(--posts-chip-bg); 
    */
    color: var(--posts-chip-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.posts-card-status.is-hidden {
    display: none;
}

.posts-card-content {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.65;
    word-break: break-word;
}

.posts-card-content h1,
.posts-card-content h2,
.posts-card-content h3 {
    font-weight: 700;
    line-height: 1.3;
    margin: 1.3em 0 0.4em;
}

.posts-card-content h1 {
    font-size: 1.4rem;
}

.posts-card-content h2 {
    font-size: 1.2rem;
}

.posts-card-content h3 {
    font-size: 1.05rem;
}

.posts-card-content blockquote {
    margin: 1em 0;
    padding: 12px 16px;
    border-left: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.posts-card-content blockquote + blockquote {
    margin-top: 0.6em;
}

.posts-card-content .posts-spoiler {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: transparent;
    cursor: pointer;
    text-shadow: 0 0 18px rgba(0, 0, 0, 0.8);
    transition: background 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
}

.posts-card-content .posts-spoiler::after {
    content: 'Spoiler';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.posts-card-content .posts-spoiler.is-revealed,
.posts-card-content .posts-spoiler[data-revealed="true"] {
    color: inherit;
    text-shadow: none;
    background: rgba(255, 255, 255, 0.05);
}

.posts-card-content .posts-spoiler.is-revealed::after,
.posts-card-content .posts-spoiler[data-revealed="true"]::after {
    opacity: 0;
}

.posts-card-content .posts-spoiler:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.posts-mention {
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
    border-radius: var(--radius-sm);
    background: rgba(88, 212, 255, 0.18);
    color: var(--accent-strong);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.posts-mention:hover,
.posts-mention:focus-visible {
    background: rgba(88, 212, 255, 0.3);
    color: #08121c;
    outline: none;
}

.posts-link-previews {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.posts-link-previews[hidden] {
    display: none;
}

.posts-link-preview-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.posts-link-preview-wrapper {
    position: relative;
}

.posts-link-preview {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.posts-link-preview:hover,
.posts-link-preview:focus-visible {
    border-color: var(--accent);
    transform: translateY(-1px);
    outline: none;
}

.posts-link-preview-media {
    width: 110px;
    height: 80px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.posts-link-preview-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.posts-link-preview-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
}

.posts-link-preview-title {
    font-weight: 600;
    font-size: 0.98rem;
}

.posts-link-preview-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.posts-link-preview-domain {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.posts-link-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.posts-link-preview-remove:hover {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    transform: scale(1.1);
}

.posts-link-preview-remove:active {
    transform: scale(0.95);
}

.posts-link-preview-remove svg {
    width: 14px;
    height: 14px;
}

.posts-link-preview-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.posts-card-hidden-message {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-style: italic;
}

.posts-card-content code {
    font-family: 'JetBrains Mono', 'Consolas', ui-monospace, monospace;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.posts-code-block {
    position: relative;
}

.posts-card-content pre {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Consolas', ui-monospace, monospace;
}

.posts-code-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.posts-code-copy:hover,
.posts-code-copy:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.4);
}

.posts-embeds {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.posts-embed,
.posts-inline-embed {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0;
}

.posts-embed img,
.posts-inline-embed img,
.posts-embed video {
    width: 100%;
    height: auto;
    display: block;
}

.posts-embed.is-image,
.posts-inline-embed {
    cursor: zoom-in;
}

.posts-inline-embed {
    margin: 16px 0;
    display: block;
}

.posts-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.posts-reaction-bar {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
}

.posts-reaction-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.posts-reaction-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.posts-reaction-button:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-primary);
}

.posts-reaction-button.is-active {
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-color: transparent;
}

.posts-reaction-count {
    font-weight: 600;
    color: var(--text-primary);
}

.posts-reaction-status {
    margin-left: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.posts-card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 1 1 100%;
    max-width: 100%;
    margin-left: 0;
    text-align: right;
}

.posts-card-actions .link-button {
    border: none;
    background: none;
    color: var(--accent, #4ab3ff);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.posts-card-action-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 140px;
}

.posts-visibility-control {
    position: relative;
}

.posts-visibility-trigger {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.08em;
}

.posts-visibility-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    display: none;
    flex-direction: column;
    background: rgba(5, 8, 16, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    z-index: 10;
}

.posts-visibility-menu.is-open {
    display: flex;
}

.posts-visibility-menu button {
    border: none;
    background: none;
    text-align: left;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.posts-visibility-menu button:hover,
.posts-visibility-menu button.is-active {
    background: rgba(255, 255, 255, 0.08);
}

.posts-mention-overlay {
    position: absolute;
    z-index: 1000;
    min-width: 200px;
    background: rgba(7, 10, 18, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
}

.posts-mention-overlay[hidden] {
    display: none !important;
}

.posts-mention-status {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.posts-mention-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.posts-mention-option {
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
}

.posts-mention-option.is-active,
.posts-mention-option:hover {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.posts-mention-mirror {
    position: absolute;
    visibility: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    top: 0;
    left: 0;
}

.posts-card-edit-field {
    width: 100%;
    min-height: 160px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    padding: 12px;
    font-size: 1rem;
    font-family: inherit;
}

.posts-card-edit-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.posts-attachments-toolbar .posts-card-edit-controls {
    margin-left: auto;
    margin-top: 0;
}

.posts-empty-state {
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
}

.posts-skeleton {
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
    position: relative;
}

.posts-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    animation: posts-skeleton 1.4s infinite;
}

@keyframes posts-skeleton {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.posts-attachments {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.posts-attachments-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}

.posts-attachments-toolbar .posts-card-actions {
    margin-left: auto;
    justify-content: flex-end;
}

.posts-attachments-list {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-sm);
    min-height: 80px;
    align-items: center;
}

.posts-attachments-list.is-visible {
    display: flex;
}

.posts-attachments-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.posts-attachment {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.posts-attachment-preview {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.posts-attachment-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    border: none;
    border-radius: 999px;
    background: rgba(7, 10, 18, 0.85);
    color: #fff;
    font-size: 0.7rem;
    padding: 4px 8px;
    cursor: pointer;
}

.posts-attachments-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.posts-attachments-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.posts-paginator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.posts-paginator-status {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.posts-paginator button {
    min-width: 120px;
}

.posts-media-viewer {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 16, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}

.posts-media-viewer.is-visible {
    display: flex;
}

.posts-media-viewer-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
}

.posts-media-viewer img {
    width: 100%;
    height: auto;
    max-height: 95vh;
    border-radius: var(--radius-md);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}

.posts-media-viewer-close {
    position: absolute;
    top: -52px;
    right: 0px;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.posts-thread {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.posts-thread-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.posts-thread-loader,
.posts-thread-empty {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.posts-thread-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.posts-reply {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.posts-reply-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.posts-reply-body {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 12px;
    width: 100%;
}

.posts-reply.is-hidden .posts-reply-body {
    opacity: 0.75;
    border-style: dashed;
}

.posts-reply.is-hidden .posts-reply-status {
    color: #f5cba6;
}

.posts-reply-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.posts-reply-status {
    font-size: 0.82rem;
    color: var(--text-muted);
    min-height: 1em;
}

.posts-reply-reactions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.posts-reply-reaction {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.posts-reply-reaction:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-primary);
}

.posts-reply-reaction.is-active {
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-color: transparent;
}

.posts-reply-reaction-count {
    font-weight: 600;
    color: var(--text-primary);
}

.posts-reply-actions .link-button {
    border: none;
    background: none;
    color: var(--accent, #4ab3ff);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.posts-reply-actions .link-button:hover {
    color: var(--accent-strong, #6bd0ff);
}

.posts-reply-editor {
    margin-top: 8px;
}

.posts-reply-editor .posts-editor-input {
    min-height: 120px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.posts-reply-editor textarea[data-editor-field] {
    display: none;
}

.posts-reply-edit-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.posts-reply-edit-actions button {
    background: none;
    border: none;
    color: var(--accent, #4ab3ff);
    cursor: pointer;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.posts-reply-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.posts-reply-author {
    font-weight: 600;
    color: inherit;
}

.posts-reply-handle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.posts-reply-head time {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.posts-reply-content {
    font-size: 0.95rem;
    line-height: 1.4;
}

.posts-thread-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.posts-thread-composer {
    display: flex;
    gap: 10px;
}

.posts-thread-composer img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.posts-thread-editor {
    flex: 1;
    display: flex;
}

.posts-thread-editor .posts-editor-input {
    width: 100%;
    min-height: 72px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 10px;
    background: transparent;
    color: inherit;
    line-height: 1.4;
    outline: none;
}

.posts-thread-editor .posts-editor-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
}

.posts-thread-editor .posts-editor-input[data-placeholder]:empty::before {
    color: var(--text-muted);
}

.posts-thread-editor .posts-editor-counter {
    display: none;
}

.posts-thread-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.posts-thread-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.posts-thread-toggle {
    flex: 0 0 auto;
}

.posts-thread-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex: 1 1 auto;
    min-height: 1em;
}

.posts-thread-disabled {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.posts-thread-sentinel {
    width: 100%;
    height: 2px;
}

.player-name {
    font-weight: 600;
    cursor: pointer;
}

.quote {
    font-size: 1.9em;
    line-height: 0;
    vertical-align: -0.35em;
    color: rgb(237 242 255 / 73%);
    font-family: serif;
}

@media (max-width: 768px) {
    .posts-feed {
        gap: 16px;
    }

    .posts-card {
        padding: 16px;
    }

    .posts-card-header {
        flex-direction: column;
    }

    .posts-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .posts-reaction-bar {
        justify-content: space-between;
    }
}
