.thread-header-card {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}
.thread-header-card .card__header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background-color: var(--color-bg-alt);
}
.breadcrumb-nav {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}
.breadcrumb-nav a {
    color: var(--color-primary-500);
    text-decoration: none;
}
.breadcrumb-nav a:hover {
    text-decoration: none;
}
.thread-header__title-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}
.thread-header__title {
    font-size: 2rem;
    font-weight: var(--fw-bold);
    margin: 0;
    line-height: var(--line-height-heading);
    word-break: break-word;
}
.thread-header__actions {
    flex-shrink: 0;
}
.thread-header__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}
.thread-header__meta .author-link {
    font-weight: var(--fw-medium);
    color: var(--color-text);
}
.thread-header__meta .meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.post {
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-top: none;
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.post--original {
    border-radius: 0;
    border-top: 1px solid var(--color-border);
    margin-bottom: var(--space-lg);
}
.post--original:first-child {
     border-top-left-radius: 0;
     border-top-right-radius: 0;
     border-bottom-left-radius: var(--radius-lg);
     border-bottom-right-radius: var(--radius-lg);
     border-top: none;
}
.form-text-counter {
    margin-right: 5px;
    padding-bottom: var(--space-base);
}
.post__author {
    padding: var(--space-lg);
    border-inline-end: 1px solid var(--color-border);
    background-color: var(--color-bg-muted);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-md);
}
.post__author .author-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-sm);
    position: relative;
    background-color: var(--color-border);
}
.author-avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}
.author-avatar__placeholder {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    background-color: var(--color-primary-500);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: var(--fw-bold);
}
.author-avatar__rep {
    position: absolute;
    bottom: 0;
    inset-inline-end: 0;
    background-color: var(--color-success);
    color: #ffffff;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-bg-muted);
}
.author-info__name {
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--color-text);
    margin: 0;
    text-decoration: none;
}
.author-info__name:hover {
    color: var(--color-primary-500);
    text-decoration: none;
}
.author-info__username {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    direction: ltr;
}
.author-info__role {
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-top: var(--space-xs);
    display: inline-block;
    background-color: var(--color-border);
    color: var(--color-text-muted);
}
.author-info__role--admin { background-color: hsl(350, 75%, 95%); color: var(--color-error); }
.author-info__role--moderator { background-color: hsl(140, 75%, 95%); color: var(--color-success); }
.dark-theme .author-info__role--admin { background-color: hsl(350, 75%, 15%); }
.dark-theme .author-info__role--moderator { background-color: hsl(140, 75%, 15%); }
.post__main {
    display: flex;
    flex-direction: column;
    min-width: 0; 
}
.post__header-meta {
    display: flex;
    align-items: center;
    margin-right: auto;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-top: auto;
}
.post__content {
    padding: var(--space-lg);
    font-size: 1.05rem;
    line-height: var(--line-height-base);
    word-wrap: break-word;
}
.post__content h2 { font-size: 1.5rem; margin-top: var(--space-lg); }
.post__content h3 { font-size: 1.2rem; margin-top: var(--space-md); }
.post__content blockquote {
    padding-inline-start: var(--space-md);
    margin-inline-start: 0;
    border-inline-start: 4px solid var(--color-border);
    color: var(--color-text-muted);
    font-style: italic;
    margin: var(--space-sm) 0;
    padding-block: var(--space-xs);
}
.post__content pre {
    background-color: var(--color-bg-muted);
    color: var(--color-text);
    font-family: monospace;
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: var(--space-sm) 0;
}
.post__content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: var(--space-md) 0;
}
.post__footer {
    padding: var(--space-sm) var(--space-lg);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; 
}
.post__vote-controls {
    display: flex;
    gap: var(--space-xs);
}
.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-muted);
    color: var(--color-text-muted);
}
.vote-btn:hover {
    background-color: var(--color-border);
    color: var(--color-text);
}
.vote-btn.active {
    background-color: var(--color-primary-100);
    color: var(--color-primary-500);
}
.dark-theme .vote-btn.active {
    background-color: hsl(210, 85%, 20%);
}
.vote-btn svg { width: 16px; height: 16px; }
.vote-count { font-weight: var(--fw-medium); }
.post__utility-actions {
    display: flex;
    gap: var(--space-sm);
}
.action-btn {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}
.action-btn:hover {
    color: var(--color-text);
}
.reply-form-section .card__header {
    background-color: var(--color-bg-muted);
}
.reply-form-section textarea {
    min-height: 100px;
    resize: vertical;
}
.reply-form-section .form-text-counter.error {
    color: var(--color-error);
}
.alert--locked,
.alert--guest {
    font-size: var(--fs-lg);
}
.report-modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}
.report-modal__content {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.report-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
}
.report-modal__header h3 {
    margin: 0;
    font-size: 1.25rem;
}
.report-modal__close {
    font-size: 1.5rem;
    font-weight: var(--fw-bold);
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.report-modal__close:hover {
    color: var(--color-text);
}
.report-modal__form .auth-form__group {
    margin-bottom: var(--space-md);
}
.report-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}
.report-modal__footer .button--error {
    background-color: var(--color-error);
}
.share-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}
.share-modal-content {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
}
.share-modal-close {
    font-size: 1.5rem;
    font-weight: var(--fw-bold);
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
}
.share-modal-close:hover {
    color: var(--color-text);
}
.badge--solved { background-color: #28a745; color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.6em; vertical-align: middle; margin-left: 5px; display: inline-block; }
.badge--locked { background-color: #dc3545; color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.6em; vertical-align: middle; margin-left: 5px; display: inline-block; }
.thread-controls { display: flex; gap: 10px; margin-top: 15px; padding-top: 10px; border-top: 1px solid var(--border-color); }
.thread-controls .button { font-size: 0.85em; padding: 6px 12px; display: flex; align-items: center; gap: 5px;}
.thread-controls .btn-solved.active { background-color: #28a745; border-color: #28a745; color: white; }
.thread-controls .btn-solved.active:hover { background-color: #218838; }
.thread-controls .btn-locked.active { background-color: #dc3545; border-color: #dc3545; color: white; }
.thread-controls .btn-locked.active:hover { background-color: #c82333; }
.social-share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}
.button-icon.facebook:hover { background-color: #1877F2; color: white; border-color: #1877F2; }
.button-icon.x-twitter:hover { background-color: #000000; color: white; border-color: #000000; }
.button-icon.linkedin:hover { background-color: #0A66C2; color: white; border-color: #0A66C2; }
.button-icon.whatsapp:hover { background-color: #25D366; color: white; border-color: #25D366; }
.button-icon.telegram:hover { background-color: #0088cc; color: white; border-color: #0088cc; }
.button-icon.email:hover { background-color: #EA4335; color: white; border-color: #EA4335; }
.modal-overlay, .modal-content { 
    opacity: 1;
    visibility: visible;
}
#category-rules-modal .modal-content {
    max-height: 80vh;
}
#category-rules-body {
    max-height: 60vh;
    overflow: auto;
}
@media (max-width: 767px) {
    .thread-header__title-actions { flex-direction: column; align-items: stretch; }
    .thread-header__title { font-size: 1.5rem; }
    .post {
        grid-template-columns: 1fr; 
    }
    .post__author {
        grid-row: 1;
        flex-direction: row;
        text-align: start;
        padding: var(--space-sm) var(--space-md);
        border-inline-end: none;
        border-bottom: 1px solid var(--color-border);
        gap: var(--space-xxs);
    }
    .post__main {
        grid-row: 2;
    }
    .author-avatar {
        width: 48px;
        height: 48px;
        margin-bottom: 0;
        margin-inline-end: var(--space-sm);
    }
    .author-avatar__placeholder { font-size: 1.5rem; }
    .author-avatar__rep { font-size: 0.6rem; padding: 1px 4px; }
    .post__author .author-info {
        position: relative;
        padding-top: var(--space-lg);
    }
    .author-info__name {
        font-size: 1rem;
        position: absolute;
        top: 0;
        right: 0;
        white-space: nowrap;
    }
    .author-info__role { margin-top: 0; }
    .post__header {
        flex-direction: column;
        align-items: flex-end;
    }
    .post__content {
        padding: var(--space-md);
        font-size: 1rem;
    }
    .post__footer {
        padding: var(--space-sm) var(--space-md);
    }
}