/* ================================================================
   RetroNews – Retrocomputing Community
   Amber-CRT-inspired theme
   ================================================================ */

/* ── Reset & Tokens ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --clr-primary:     #FFB000;
    --clr-primary-dk:  #E09E00;
    --clr-accent:      #FF6600;
    --clr-bg:          #f6f6ef;
    --clr-white:       #ffffff;
    --clr-dark:        #1a1a2e;
    --clr-text:        #333333;
    --clr-meta:        #828282;
    --clr-border:      #e0e0e0;
    --clr-success:     #28a745;
    --clr-danger:      #dc3545;
    --font-main:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono:       "IBM Plex Mono", "Fira Code", "Courier New", monospace;
    --max-w:           860px;
}

body {
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.5;
    color: var(--clr-text);
    background: var(--clr-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--clr-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: #86868a; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; width: 100%; }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
    background: var(--clr-dark);
    border-bottom: 3px solid var(--clr-primary);
}
.header-nav {
    display: flex; align-items: center; justify-content: space-between;
    height: 48px; gap: 16px;
}
.header-left { display: flex; align-items: center; gap: 16px; }

.logo {
    font-family: var(--font-mono);
    font-size: 16px; font-weight: 700;
    color: var(--clr-primary) !important;
    text-decoration: none !important;
    white-space: nowrap;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.logo-icon { color: var(--clr-primary); }
.logo-img { height: 24px; width: auto; vertical-align: middle; }

.nav-links { display: flex; gap: 12px; }
.nav-links a { color: #ccc; font-size: 13px; text-decoration: none; padding: 4px 0; }
.nav-links a:hover,
.nav-links a.active { color: var(--clr-primary); }
.nav-links a:visited { color: #ccc; }
.nav-links a:visited:hover,
.nav-links a:visited.active { color: var(--clr-primary); }

.header-right { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.header-right a { color: #ccc; }
.header-right a:hover { color: var(--clr-primary); }
.header-right a:visited { color: #ccc; }
.header-right .karma { color: var(--clr-primary); font-size: 12px; }
.header-right .sep { color: #555; }

/* ── Main ───────────────────────────────────────────────────── */
main.container { flex: 1; padding-top: 16px; padding-bottom: 32px; }

/* ── Page header ────────────────────────────────────────────── */
.page-header { margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--clr-border); }
.page-header h1 { font-size: 18px; font-weight: 600; color: var(--clr-dark); }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
.alert-error   { background: #fce4e4; color: #c62828; border: 1px solid #f5c6c6; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }

/* ── Listing Filter Bar ─────────────────────────────────────── */
.listing-filter-bar {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--clr-white);
    border: 1px solid var(--clr-border);
    border-radius: 4px;
}
.filter-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.filter-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.filter-right {
    margin-left: auto;
}
.filter-search-input {
    padding: 5px 10px;
    border: 1px solid var(--clr-border);
    border-radius: 3px;
    font-size: 13px;
    background: var(--clr-bg);
    color: var(--clr-text);
    min-width: 180px;
    flex: 1;
}
.filter-search-input:focus {
    border-color: var(--clr-primary);
    outline: none;
}
.filter-tag-select {
    padding: 5px 8px;
    border: 1px solid var(--clr-border);
    border-radius: 3px;
    font-size: 13px;
    background: var(--clr-bg);
    color: var(--clr-text);
    min-width: 120px;
}
.filter-btn { font-size: 12px; }
.filter-clear { font-size: 12px; }
.filter-active-tag {
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-tag-label {
    font-size: 13px;
    color: var(--clr-text);
    white-space: nowrap;
}

/* ── Post list ──────────────────────────────────────────────── */
.post-list {
    background: var(--clr-white);
    border-radius: 4px;
    border: 1px solid var(--clr-border);
}
.post-item {
    display: flex; align-items: flex-start;
    padding: 8px 12px; border-bottom: 1px solid #f0f0f0;
}
.post-item:last-child { border-bottom: none; }

.post-rank {
    color: var(--clr-meta); font-size: 15px; font-weight: 700;
    min-width: 28px; text-align: left;
    padding-top: 2px; margin-right: 4px;
}
.post-rank-hidden {
    min-width: 28px; margin-right: 4px; visibility: hidden;
}

/* Vote button (shared) */
.vote-btn {
    background: none; border: none; cursor: pointer;
    color: var(--clr-meta); font-size: 16px;
    padding: 0 4px; line-height: 1;
    transition: color .15s;
}
.vote-btn:hover { color: var(--clr-primary); }
.vote-btn.voted { color: var(--clr-primary); }
.vote-btn:disabled { cursor: default; opacity: .3; }
.vote-btn-sm { font-size: 12px; }

/* Downvote button */
.downvote-btn:hover { color: var(--clr-danger); }
.downvote-btn.voted { color: var(--clr-danger); }

/* Vote column layout */
.post-vote { display: flex; flex-direction: column; align-items: center; margin-right: 8px; padding-top: 1px; gap: 0; position: relative; }

/* Score box (replaces vote buttons in listings) */
.post-score-box {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; min-width: 42px;
    border-radius: 4px; margin-right: 10px;
    font-weight: 700;
}
.post-score-number { font-size: 16px; color: #fff; line-height: 1; }
.score-positive { background: var(--clr-success); }
.score-negative { background: var(--clr-danger); }
.score-neutral  { background: var(--clr-meta); }

/* Post badges (right side of post item) */
.post-badges {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 4px;
    margin-left: auto; padding-left: 8px; min-width: 24px;
}
.post-following-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 3px;
    font-size: 14px; font-weight: 600;
    background: #e3f2fd; color: #1565c0;
}

/* @mention links */
.mention-link {
    color: #5ba8ff;
    font-weight: 600;
    text-decoration: none;
}
.mention-link:hover {
    color: #7dbcff;
    text-decoration: underline;
}

/* @Mention Autocomplete Popup */
.mention-popup {
    position: absolute;
    z-index: 1000;
    background: var(--clr-dark, #1a1a2e);
    border: 1px solid var(--clr-border, #333);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    max-width: 260px;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px 0;
}
.mention-item {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #e0e0e0;
    transition: background 0.1s;
}
.mention-item:hover,
.mention-item.active {
    background: var(--clr-primary, #FFB000);
    color: var(--clr-dark, #1a1a2e);
}
.mention-username {
    font-family: var(--font-mono, monospace);
    font-weight: 600;
}

/* Downvote reason dropdown */
.downvote-reasons {
    position: absolute; z-index: 100;
    background: var(--clr-white);
    border: 1px solid var(--clr-border);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    padding: 6px;
    display: flex; flex-direction: column; gap: 4px;
    min-width: 120px;
    margin-top: 2px;
}
.downvote-reasons-title {
    font-size: 11px; color: var(--clr-meta);
    font-weight: 600; padding: 2px 4px;
}
.downvote-reasons button {
    background: none; border: 1px solid var(--clr-border);
    border-radius: 3px; padding: 4px 8px;
    font-size: 12px; cursor: pointer;
    text-align: left; color: var(--clr-text);
    transition: background .15s;
}
.downvote-reasons button:hover {
    background: #fce4e4; border-color: var(--clr-danger);
}
.downvote-reasons .downvote-cancel {
    color: var(--clr-meta); border-color: transparent;
}
.downvote-reasons .downvote-cancel:hover {
    background: #f0f0f0; border-color: var(--clr-border);
}

.post-content { flex: 1; min-width: 0; }
.post-title-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }

/* Post type badges */
.post-type-badge {
    display: inline-block; padding: 1px 6px; border-radius: 3px;
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.3px; vertical-align: baseline; line-height: 1.6;
    white-space: nowrap;
}
.type-link  { background: #e3f2fd; color: #1565c0; }
.type-text  { background: #f3e5f5; color: #7b1fa2; }
.type-ask   { background: #fff3e0; color: #e65100; }
.type-show  { background: #e8f5e9; color: #2e7d32; }

.post-title { font-size: 14px; font-weight: 500; color: var(--clr-text) !important; text-decoration: none; }
.post-title:visited { color: var(--clr-meta) !important; }
.post-title:hover { text-decoration: underline; }

.post-domain { font-size: 11px; color: var(--clr-meta); }

.post-meta { font-size: 11px; color: var(--clr-meta); margin-top: 2px; }
.post-summary-line { font-size: 12px; color: var(--clr-dark); margin-top: 2px; opacity: 0.75; }
.post-meta a { color: var(--clr-meta); }
.post-meta a:visited { color: var(--clr-meta); }
.post-meta a:hover { text-decoration: underline; }
.post-meta .sep { margin: 0 2px; }
.post-meta .role-badge { font-size: 9px; padding: 0 4px; vertical-align: baseline; margin-left: 2px; }
.post-author-link { font-weight: 500; }

/* Sandbox tag in meta */
.sandbox-tag {
    display: inline-block; padding: 0 4px; border-radius: 3px;
    font-size: 9px; font-weight: 600; text-transform: uppercase;
    background: #fff3cd; color: #856404; letter-spacing: 0.3px;
    vertical-align: baseline; margin-left: 2px;
}

/* Downvote count in meta */
.meta-downvotes { color: var(--clr-danger); font-size: 10px; margin-left: 1px; }

/* Post detail title row */
.post-detail-title-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* ── Post detail ────────────────────────────────────────────── */
.post-detail {
    background: var(--clr-white); border-radius: 4px;
    border: 1px solid var(--clr-border); padding: 16px; margin-bottom: 24px;
}
.post-detail-header { display: flex; align-items: flex-start; gap: 12px; }
.post-detail-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.post-detail-title a { color: var(--clr-text); }
.post-detail-title a:hover { color: var(--clr-accent); }
.post-detail-title .post-domain { font-size: 13px; font-weight: 400; }
.post-text {
    margin-top: 16px; padding-top: 16px;
    border-top: 1px solid var(--clr-border);
    line-height: 1.6; word-wrap: break-word;
}
.post-summary {
    margin-top: 12px; padding: 10px 14px;
    background: #fefcf0; border-left: 3px solid var(--clr-primary);
    font-size: 13px; line-height: 1.5; color: var(--clr-dark);
}
.post-summary strong { font-weight: 600; margin-right: 4px; }
.post-edited { color: var(--clr-meta); font-size: 12px; font-style: italic; }
.post-edit-link { font-size: 12px; color: var(--clr-meta); }
.post-edit-link:hover { color: var(--clr-accent); }
.post-delete-btn { background: none; border: none; color: var(--clr-meta); text-decoration: underline; font-size: 12px; cursor: pointer; padding: 0; font-family: inherit; }
.post-delete-btn:hover { color: #d9534f; }
.post-owner-actions { display: inline; }
.post-owner-actions .inline-form,
.post-meta .inline-form { display: inline; }
.edit-history {
    margin-top: 16px; padding: 10px 14px;
    border: 1px solid var(--clr-border); border-radius: 4px;
    background: var(--clr-white); font-size: 12px;
}
.edit-history summary { cursor: pointer; font-weight: 600; color: var(--clr-meta); }
.edit-history summary:hover { color: var(--clr-dark); }
.edit-history-list { margin: 8px 0 0; padding-left: 20px; }
.edit-history-list li { margin-bottom: 4px; color: var(--clr-meta); }
.edit-history-list .edit-date { font-family: var(--font-mono); }

/* ── Comments ───────────────────────────────────────────────── */
.comments-section h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--clr-dark); }

.comment-form { margin-bottom: 24px; }
.comment-form textarea,
.reply-form textarea {
    width: 100%; padding: 10px;
    border: 1px solid var(--clr-border); border-radius: 4px;
    font-family: var(--font-main); font-size: 13px;
    resize: vertical; margin-bottom: 8px;
}
.comment-form textarea:focus,
.reply-form textarea:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 2px rgba(255,176,0,.2);
}

.comment {
    padding: 10px 0; border-left: 2px solid #e8e8e8;
    padding-left: 12px; margin-bottom: 8px;
}
.comment-header {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--clr-meta); margin-bottom: 4px;
}
.comment-author { font-weight: 600; color: var(--clr-text) !important; }
.comment-header .role-badge { font-size: 9px; padding: 0 4px; }
.comment-time   { color: var(--clr-meta); }
.comment-score  { color: var(--clr-meta); font-family: var(--font-mono); font-size: 11px; }
.comment-body   { font-size: 13px; line-height: 1.5; margin-bottom: 6px; word-wrap: break-word; }
.comment-actions { font-size: 12px; }
.comment-actions a { color: var(--clr-meta); text-decoration: underline; }
.comment-actions .inline-form { display: inline; }
.comment-delete-btn { background: none; border: none; color: var(--clr-meta); text-decoration: underline; font-size: 12px; cursor: pointer; padding: 0; font-family: inherit; }
.comment-delete-btn:hover { color: #d9534f; }
.comment-edited { color: var(--clr-meta); font-size: 11px; font-style: italic; }
.edit-form { margin-top: 8px; margin-bottom: 8px; }
.edit-form textarea { width: 100%; padding: 8px; font-size: 13px; border: 1px solid #ccc; border-radius: 4px; font-family: inherit; resize: vertical; box-sizing: border-box; }
.btn-cancel { background: var(--clr-meta); }

/* OP badge (original poster) */
.op-badge {
    display: inline-block; padding: 0 4px; border-radius: 3px;
    font-size: 9px; font-weight: 700; text-transform: uppercase;
    background: var(--clr-primary); color: var(--clr-dark);
    letter-spacing: 0.3px; line-height: 1.6;
}

.reply-form { margin-top: 8px; margin-bottom: 8px; }

.login-prompt { color: var(--clr-meta); font-size: 13px; margin-bottom: 16px; }

/* ── Forms (auth pages) ─────────────────────────────────────── */
.form-page { max-width: 400px; margin: 32px auto; }
.form-page.settings-page { max-width: 700px; }
.form-page h1 { font-size: 22px; margin-bottom: 4px; color: var(--clr-dark); }
.radio-group { display: flex; flex-direction: column; gap: 6px; }
.radio-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.radio-label input[disabled] + * { opacity: 0.5; }
.profile-username-sub { font-size: 13px; color: var(--clr-meta); }
.form-hint { color: var(--clr-meta); font-size: 13px; margin-bottom: 20px; }
.sandbox-notice {
    background: #fff3cd; border: 1px solid #ffc107; border-radius: 4px;
    padding: 10px 14px; margin-bottom: 16px; font-size: 13px; color: #856404;
}

/* ── Submit Page ────────────────────────────────────────────── */
.submit-page { max-width: 680px; margin: 0 auto; }
.submit-header { margin-bottom: 20px; }
.submit-header h1 { font-size: 22px; font-weight: 700; color: var(--clr-dark); margin-bottom: 4px; }
.submit-subtitle { color: var(--clr-meta); font-size: 13px; }
.submit-form { max-width: none; }

.submit-card {
    background: var(--clr-white);
    border: 1px solid var(--clr-border);
    border-radius: 6px;
    overflow: hidden;
}
.card-section {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.card-section:last-child { border-bottom: none; }
.card-label {
    display: block; font-weight: 600; font-size: 13px;
    color: var(--clr-dark); margin-bottom: 8px;
}
.required-star { color: var(--clr-danger); }

/* Type selector buttons */
.type-selector {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.type-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: 2px solid var(--clr-border);
    border-radius: 6px; background: var(--clr-bg);
    cursor: pointer; font-size: 13px; font-weight: 500;
    color: var(--clr-text); transition: all .15s;
    font-family: var(--font-main);
}
.type-btn:hover {
    border-color: var(--clr-primary-dk);
    background: #fff;
}
.type-btn.active {
    border-color: var(--clr-primary);
    background: #fff8e1;
    color: var(--clr-dark);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--clr-primary);
}
.type-icon { font-size: 16px; line-height: 1; }
.type-name { line-height: 1; }

/* Submit inputs */
.submit-input,
.submit-textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--clr-border); border-radius: 4px;
    font-family: var(--font-main); font-size: 14px;
    transition: border-color .15s;
    background: #fff;
}
.submit-input:focus,
.submit-textarea:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 2px rgba(255,176,0,.2);
}
.submit-textarea { min-height: 160px; resize: vertical; }

/* Field meta row (hints + char count) */
.field-meta {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 6px; font-size: 12px;
}
.type-hint { color: var(--clr-meta); font-style: italic; }
.char-count { color: var(--clr-meta); white-space: nowrap; font-family: var(--font-mono); font-size: 11px; }
.char-count.near-limit { color: #e09e00; }
.char-count.at-limit { color: var(--clr-danger); font-weight: 600; }
.markdown-hint { color: var(--clr-meta); font-size: 11px; }

/* Submit actions */
.submit-actions {
    display: flex; align-items: center; gap: 12px;
    margin-top: 16px; padding-top: 4px;
}
.btn-submit {
    padding: 10px 28px; font-size: 14px;
}
.btn-cancel {
    color: var(--clr-meta) !important; font-size: 13px;
    text-decoration: none;
}
.btn-cancel:hover { color: var(--clr-text) !important; text-decoration: underline; }

/* Hide URL section when not link type */
.url-hidden { display: none !important; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.form-group .optional { font-weight: 400; color: var(--clr-meta); font-size: 12px; }

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%; padding: 8px 10px;
    border: 1px solid var(--clr-border); border-radius: 4px;
    font-family: var(--font-main); font-size: 14px;
    transition: border-color .15s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 2px rgba(255,176,0,.2);
}
.form-footer { margin-top: 16px; font-size: 13px; color: var(--clr-meta); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-block; padding: 8px 16px;
    background: var(--clr-primary); color: var(--clr-dark);
    border: none; border-radius: 4px;
    font-size: 13px; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: background .15s;
}
.btn:hover { background: var(--clr-primary-dk); text-decoration: none; color: var(--clr-dark); }
.btn:visited { color: var(--clr-dark); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: var(--clr-danger); color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-danger:visited { color: #fff; }
.btn-success { background: var(--clr-success); color: #fff; }
.btn-success:hover { background: #218838; }
.btn-success:visited { color: #fff; }

/* ── User profile ───────────────────────────────────────────── */
.profile-header {
    background: var(--clr-white); border-radius: 4px;
    border: 1px solid var(--clr-border); padding: 20px; margin-bottom: 24px;
}
.profile-header h1 { font-family: var(--font-mono); font-size: 24px; color: var(--clr-dark); margin-bottom: 8px; }
.profile-meta { font-size: 13px; color: var(--clr-meta); }
.profile-meta p { margin-bottom: 4px; }
.banned-badge { color: var(--clr-danger); font-weight: 600; }
.sandbox-badge { color: #856404; font-weight: 600; }
.user-profile h2 { font-size: 16px; margin-bottom: 12px; color: var(--clr-dark); }

/* ── Role Badges ────────────────────────────────────────────── */
.role-badge {
    display: inline-block; padding: 1px 6px; border-radius: 3px;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; vertical-align: middle; line-height: 1.4;
}
.role-super_admin, .role-super-admin { background: #1a1a2e; color: #e94560; }
.role-admin       { background: #0d47a1; color: #bbdefb; }
.role-moderator   { background: #1b5e20; color: #c8e6c9; }
.role-trusted     { background: #e65100; color: #ffe0b2; }
.role-user        { background: #f5f5f5; color: #757575; }
.role-suspended   { background: #b71c1c; color: #ffcdd2; }

.badge-config { font-size: 13px; margin-left: 4px; cursor: help; }

.role-select {
    font-size: 12px; padding: 2px 4px; border: 1px solid var(--clr-border);
    border-radius: 3px; background: var(--clr-white); font-family: var(--font-mono);
}

.inline-form { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; }
.inline-form-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.suggest-category-section {
    margin-top: 32px; padding: 20px;
    border: 1px solid var(--clr-border); border-radius: 4px;
    background: var(--clr-white);
}
.suggest-category-section h2 { font-size: 16px; margin: 0 0 8px; color: var(--clr-dark); }
.suggest-form { margin-top: 12px; }
.suggest-form .form-group { margin-bottom: 12px; }

.admin-actions-cell { white-space: nowrap; }

.text-muted { color: var(--clr-meta); }

.btn-primary {
    background: var(--clr-primary); color: var(--clr-white);
    border: 1px solid var(--clr-primary); cursor: pointer;
}
.btn-primary:hover { opacity: 0.85; }

/* ── Admin ──────────────────────────────────────────────────── */
.admin-page h1 { font-size: 22px; margin-bottom: 20px; color: var(--clr-dark); }
.admin-page h2 { font-size: 16px; margin: 24px 0 12px; color: var(--clr-dark); }
.admin-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-header-row h1 { margin-bottom: 0; }

/* ── Admin Settings ─────────────────────────────────────────── */
.settings-subtitle { font-size: 13px; color: var(--clr-meta); margin-bottom: 20px; }
.settings-tabs {
    display: flex; flex-wrap: wrap; gap: 0;
    border-bottom: 2px solid var(--clr-border);
    margin-bottom: 0;
}
.settings-tab {
    padding: 8px 16px; border: none; background: none;
    font-family: var(--font-main); font-size: 13px; font-weight: 600;
    color: var(--clr-meta); cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.settings-tab:hover { color: var(--clr-dark); }
.settings-tab.active {
    color: var(--clr-primary); border-bottom-color: var(--clr-primary);
}
.settings-panel {
    display: none;
    padding: 20px;
    border: 1px solid var(--clr-border); border-top: none;
    background: var(--clr-white);
}
.settings-panel.panel-scrollable {
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 70vh;
}
.settings-panel.panel-scrollable > h3 {
    padding: 16px 20px 0;
    font-size: 14px;
    margin: 0 0 4px;
    color: var(--clr-dark);
}
.settings-panel.panel-scrollable > .inline-form-row {
    padding: 8px 20px 12px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--clr-border);
}
.settings-panel.panel-scrollable > .field-hint {
    padding: 8px 20px 12px;
    margin: 0;
}
.settings-panel.active { display: block; }
.settings-sub-heading { font-size: 13px; font-weight: 600; margin: 16px 0 8px; color: var(--clr-dark); }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.input-short { max-width: 180px; }
.field-hint { display: block; font-size: 11px; color: var(--clr-meta); margin-top: 2px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.checkbox-label input[type="checkbox"] { margin: 0; }
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.provider-block {
    border: 1px solid #eee; border-radius: 4px;
    padding: 12px 16px; margin-bottom: 12px;
    background: #fafaf8;
}
.provider-header { margin-bottom: 8px; }
.provider-fields { display: flex; gap: 12px; }
.provider-fields .form-group { flex: 1; margin-bottom: 0; }
.settings-actions { margin-top: 24px; display: flex; align-items: center; gap: 16px; }
.settings-form select {
    padding: 8px 10px; border: 1px solid var(--clr-border); border-radius: 4px;
    font-family: var(--font-main); font-size: 14px; background: #fff;
}
.settings-form input[type="number"] {
    width: 100%; padding: 8px 10px;
    border: 1px solid var(--clr-border); border-radius: 4px;
    font-family: var(--font-main); font-size: 14px;
}
.settings-form input[type="number"]:focus,
.settings-form select:focus {
    outline: none; border-color: var(--clr-primary);
    box-shadow: 0 0 0 2px rgba(255,176,0,.2);
}

.admin-stats { display: flex; gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--clr-white); border: 1px solid var(--clr-border);
    border-radius: 4px; padding: 16px 24px; text-align: center;
}
.stat-number { display: block; font-size: 28px; font-weight: 700; color: var(--clr-primary); font-family: var(--font-mono); }
.stat-label  { font-size: 12px; color: var(--clr-meta); text-transform: uppercase; }

.admin-table {
    width: 100%; border-collapse: collapse;
    background: var(--clr-white);
    font-size: 13px;
}
.admin-table th,
.admin-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid #f0f0f0; }
.admin-table th {
    background: #f8f8f5; font-weight: 600;
    font-size: 12px; text-transform: uppercase; color: var(--clr-meta);
    position: sticky; top: 0; z-index: 1;
}

.text-danger  { color: var(--clr-danger); }
.text-success { color: var(--clr-success); }

/* ── Meta-moderation (flag) ─────────────────────────────────── */
.flagged-row { background: #fff8f0; }
.flag-cell { white-space: nowrap; }
.flag-count { color: #e67e22; font-weight: 600; font-size: 13px; }
.flag-form { display: inline; }
.flag-btn {
    background: none; border: none; cursor: pointer;
    font-size: 14px; padding: 2px 4px; opacity: 0.5;
    transition: opacity 0.15s;
}
.flag-btn:hover { opacity: 1; }
.flag-done { color: var(--clr-meta); font-size: 13px; }
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
.flash-error { background: #fce4e4; border: 1px solid #f5aca6; color: #8a1f11; }
.flash-success { background: #e4f5e4; border: 1px solid #a6d7a6; color: #1f6611; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { margin-top: 16px; display: flex; justify-content: center; gap: 12px; }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state { padding: 32px; text-align: center; color: var(--clr-meta); font-size: 14px; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--clr-border);
    padding: 16px 0; background: var(--clr-white);
}
.footer-content { text-align: center; font-size: 12px; color: var(--clr-meta); }
.footer-links { margin-top: 4px; }
.footer-links .sep { margin: 0 4px; }

/* ── Tag Muting Grid (User Settings) ────────────────────────── */
.tag-mute-grid {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.tag-mute-option {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; border: 1px solid var(--clr-border);
    border-radius: 4px; cursor: pointer; font-size: 13px;
    background: var(--clr-white); transition: background 0.15s, border-color 0.15s;
}
.tag-mute-option:hover { border-color: var(--clr-primary); }
.tag-mute-option input[type="checkbox"]:checked + .tag-badge {
    text-decoration: line-through; opacity: 0.6;
}
.tag-mute-option .tag-desc {
    font-size: 11px; color: var(--clr-meta); margin-left: 2px;
}

/* ── Content List Pages (My Posts / Comments / Threads) ─────── */
.content-list-page { padding-bottom: 24px; }
.content-list-header { margin-bottom: 16px; }
.content-list-header h1 { font-size: 20px; margin-bottom: 8px; }
.content-list-nav {
    display: flex; gap: 0; border-bottom: 2px solid var(--clr-border); margin-bottom: 16px;
}
.content-tab {
    padding: 8px 16px; font-size: 13px; font-weight: 500;
    color: var(--clr-meta); text-decoration: none;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.content-tab:hover { color: var(--clr-text); }
.content-tab:visited { color: var(--clr-meta); }
.content-tab.active {
    color: var(--clr-dark); border-bottom-color: var(--clr-primary); font-weight: 600;
}
.content-tab.active:visited { color: var(--clr-dark); }

/* ── My Threads ─────────────────────────────────────────────── */
.thread-item-wrapper {
    position: relative;
    border-bottom: 1px solid var(--clr-border);
}
.thread-item-wrapper .post-item { border-bottom: none; }
.thread-item-wrapper.thread-new {
    background: rgba(255, 243, 176, 0.35);
}
.thread-activity-time {
    position: absolute; top: 6px; right: 12px;
    font-size: 11px; color: var(--clr-meta); font-style: italic;
    white-space: nowrap;
}
.thread-item-wrapper.thread-new .thread-activity-time {
    color: #8a7520; font-weight: 500;
}

/* ── My Comments List ───────────────────────────────────────── */
.my-comments-list { display: flex; flex-direction: column; gap: 12px; }
.my-comment-item {
    padding: 12px 14px; border: 1px solid var(--clr-border);
    border-radius: 4px; background: var(--clr-white);
}
.my-comment-meta {
    font-size: 12px; color: var(--clr-meta); margin-bottom: 8px;
}
.my-comment-meta a { color: var(--clr-accent); }
.my-comment-meta .sep { margin: 0 4px; }
.my-comment-text { font-size: 13px; line-height: 1.5; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .header-nav { flex-wrap: wrap; height: auto; padding: 8px 0; }
    .header-left { flex-wrap: wrap; }
    .nav-links { gap: 8px; }
    .post-rank { display: none; }
    .admin-stats { flex-direction: column; }
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 6px 8px; }
    .form-row { flex-direction: column; gap: 0; }
    .provider-fields { flex-direction: column; gap: 0; }
    .admin-header-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .settings-tabs { gap: 0; }
    .settings-tab { padding: 6px 10px; font-size: 12px; }
}

/* ── Markdown Content Styles ────────────────────────────────── */
.markdown-body h1 { font-size: 1.6em; margin: 0.9em 0 0.5em; color: var(--clr-dark); font-weight: 700; }
.markdown-body h2 { font-size: 1.3em; margin: 0.8em 0 0.4em; color: var(--clr-dark); font-weight: 700; }
.markdown-body h3 { font-size: 1.15em; margin: 0.7em 0 0.3em; color: var(--clr-dark); font-weight: 600; }
.markdown-body h4 { font-size: 1.05em; margin: 0.6em 0 0.3em; color: var(--clr-dark); font-weight: 600; }
.markdown-body h5, .markdown-body h6 { font-size: 1em; margin: 0.5em 0 0.2em; color: var(--clr-meta); font-weight: 600; }

.markdown-body p { margin: 0.5em 0; }

.markdown-body strong { font-weight: 700; }
.markdown-body em { font-style: italic; }
.markdown-body del { text-decoration: line-through; color: var(--clr-meta); }

.markdown-body a { color: var(--clr-accent); }
.markdown-body a:hover { text-decoration: underline; }

.markdown-body code {
    font-family: var(--font-mono);
    background: #f0ede6;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.9em;
}

.markdown-body pre {
    background: var(--clr-dark);
    color: var(--clr-primary);
    padding: 12px 16px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0.8em 0;
    font-family: var(--font-mono);
    font-size: 0.85em;
    line-height: 1.6;
}

.markdown-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.markdown-body blockquote {
    border-left: 3px solid var(--clr-primary);
    margin: 0.6em 0;
    padding: 4px 12px;
    color: var(--clr-meta);
    background: rgba(255, 176, 0, 0.05);
}

.markdown-body ul, .markdown-body ol {
    margin: 0.5em 0;
    padding-left: 1.8em;
}

.markdown-body li { margin: 0.2em 0; }

.markdown-body hr {
    border: none;
    border-top: 1px solid var(--clr-border);
    margin: 1em 0;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.5em 0;
}

.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.8em 0;
    font-size: 0.9em;
}
.markdown-body th, .markdown-body td {
    border: 1px solid var(--clr-border);
    padding: 6px 10px;
    text-align: left;
}
.markdown-body th {
    background: var(--clr-dark);
    color: var(--clr-primary);
    font-weight: 600;
}
.markdown-body tr:nth-child(even) { background: rgba(0,0,0,0.02); }

.markdown-body input[type="checkbox"] {
    margin-right: 6px;
    pointer-events: none;
}

.markdown-hint {
    font-size: 11px;
    color: var(--clr-meta);
    margin: 4px 0 0;
}

/* ── EasyMDE theme overrides ────────────────────────────────── */
.EasyMDEContainer .CodeMirror {
    font-family: var(--font-mono);
    font-size: 13px;
    border-color: var(--clr-border);
}
.EasyMDEContainer .editor-toolbar {
    border-color: var(--clr-border);
}
.EasyMDEContainer .editor-toolbar button.active,
.EasyMDEContainer .editor-toolbar button:hover {
    background: var(--clr-primary);
    color: var(--clr-dark);
    border-color: var(--clr-primary-dk);
}
.EasyMDEContainer .editor-preview {
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.6;
    color: var(--clr-text);
    padding: 12px 16px;
}
.EasyMDEContainer .editor-preview h1 { font-size: 1.6em; margin: 0.9em 0 0.5em; color: var(--clr-dark); font-weight: 700; }
.EasyMDEContainer .editor-preview h2 { font-size: 1.3em; margin: 0.8em 0 0.4em; color: var(--clr-dark); font-weight: 700; }
.EasyMDEContainer .editor-preview h3 { font-size: 1.15em; margin: 0.7em 0 0.3em; color: var(--clr-dark); font-weight: 600; }
.EasyMDEContainer .editor-preview p { margin: 0.5em 0; }
.EasyMDEContainer .editor-preview code {
    font-family: var(--font-mono);
    background: #f0ede6;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.9em;
}
.EasyMDEContainer .editor-preview pre {
    background: var(--clr-dark);
    color: var(--clr-primary);
    padding: 12px 16px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85em;
}
.EasyMDEContainer .editor-preview blockquote {
    border-left: 3px solid var(--clr-primary);
    margin: 0.6em 0;
    padding: 4px 12px;
    color: var(--clr-meta);
}
.EasyMDEContainer .editor-preview a { color: var(--clr-accent); }
.EasyMDEContainer .editor-preview strong { font-weight: 700; }

/* ── Universal Menu System (NRMenu) ─────────────────────────── */
.nr-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.nr-menu-trigger {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    font-family: var(--font-main);
    font-size: 13px;
    padding: 4px 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    white-space: nowrap;
    transition: color 0.15s;
}
.nr-menu-trigger:hover { color: var(--clr-primary); }
.nr-menu-caret { font-size: 10px; opacity: 0.6; }
.nr-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--clr-dark);
    border: 1px solid #444;
    border-radius: 4px;
    min-width: 180px;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    padding: 4px 0;
    margin-top: 6px;
}
.nr-menu-dropdown.open { display: block; }
.nr-menu-dropdown.nr-menu-align-left { right: auto; left: 0; }
.nr-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 7px 14px;
    background: none;
    border: none;
    color: #e0e0e0;
    font-family: var(--font-main);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    gap: 8px;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
}
.nr-menu-item:hover,
.nr-menu-item:focus {
    background: var(--clr-primary);
    color: var(--clr-dark);
    text-decoration: none;
}
.nr-menu-item:visited { color: #e0e0e0; }
.nr-menu-item:visited:hover { color: var(--clr-dark); }
.nr-menu-item-icon {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    font-size: 14px;
}
.nr-menu-item-text { flex: 1; text-align: left; }
.nr-menu-item-shortcut {
    color: #888;
    font-size: 11px;
    margin-left: auto;
    font-family: var(--font-mono);
}
.nr-menu-item:hover .nr-menu-item-shortcut { color: var(--clr-dark); opacity: 0.7; }
.nr-menu-item-submenu::after {
    content: '\203A';
    margin-left: auto;
    font-size: 16px;
    color: #888;
    line-height: 1;
}
.nr-menu-item-submenu:hover::after { color: var(--clr-dark); }
.nr-menu-separator { height: 1px; background: #444; margin: 4px 0; }
.nr-menu-item.active { color: var(--clr-primary); font-weight: 600; }
.nr-menu-item.active:hover { color: var(--clr-dark); }

/* ── User Avatar (Header) ──────────────────────────────────── */
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--clr-primary);
    color: var(--clr-dark);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    flex-shrink: 0;
    overflow: hidden;
}
.user-avatar-img {
    border-radius: 50%;
    object-fit: cover;
}
.user-avatar-preset {
    font-size: 16px;
}
.user-trigger .role-badge { font-size: 9px; padding: 0 4px; }
.user-trigger .user-karma { color: var(--clr-primary); font-size: 11px; font-family: var(--font-mono); }

/* ── Avatar Settings ───────────────────────────────────────── */
.avatar-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}
.avatar-type-options .radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.avatar-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 12px 0;
}
.avatar-preset-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: border-color 0.15s;
}
.avatar-preset-option:hover {
    border-color: var(--clr-primary);
}
.avatar-preset-option input[type="radio"] {
    display: none;
}
.avatar-preset-option input[type="radio"]:checked + .avatar-preset-icon {
    box-shadow: 0 0 0 3px var(--clr-primary);
}
.avatar-preset-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 24px;
}
.avatar-preset-label {
    font-size: 11px;
    color: var(--clr-muted);
}

/* ── Follow Button ─────────────────────────────────────────── */
.follow-btn {
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s, color 0.15s;
}
.follow-btn.following {
    background: var(--clr-primary);
    color: var(--clr-dark);
}
.follow-btn.following:hover {
    background: #c55;
}
.follow-btn .follow-count {
    font-size: 11px;
    opacity: 0.8;
    margin-left: 2px;
}
.follow-actions {
    display: inline-flex;
    gap: 8px;
}

/* ── Social: Friend / Block / Report ───────────────────────── */
.social-btn {
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    border: 1px solid var(--clr-border);
    background: transparent;
    color: var(--clr-text);
    border-radius: 3px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.social-btn:hover {
    border-color: var(--clr-primary);
    color: var(--clr-primary);
}
.social-btn.is-friend {
    border-color: var(--clr-primary);
    color: var(--clr-primary);
}
.social-btn.is-blocked,
.social-btn.block-btn:hover {
    border-color: #c44;
    color: #c44;
}
.social-btn.report-btn:hover {
    border-color: #c84;
    color: #c84;
}
.social-btn.pending {
    opacity: 0.6;
    cursor: default;
}

/* Report modal overlay */
.report-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.report-modal-content {
    background: var(--clr-bg);
    border: 1px solid var(--clr-border);
    padding: 20px;
    border-radius: 4px;
    width: 90%;
    max-width: 400px;
}
.report-modal-content h3 {
    margin-top: 0;
    color: var(--clr-primary);
}

/* Social list (settings friends/blocked) */
.social-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.social-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border: 1px solid var(--clr-border);
    border-radius: 3px;
}
.social-list-item .social-list-name {
    color: var(--clr-primary);
    text-decoration: none;
}
.social-list-item .social-list-name:hover {
    text-decoration: underline;
}
.social-list-actions {
    display: flex;
    gap: 6px;
}

/* ── Locale Menu (NRMenu variant) ──────────────────────────── */
.locale-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 4px;
}
.nr-menu-item .locale-flag {
    width: 22px;
    height: 16px;
    margin-right: 6px;
}
.locale-trigger-code {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--clr-primary);
}
.nr-menu-locale .nr-menu-dropdown { min-width: 150px; }
.locale-form { display: block; margin: 0; padding: 0; }
.locale-form .nr-menu-item { border: none; }
.locale-form .nr-menu-item.active { color: var(--clr-primary); font-weight: bold; }
.locale-form .nr-menu-item.active:hover { color: var(--clr-dark); }

/* ── Translation Toggle ────────────────────────────────────── */
.translate-link {
    font-size: 11px;
    color: var(--clr-meta);
    cursor: pointer;
    text-decoration: none;
    margin-left: 8px;
}
.translate-link:hover {
    color: var(--clr-primary);
}
.translate-link.translating {
    opacity: 0.6;
    pointer-events: none;
}
.translate-locale-picker {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.translate-locale-btn {
    background: var(--clr-dark);
    color: #e0e0e0;
    border: 1px solid var(--clr-border);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 6px;
    cursor: pointer;
}
.translate-locale-btn:hover {
    background: var(--clr-primary);
    color: var(--clr-dark);
}
.translated-content {
    border-left: 2px solid var(--clr-primary);
    padding-left: 8px;
    margin-top: 6px;
}
.translation-meta {
    font-size: 10px;
    color: var(--clr-meta);
    font-style: italic;
    margin-top: 4px;
}

/* ── Tags & Categories ──────────────────────────────────── */
.tag-badge,
.category-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    text-decoration: none;
    margin-right: 3px;
    vertical-align: middle;
}
.tag-badge {
    background: rgba(255,176,0,0.15);
    color: var(--clr-amber);
    border: 1px solid rgba(255,176,0,0.3);
}
.tag-badge:hover {
    background: rgba(255,176,0,0.3);
}
.category-badge {
    background: rgba(0,200,150,0.12);
    color: #5fdfb0;
    border: 1px solid rgba(0,200,150,0.25);
}
.category-badge:hover {
    background: rgba(0,200,150,0.25);
}
.post-tags {
    margin-left: 6px;
}
.post-taxonomy {
    margin-top: 4px;
}
.hashtag {
    color: var(--clr-amber);
    text-decoration: none;
    font-weight: 600;
}
.hashtag:hover {
    text-decoration: underline;
}

/* Submit form: tag/category selectors */
.tag-selector,
.category-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag-option,
.category-option {
    cursor: pointer;
    user-select: none;
}
.tag-option input[type="checkbox"],
.category-option input[type="checkbox"] {
    display: none;
}
.tag-option input:checked + .tag-badge {
    background: rgba(255,176,0,0.4);
    border-color: var(--clr-amber);
}
.category-option input:checked + .category-badge {
    background: rgba(0,200,150,0.35);
    border-color: #5fdfb0;
}
.category-group {
    margin-bottom: 4px;
}
.category-children {
    margin-left: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 3px;
}
.category-child .category-badge {
    font-size: 9px;
}
.field-hint {
    font-size: 11px;
    color: var(--clr-meta);
    margin: 2px 0 6px 0;
}

/* Tag index grid */
.tag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.tag-card {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--clr-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--clr-fg);
    transition: border-color 0.2s;
}
.tag-card:hover {
    border-color: var(--clr-amber);
}
.tag-card-name {
    display: block;
    font-weight: 600;
    color: var(--clr-amber);
    margin-bottom: 4px;
}
.tag-card-desc {
    display: block;
    font-size: 11px;
    color: var(--clr-meta);
    margin-bottom: 4px;
}
.tag-card-count {
    font-size: 10px;
    color: var(--clr-meta);
}

/* Category tree page */
.category-tree-page {
    margin-top: 12px;
}
.category-tree-group {
    margin-bottom: 12px;
    padding: 8px 10px;
    border-left: 3px solid rgba(0,200,150,0.4);
}
.category-tree-root {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 600;
    color: #5fdfb0;
}
.category-tree-root:hover {
    text-decoration: underline;
}
.category-tree-count {
    font-size: 10px;
    color: var(--clr-meta);
}
.category-tree-desc {
    font-size: 11px;
    color: var(--clr-meta);
    margin: 2px 0 0 0;
}
.category-tree-children {
    margin-top: 6px;
    margin-left: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.category-tree-child {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--clr-fg);
    font-size: 12px;
    padding: 2px 8px;
    border: 1px solid var(--clr-border);
    border-radius: 3px;
}
.category-tree-child:hover {
    border-color: #5fdfb0;
    color: #5fdfb0;
}
.page-subtitle {
    font-size: 12px;
    color: var(--clr-meta);
    margin-top: 2px;
}

/* ── Notification Bell (NRMenu variant) ─────────────────────── */
.nr-menu-notif .nr-menu-trigger {
    font-size: 16px;
    padding: 2px 4px;
    position: relative;
    filter: grayscale(1) brightness(1.5);
}
.nr-menu-notif .nr-menu-trigger:hover { filter: none; color: #ccc; }
.notif-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--clr-danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    line-height: 15px;
    text-align: center;
    border-radius: 8px;
    padding: 0 3px;
    font-family: var(--font-main);
}
.nr-menu-notif .nr-menu-dropdown {
    width: 320px;
    max-height: 400px;
    min-width: 320px;
    background: var(--clr-white);
    border-color: var(--clr-border);
    overflow: hidden;
}
.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--clr-border);
    font-size: 13px;
}
.notif-dropdown-header strong { color: var(--clr-dark); }
.notif-view-all { font-size: 11px; }
.notif-dropdown-list {
    overflow-y: auto;
    max-height: 340px;
}
.notif-loading {
    padding: 12px;
    text-align: center;
    color: var(--clr-meta);
    font-size: 12px;
}
.notif-dropdown-item {
    display: block;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: var(--clr-text);
    font-size: 12px;
    transition: background 0.15s;
}
.notif-dropdown-item:hover {
    background: #f5f5f0;
    text-decoration: none;
}
.notif-dropdown-item:visited {
    color: var(--clr-text);
}
.notif-dropdown-item.unread {
    background: #fffde7;
    border-left: 3px solid var(--clr-primary);
}
.notif-dropdown-item .notif-dd-type {
    font-size: 11px;
    margin-right: 4px;
}
.notif-dropdown-item .notif-dd-msg {
    display: block;
    line-height: 1.4;
}
.notif-dropdown-item .notif-dd-time {
    display: block;
    font-size: 10px;
    color: var(--clr-meta);
    margin-top: 2px;
}
.notif-dropdown-empty {
    padding: 20px 12px;
    text-align: center;
    color: var(--clr-meta);
    font-size: 12px;
}

/* ── Notifications Page ─────────────────────────────────────── */
.notifications-page {
    max-width: 700px;
}
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.notifications-header h1 {
    font-size: 20px;
}
.notif-mark-all-form {
    display: inline;
}
.notif-type-section {
    margin-bottom: 20px;
}
.notif-type-heading {
    font-size: 14px;
    color: var(--clr-meta);
    border-bottom: 1px solid var(--clr-border);
    padding-bottom: 6px;
    margin-bottom: 8px;
}
.notif-type-icon {
    margin-right: 4px;
}
.notif-type-count {
    font-weight: 400;
    font-size: 12px;
}
.notif-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.notif-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 10px;
    border-radius: 3px;
    text-decoration: none;
    color: var(--clr-text);
    font-size: 13px;
    transition: background 0.15s;
}
.notif-item:hover {
    background: #f5f5f0;
    text-decoration: none;
}
.notif-item:visited {
    color: var(--clr-text);
}
.notif-unread {
    background: #fffde7;
    border-left: 3px solid var(--clr-primary);
}
.notif-read {
    opacity: 0.7;
}
.notif-item-message {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notif-item-time {
    font-size: 11px;
    color: var(--clr-meta);
    white-space: nowrap;
    margin-left: 12px;
}

/* ── Enhanced User Profile ──────────────────────────────────── */
.profile-bio {
    font-size: 13px;
    color: var(--clr-text);
    margin: 8px 0;
    line-height: 1.5;
    max-width: 600px;
}
.profile-links {
    display: flex;
    gap: 12px;
    margin: 8px 0;
}
.profile-link {
    font-size: 12px;
    color: var(--clr-accent);
    text-decoration: none;
}
.profile-link:hover {
    text-decoration: underline;
}
.profile-stats {
    display: flex;
    gap: 16px;
    margin: 8px 0 12px;
}
.profile-stat {
    font-size: 12px;
    color: var(--clr-meta);
    font-weight: 600;
}
.btn-small {
    font-size: 11px;
    padding: 4px 10px;
    background: var(--clr-primary);
    color: var(--clr-dark);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}
.btn-small:hover {
    background: var(--clr-primary-dk);
    text-decoration: none;
}
.btn-small:visited {
    color: var(--clr-dark);
}

/* ── Site Pages (About / Rules) ─────────────────────────── */
.site-page {
    max-width: 760px; margin: 0 auto; padding: 20px 0;
}
.site-page-title {
    font-size: 24px; margin-bottom: 16px;
    border-bottom: 2px solid var(--clr-border); padding-bottom: 8px;
}
.site-page-content { line-height: 1.7; }
.site-page-meta {
    margin-top: 20px; font-size: 12px; color: var(--clr-meta);
    border-top: 1px solid var(--clr-border); padding-top: 8px;
}

/* ── FAQ Page ───────────────────────────────────────────── */
.faq-page {
    max-width: 760px; margin: 0 auto; padding: 20px 0;
}
.faq-page-title {
    font-size: 24px; margin-bottom: 20px;
    border-bottom: 2px solid var(--clr-border); padding-bottom: 8px;
}
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
    border: 1px solid var(--clr-border); border-radius: 4px;
    overflow: hidden;
}
.faq-item[open] { border-color: var(--clr-primary); }
.faq-question {
    cursor: pointer; padding: 12px 16px;
    font-weight: 600; font-size: 15px;
    background: var(--clr-bg, #fafafa);
    list-style: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::before {
    content: '▸ '; color: var(--clr-primary); margin-right: 4px;
    transition: transform .15s;
}
.faq-item[open] > .faq-question::before { content: '▾ '; }
.faq-question:hover { background: var(--clr-bg-hover, #f0f0f0); }
.faq-answer {
    padding: 12px 16px; border-top: 1px solid var(--clr-border);
    line-height: 1.7;
}

/* ── Admin: FAQ form section ────────────────────────────── */
.faq-form-section {
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--clr-border);
}
.faq-form-section h4 { margin-bottom: 12px; }
.admin-tab-hint {
    font-size: 13px; color: var(--clr-meta); margin-bottom: 12px;
}
