/* ============================================================
   support.css – Support & Feedback Forum
   Extends docs-modern.css variables (--primary, --background, etc.)
   ============================================================ */

/* ── Layout ──────────────────────────────────────────────── */

.forum-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    min-height: calc(100vh - var(--nav-height, 64px));
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.forum-sidebar {
    padding: 2rem 1.5rem 2rem 0;
    border-right: 1px solid var(--border);
    position: sticky;
    top: calc(var(--nav-height, 64px) + 1rem);
    height: calc(100vh - var(--nav-height, 64px) - 2rem);
    overflow-y: auto;
    scrollbar-width: none;
}

.forum-sidebar::-webkit-scrollbar {
    display: none;
}

.forum-content {
    padding: 2rem 0 2rem 2rem;
    min-width: 0;
}

/* ── Page header ─────────────────────────────────────────── */

.forum-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.forum-page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    margin: 0 0 0.5rem;
}

.forum-page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* ── Breadcrumb ──────────────────────────────────────────── */

.forum-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.forum-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.forum-breadcrumb a:hover {
    color: var(--primary);
}

.forum-breadcrumb .sep {
    color: var(--border);
    font-size: 1rem;
    line-height: 1;
}

/* ── Sidebar categories ──────────────────────────────────── */

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

.category-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}

.category-nav li+li {
    margin-top: 2px;
}

.category-nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.category-nav-link:hover {
    background: var(--surface-light);
    color: var(--text);
}

.category-nav-link.active {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-weight: 500;
}

.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cat-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    line-height: 1.4;
}

/* New topic button */
.btn-new-topic {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-new-topic:hover {
    filter: brightness(1.1);
}

.btn-new-topic svg {
    width: 16px;
    height: 16px;
}

/* ── Toolbar (tabs + search) ─────────────────────────────── */

.forum-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.forum-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
}

.forum-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8375rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.forum-tab svg {
    width: 14px;
    height: 14px;
}

.forum-tab:hover {
    color: var(--text);
}

.forum-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.forum-search {
    flex: 1;
    min-width: 180px;
    position: relative;
}

.forum-search svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

.forum-search-input {
    width: 100%;
    padding: 0.5rem 0.875rem 0.5rem 2.25rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.forum-search-input::placeholder {
    color: var(--text-muted);
}

.forum-search-input:focus {
    border-color: var(--primary);
}

/* ── Topic list ──────────────────────────────────────────── */

.topic-list-header {
    display: grid;
    grid-template-columns: 1fr 80px 80px 90px;
    gap: 0;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
    align-items: center;
}

.topic-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px 90px;
    gap: 0;
    align-items: center;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.15s;
    text-decoration: none;
}

.topic-row:hover {
    background: var(--surface-light);
    border-color: var(--border);
}

.topic-row+.topic-row {
    margin-top: 3px;
}

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

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    background: rgba(var(--badge-rgb, 59, 130, 246), 0.12);
    color: var(--badge-color, #3b82f6);
    margin-bottom: 0.35rem;
    transition: opacity 0.15s;
}

.category-badge:hover {
    opacity: 0.8;
}

.topic-title-link {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
    text-decoration: none;
    display: block;
    line-height: 1.35;
    margin-bottom: 0.35rem;
    transition: color 0.15s;
}

.topic-title-link:hover {
    color: var(--primary);
}

.topic-meta-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.avatar-xs {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.avatar-md {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.avatar-lg {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.topic-author-name {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.topic-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.925rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

.activity-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* ── Empty state ─────────────────────────────────────────── */

.forum-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.forum-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.forum-empty p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ── Pagination ──────────────────────────────────────────── */

.forum-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-light);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.page-btn:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    font-weight: 700;
}

/* ── Topic detail layout ─────────────────────────────────── */

.topic-detail-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 2rem;
    align-items: start;
}

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

.topic-detail-sidebar {
    position: sticky;
    top: calc(var(--nav-height, 64px) + 1rem);
}

/* ── Topic detail header ─────────────────────────────────── */

.topic-detail-header {
    margin-bottom: 1.5rem;
}

.topic-detail-title {
    font-size: 1.625rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text);
    margin: 0.75rem 0 1rem;
}

.topic-author-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.topic-counters {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.counter-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.counter-pill svg {
    width: 14px;
    height: 14px;
}

/* ── Post / Reply cards ──────────────────────────────────── */

.post-card {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.post-author-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
}

.post-author-name a {
    color: inherit;
    text-decoration: none;
}

.post-author-name a:hover {
    color: var(--primary);
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
}

.post-body {
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 0.9375rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-body a {
    color: var(--primary);
    text-decoration: none;
}

.post-body a:hover {
    text-decoration: underline;
}

.post-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ── Vote controls ───────────────────────────────────────── */

.vote-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.vote-btn svg {
    width: 14px;
    height: 14px;
}

.vote-btn:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.vote-btn.vote-up.voted {
    background: rgba(34, 197, 94, 0.12);
    border-color: #22c55e;
    color: #22c55e;
}

.vote-btn.vote-down.voted {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
    color: #ef4444;
}

.vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Top replies section ─────────────────────────────────── */

.section-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 2rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-heading svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.top-replies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.top-reply-card {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.top-reply-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}

.top-reply-excerpt {
    font-size: 0.8375rem;
    color: var(--text-secondary);
    line-height: 1.55;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
}

.top-reply-score {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: #22c55e;
    font-weight: 600;
}

.top-reply-score svg {
    width: 13px;
    height: 13px;
}

/* ── Reply editor ────────────────────────────────────────── */

.reply-editor {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 1.5rem;
}

.reply-editor-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: var(--surface-light);
    border-bottom: 1px solid var(--border);
}

.editor-tabs {
    display: flex;
    gap: 4px;
}

.editor-tab {
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.editor-tab:hover {
    color: var(--text);
}

.editor-tab.active {
    background: var(--surface);
    color: var(--text);
}

.reply-textarea {
    width: 100%;
    min-height: 140px;
    padding: 1.25rem;
    background: var(--surface);
    border: none;
    color: var(--text);
    font-size: 0.9375rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

.reply-preview {
    padding: 1.25rem;
    min-height: 100px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
    display: none;
}

.reply-preview.active {
    display: block;
}

.reply-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--surface-light);
    border-top: 1px solid var(--border);
    gap: 1rem;
}

.char-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-post-reply {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: filter 0.15s;
}

.btn-post-reply:hover {
    filter: brightness(1.1);
}

.btn-post-reply svg {
    width: 15px;
    height: 15px;
}

.login-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-prompt a {
    color: var(--primary);
    text-decoration: none;
}

.login-prompt a:hover {
    text-decoration: underline;
}

/* ── Topic sidebar cards ─────────────────────────────────── */

.sidebar-card {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.sidebar-card-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Timeline */
.timeline-rail {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 1rem;
    position: relative;
}

.timeline-point {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    padding-bottom: 1.25rem;
}

.timeline-point:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    margin-top: 3px;
    margin-left: -1.3rem;
    border: 2px solid var(--surface-light);
    position: relative;
    z-index: 1;
}

.timeline-dot.active {
    background: var(--primary);
    border-color: var(--surface-light);
}

.timeline-point:not(:last-child)::after {
    content: '';
    position: absolute;
    left: -0.95rem;
    top: 14px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-type {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.timeline-time {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Stats sidebar */
.sidebar-stats {
    display: flex;
    gap: 1rem;
}

.sidebar-stat {
    flex: 1;
    text-align: center;
}

.sidebar-stat-value {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--text);
    display: block;
    line-height: 1.2;
}

.sidebar-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── New topic form ──────────────────────────────────────── */

.new-topic-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
}

.form-card {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.form-card-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border);
}

.form-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.25rem;
}

.form-card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.form-card-body {
    padding: 1.75rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.form-label span {
    color: var(--primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.65rem 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9375rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
}

.form-textarea {
    resize: vertical;
    min-height: 200px;
    line-height: 1.6;
}

.form-select option {
    background: var(--surface);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    display: block;
}

.alert-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #f87171;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.alert-error svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-cancel {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-cancel:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-submit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: filter 0.15s;
}

.btn-submit:hover {
    filter: brightness(1.1);
}

.btn-submit svg {
    width: 15px;
    height: 15px;
}

/* Tips sidebar */
.tips-card {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    position: sticky;
    top: calc(var(--nav-height, 64px) + 1rem);
}

.tips-card-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tips-card-title svg {
    width: 15px;
    height: 15px;
    color: var(--primary);
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.tips-list li {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8375rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-bottom: 0.75rem;
}

.tips-list li:last-child {
    padding-bottom: 0;
}

.tips-list li svg {
    width: 14px;
    height: 14px;
    color: #22c55e;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── User profile ────────────────────────────────────────── */

.user-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.user-profile-info {
    flex: 1;
    min-width: 0;
}

.user-profile-name {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 0.25rem;
}

.user-profile-joined {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.user-profile-stats-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.user-profile-stat {
    display: flex;
    flex-direction: column;
}

.user-profile-stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.user-profile-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Profile tabs */
.profile-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.profile-tab {
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s;
}

.profile-tab:hover {
    color: var(--text);
}

.profile-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.profile-tab-panel {
    display: none;
}

.profile-tab-panel.active {
    display: block;
}

/* Top content cards */
.top-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.top-content-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.top-content-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-light);
    margin-bottom: 0.5rem;
    text-decoration: none;
    transition: border-color 0.15s;
}

.top-content-item:hover {
    border-color: var(--text-muted);
}

.top-content-item-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.top-content-item-text {
    font-size: 0.875rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

/* User reply list */
.user-reply-item {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    background: var(--surface-light);
    transition: border-color 0.15s;
}

.user-reply-item:hover {
    border-color: var(--text-muted);
}

.user-reply-topic-link {
    font-size: 0.7rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.user-reply-body {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.55;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.user-reply-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.625rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--surface-light) 25%, var(--border) 50%, var(--surface-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-row {
    height: 72px;
    border-radius: 10px;
    margin-bottom: 6px;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 1024px) {
    .topic-detail-layout {
        grid-template-columns: 1fr;
    }

    .topic-detail-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .new-topic-layout {
        grid-template-columns: 1fr;
    }

    .tips-card {
        position: static;
    }

    .top-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .forum-layout {
        grid-template-columns: 1fr;
        padding: 0 1rem 3rem;
    }

    .forum-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1.25rem 0;
        display: none;
    }

    .forum-sidebar.mobile-open {
        display: block;
    }

    .forum-content {
        padding: 1.25rem 0 0;
    }

    .topic-list-header {
        display: none;
    }

    .topic-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .topic-row>.stat-cell,
    .topic-row>.activity-cell {
        display: none;
    }

    .forum-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .topic-counters {
        margin-left: 0;
    }

    .user-profile-header {
        gap: 1rem;
    }

    .user-profile-stats-row {
        gap: 1rem;
    }
}
/*  Tracker.gg-style reply cards  */
.trn-reply-card { display: flex; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.trn-reply-card:first-child { padding-top: 0.5rem; }
.trn-reply-card:last-child  { border-bottom: none; padding-bottom: 0; }
.trn-reply-avatar { flex-shrink: 0; padding-top: 2px; }
.trn-reply-avatar-circle { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 800; color: #fff; }
.trn-reply-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.trn-reply-header { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.trn-reply-author { font-size: .95rem; font-weight: 700; color: rgba(255,255,255,.92); text-decoration: none; transition: color .15s; }
.trn-reply-author:hover { color: var(--primary, #f5a623); }
.trn-reply-date { font-size: .78rem; color: rgba(255,255,255,.35); margin-left: auto; }
.trn-reply-content { font-size: .925rem; line-height: 1.65; color: rgba(255,255,255,.78); white-space: pre-wrap; word-break: break-word; }
.trn-reply-footer { display: flex; align-items: center; gap: .75rem; margin-top: .15rem; }
.trn-vote-btn { display: inline-flex; align-items: center; gap: .35rem; background: none; border: none; color: rgba(255,255,255,.35); cursor: pointer; font-size: .8rem; font-weight: 600; padding: .25rem .5rem; border-radius: 6px; transition: background .15s, color .15s; }
.trn-vote-btn:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.8); }
.trn-vote-btn.voted { color: #ef4444; }
.trn-share-btn { display: inline-flex; align-items: center; gap: .35rem; background: none; border: none; color: rgba(255,255,255,.3); cursor: pointer; font-size: .8rem; font-weight: 500; padding: .25rem .5rem; border-radius: 6px; transition: background .15s, color .15s; }
.trn-share-btn:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.7); }

/*  Delete button  */
.trn-delete-btn { display:inline-flex;align-items:center;gap:.3rem;background:none;border:none;color:rgba(248,113,113,.5);cursor:pointer;font-size:.78rem;font-weight:500;padding:.25rem .5rem;border-radius:6px;transition:background .15s,color .15s;margin-left:auto; }
.trn-delete-btn:hover { background:rgba(248,113,113,.1);color:#f87171; }

/*  .voted-down (dislike)  */
.trn-vote-btn.voted-down { color:#f97316; }

/*  Improved reply editor (replyEnd)  */
#replyEnd .section-heading { margin-bottom:1rem; }
.reply-editor { background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.1);border-radius:14px;overflow:hidden;transition:border-color .2s; }
.reply-editor:focus-within { border-color:rgba(245,166,35,.4); }
.reply-editor-header { display:flex;align-items:center;gap:.75rem;padding:.875rem 1.25rem;border-bottom:1px solid rgba(255,255,255,.07); }
.reply-textarea { width:100%;background:transparent;border:none;resize:none;color:rgba(255,255,255,.87);font-family:inherit;font-size:.925rem;line-height:1.65;padding:1rem 1.25rem;outline:none;caret-color:var(--primary,#f5a623); }
.reply-textarea::placeholder { color:rgba(255,255,255,.25); }
.reply-editor-footer { display:flex;align-items:center;justify-content:flex-end;gap:1rem;padding:.75rem 1.25rem;border-top:1px solid rgba(255,255,255,.07);background:rgba(255,255,255,.02); }

/*  login-prompt  */
.login-prompt { display:flex;align-items:center;gap:.75rem;padding:1.25rem;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.09);border-radius:12px;color:rgba(255,255,255,.55);font-size:.9rem; }
.login-prompt a { color:var(--primary,#f5a623);text-decoration:none;font-weight:600; }
.login-prompt a:hover { text-decoration:underline; }

/*  FIX: login-prompt only shows when not hidden  */
.login-prompt { display: none; align-items: center; gap: .75rem; padding: 1.25rem; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; color: rgba(255,255,255,.55); font-size: .9rem; }
.login-prompt:not([hidden]) { display: flex; }
.login-prompt a { color: var(--primary, #f5a623); text-decoration: none; font-weight: 600; }
.login-prompt a:hover { text-decoration: underline; }

/*  @mention dropdown  */
.mention-dropdown { position:absolute;bottom:calc(100% + 6px);left:0;right:0;background:#1a1a2e;border:1px solid rgba(255,255,255,.12);border-radius:10px;overflow:hidden;list-style:none;margin:0;padding:.25rem 0;z-index:200;box-shadow:0 8px 32px rgba(0,0,0,.5);max-height:220px;overflow-y:auto; }
.mention-item { display:flex;align-items:center;gap:.625rem;padding:.5rem .875rem;cursor:pointer;transition:background .12s; }
.mention-item:hover,.mention-item.active { background:rgba(255,255,255,.07); }
.mention-avatar { width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.65rem;font-weight:800;color:#fff;flex-shrink:0; }
.mention-name { font-size:.875rem;font-weight:600;color:rgba(255,255,255,.88); }

/*  @mention dropdown (position via JS fixed, overrides old rule)  */
.mention-dropdown { background:#1a1a2e;border:1px solid rgba(255,255,255,.12);border-radius:10px;overflow:hidden;list-style:none;margin:0;padding:.25rem 0;box-shadow:0 8px 32px rgba(0,0,0,.6);max-height:220px;overflow-y:auto; }

/*  Clickable @mentions in reply bodies  */
.mention-link { color: var(--primary, #f5a623); font-weight: 600; text-decoration: none; }
.mention-link:hover { text-decoration: underline; }
