/* Trail Forum — Frontend Styles */

:root {
    --tf-primary:     #2d6a2e;
    --tf-primary-dk:  #1b4d1c;
    --tf-accent:      #5a9e3a;
    --tf-border:      #dde3d8;
    --tf-bg:          #f8faf7;
    --tf-bg-alt:      #eef3ec;
    --tf-text:        #2c2c2c;
    --tf-text-light:  #6b7c6a;
    --tf-radius:      6px;
    --tf-shadow:      0 1px 3px rgba(0,0,0,.08);
    --tf-danger:      #c0392b;
}

.tf-forum * { box-sizing: border-box; }

.tf-forum {
    max-width: 900px;
    margin: 0 auto;
    font-family: inherit;
    color: var(--tf-text);
    line-height: 1.6;
    background: #f7f9f7;
    border-radius: var(--tf-radius);
    padding: 20px 24px 28px;
}

/* Flash messages */
.tf-flash {
    padding: 10px 16px;
    border-radius: var(--tf-radius);
    margin-bottom: 16px;
    font-weight: 500;
}
.tf-flash-success { background: #e7f4e4; border-left: 4px solid var(--tf-primary); color: #1b4d1c; }
.tf-flash-error   { background: #fde8e8; border-left: 4px solid var(--tf-danger); color: #7b1f1f; }

/* Breadcrumb */
.tf-breadcrumb {
    font-size: .875rem;
    color: var(--tf-text-light);
    margin-bottom: 16px;
}
.tf-breadcrumb a { color: var(--tf-primary); text-decoration: none; }
.tf-breadcrumb a:hover { text-decoration: underline; }

/* Buttons */
.tf-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: var(--tf-radius);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s;
    line-height: 1.4;
}
.tf-btn-primary {
    background: var(--tf-primary);
    color: #fff;
    border-color: var(--tf-primary);
}
.tf-btn-primary:hover { background: var(--tf-primary-dk); border-color: var(--tf-primary-dk); color: #fff; }
.tf-btn-outline {
    background: transparent;
    color: var(--tf-primary);
    border-color: var(--tf-primary);
}
.tf-btn-outline:hover { background: var(--tf-primary); color: #fff; border-color: var(--tf-primary); }
.tf-btn-sm { padding: 4px 10px; font-size: .8rem; }
.tf-btn-danger { background: transparent; color: var(--tf-danger); border-color: var(--tf-danger); }
.tf-btn-danger:hover { background: var(--tf-danger); color: #fff; border-color: var(--tf-danger); }

/* Badges */
.tf-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: .75rem;
    font-weight: 600;
}
.tf-badge-sticky { background: #fff3cd; color: #856404; }
.tf-badge-locked { background: #f8d7da; color: #842029; }
.tf-badge-hidden { background: #e2e3e5; color: #495057; }

/* Tags */
.tf-tag {
    display: inline-block;
    background: var(--tf-bg-alt);
    color: var(--tf-primary);
    border: 1px solid var(--tf-border);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: .75rem;
    margin: 2px 2px 0 0;
}

/* ===== INDEX ===== */
.tf-forum-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--tf-primary);
}
.tf-forum-title {
    margin: 0;
    padding-bottom: 0;
    border-bottom: none;
    font-size: 1.4rem;
    color: var(--tf-primary-dk);
    letter-spacing: -.01em;
    flex: 1;
}
.tf-rss-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: #f26522;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
    transition: background .15s;
}
.tf-rss-btn:hover { background: #d4551a; color: #fff; }
.tf-rss-btn svg  { fill: currentColor; }

.tf-section-label {
    margin: 0 0 8px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tf-text-light);
}
.tf-categories { display: flex; flex-direction: column; gap: 6px; }

.tf-category-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid var(--tf-border);
    border-left: 4px solid var(--tf-primary);
    border-radius: var(--tf-radius);
    padding: 10px 16px;
    box-shadow: var(--tf-shadow);
    transition: box-shadow .15s, border-left-color .15s;
    position: relative;
}
.tf-category-card:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,.12);
    border-left-color: var(--tf-accent);
}
/* Stretched link — covers the whole card, sits below the last-post link */
.tf-category-card h3 a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
}
/* Last-post link must sit above the stretched link */
.tf-category-card .tf-last-post-title { position: relative; z-index: 1; }
.tf-category-card h3 { margin: 0 0 2px; font-size: 1rem; }
.tf-category-card h3 a { color: var(--tf-primary); text-decoration: none; }
.tf-category-card h3 a:hover { text-decoration: underline; }
.tf-category-desc { margin: 0; color: #555; font-size: .9rem; }
.tf-category-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; min-width: 160px; }
.tf-topic-count {
    background: var(--tf-primary);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: .78rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.tf-category-last-post { text-align: right; }
.tf-last-post-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tf-text-light); margin-bottom: 2px; }
.tf-last-post-title {
    display: block;
    font-size: .82rem;
    font-weight: 500;
    color: var(--tf-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.tf-last-post-title:hover { text-decoration: underline; }
.tf-last-post-meta { display: block; font-size: .75rem; color: var(--tf-text-light); }

/* ===== CATEGORY VIEW ===== */
.tf-category-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tf-category-header h2 { margin: 0; }

.tf-topics-list {
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    overflow: hidden;
    background: #fff;
}
.tf-topics-header, .tf-topic-row {
    display: grid;
    grid-template-columns: 1fr 140px 70px 60px 100px;
    gap: 12px;
    padding: 10px 16px;
    align-items: center;
}
.tf-topics-header {
    background: var(--tf-bg-alt);
    font-weight: 600;
    font-size: .85rem;
    color: var(--tf-text-light);
    border-bottom: 1px solid var(--tf-border);
}
.tf-topic-row {
    border-bottom: 1px solid var(--tf-border);
    transition: background .1s;
}
.tf-topic-row:last-child { border-bottom: none; }
.tf-topic-row:hover { background: var(--tf-bg); }
.tf-topic-row.tf-sticky { background: #fffbef; }
.tf-topic-row.tf-sticky:hover { background: #fffae0; }

.tf-topic-title { color: var(--tf-primary); text-decoration: none; font-weight: 500; }
.tf-topic-title:hover { text-decoration: underline; }
.tf-topic-tags { margin-top: 4px; }

/* Unread topics — bold title */
.tf-unread .tf-topic-title { font-weight: 700; }

.tf-col-author, .tf-col-replies, .tf-col-views, .tf-col-last {
    font-size: .85rem;
    color: var(--tf-text-light);
}

/* ===== TOPIC VIEW ===== */
.tf-topic-header {
    background: #fff;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.tf-topic-header h2 { margin: 0 0 4px; }
.tf-topic-meta { color: var(--tf-text-light); font-size: .875rem; margin-bottom: 0; }
.tf-topic-header-controls {
    display: flex;
    align-items: center;
    margin-top: 8px;
    gap: 8px;
}
.tf-topic-admin-controls {
    margin-left: auto;
    display: flex;
    gap: 6px;
    align-items: center;
}

.tf-btn-subscribe {
    background: var(--tf-bg-alt);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 5px 12px;
    font-size: .85rem;
    cursor: pointer;
    color: var(--tf-text);
    transition: all .15s;
}
.tf-btn-subscribe.subscribed { background: var(--tf-primary); color: #fff; border-color: var(--tf-primary); }

/* Posts */
.tf-posts { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }

.tf-post {
    background: #fff;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    box-shadow: var(--tf-shadow);
    overflow: hidden;
}
.tf-post-hidden { opacity: .6; border-style: dashed; }

.tf-post-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--tf-bg);
    border-bottom: 1px solid var(--tf-border);
}
.tf-avatar {
    width: 46px; height: 46px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1;
    user-select: none;
}
.tf-post-meta { flex: 1; }
.tf-post-author {
    font-weight: 600;
    font-size: .9rem;
    cursor: default;
    position: relative;
}
.tf-user-card {
    position: absolute;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.14);
    padding: 14px;
    z-index: 9998;
    min-width: 220px;
    max-width: 280px;
    pointer-events: auto;
}
.tf-user-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tf-user-card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.3);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1;
    user-select: none;
}
.tf-user-card-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.tf-user-card-name {
    font-size: .93rem;
    font-weight: 600;
    color: var(--tf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tf-user-card-posts,
.tf-user-card-joined {
    font-size: .78rem;
    color: var(--tf-text-light);
}
.tf-post-date {
    display: block;
    font-size: .8rem;
    color: var(--tf-text-light);
}
.tf-post-edited {
    font-size: .75rem;
    color: var(--tf-text-light);
    font-style: italic;
    margin-left: 6px;
}
.tf-post-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}
.tf-action-btn {
    background: none;
    border: 1px solid currentColor;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--tf-text-light);
    opacity: 1;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}
.tf-action-btn:hover { background: var(--tf-border); color: var(--tf-text); }
.tf-action-label { font-size: .7rem; }
.tf-reply-btn { color: var(--tf-primary) !important; border-color: var(--tf-primary) !important; }
.tf-reply-btn:hover { background: var(--tf-primary) !important; color: #fff !important; }
.tf-hide-btn { color: #888 !important; border-color: #888 !important; }
.tf-hide-btn:hover { background: #888 !important; color: #fff !important; }
.tf-delete-btn { color: var(--tf-danger) !important; border-color: var(--tf-danger) !important; }
.tf-delete-btn:hover { background: var(--tf-danger) !important; color: #fff !important; }

.tf-post-body { padding: 16px; }
.tf-post-content { line-height: 1.7; }
.tf-post-content p { margin-top: 0; }
.tf-oembed { margin: 12px 0; position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.tf-oembed iframe, .tf-oembed object, .tf-oembed embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.tf-post-content blockquote {
    margin: 12px 0;
    padding: 10px 14px;
    background: var(--tf-bg-alt);
    border-left: 4px solid var(--tf-primary);
    border-radius: 0 4px 4px 0;
    font-style: italic;
    color: var(--tf-text-light);
}
/* Image figures with captions */
.tf-post-content figure.tf-img-figure {
    display: inline-block;
    margin: 4px 12px 8px 0;
    max-width: 100%;
    vertical-align: top;
    border: 1px solid var(--tf-border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--tf-surface);
}
.tf-post-content figure.tf-img-figure img {
    display: block;
    max-width: 100%;
    height: auto;
}
.tf-post-content figure.tf-img-figure figcaption {
    font-size: 0.82em;
    color: var(--tf-text-light);
    font-style: italic;
    text-align: center;
    padding: 5px 8px;
    border-top: 1px solid var(--tf-border);
    background: var(--tf-bg);
}
/* Legacy caption format: <br><em> after an image */
.tf-post-content img + br + em,
.tf-post-content img + em {
    display: block;
    font-size: 0.82em;
    color: var(--tf-text-light);
    margin-top: 3px;
    margin-bottom: 6px;
}

.tf-post-content blockquote img {
    max-width: 140px !important;
    max-height: 100px !important;
    width: auto !important;
    height: auto !important;
    vertical-align: middle;
    border-radius: 3px;
    margin: 0 4px 4px 0;
    font-style: normal;
}

/* Attachments */
.tf-post-attachments { margin-top: 14px; border-top: 1px solid var(--tf-border); padding-top: 14px; }
.tf-attachment { margin-bottom: 10px; }
.tf-attachment-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--tf-radius);
    display: block;
}
.tf-attachment-file a {
    color: var(--tf-primary);
    text-decoration: none;
    font-size: .9rem;
}
.tf-attachment-file a:hover { text-decoration: underline; }
.tf-file-size { color: var(--tf-text-light); }
.tf-gpx-map {
    height: 480px;
    width: 100%;
    border-radius: var(--tf-radius);
    border: 1px solid var(--tf-border);
    z-index: 0;
}
.tf-gpx-label { margin: 6px 0 0; font-size: .85rem; }
.tf-gpx-label a { color: var(--tf-primary); text-decoration: none; }

/* Compact map link shown inside blockquotes (replaces the full interactive map) */
.tf-map-quote-link {
    display: inline-block;
    font-size: .85em;
    color: var(--tf-primary);
    text-decoration: none;
}
.tf-map-quote-link::before {
    content: '🗺\00a0';  /* non-breaking space after emoji */
    font-size: 1em;      /* inherits .85em — stays small and consistent */
    font-style: normal;
}
.tf-map-quote-link:hover { text-decoration: underline; }

/* Reactions */
.tf-post-footer { padding: 8px 16px 10px; background: var(--tf-bg); border-top: 1px solid var(--tf-border); }
.tf-reactions { display: flex; flex-wrap: wrap; gap: 6px; }
.tf-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid var(--tf-border);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all .15s;
}
.tf-reaction-btn:hover { border-color: var(--tf-accent); background: var(--tf-bg-alt); }
.tf-reaction-btn.tf-reaction-active {
    background: var(--tf-bg-alt);
    border-color: var(--tf-primary);
    color: var(--tf-primary);
    font-weight: 600;
}
.tf-reaction-count { font-size: .8rem; color: var(--tf-text-light); }

/* Edit overlay */
.tf-edit-overlay {
    background: #fff;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 14px;
    margin-top: 8px;
}
.tf-edit-overlay .tf-form-actions { margin-top: 8px; display: flex; gap: 8px; }

/* Quote preview */
.tf-quote-preview {
    background: var(--tf-bg-alt);
    border-left: 4px solid var(--tf-primary);
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    margin-bottom: 10px;
    font-size: .9rem;
    color: var(--tf-text-light);
}
.tf-quote-preview button {
    float: right;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--tf-text-light);
}

/* Report modal */
.tf-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tf-modal {
    background: #fff;
    border-radius: var(--tf-radius);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.tf-modal h3 { margin: 0 0 12px; color: var(--tf-text); font-size: 1.05em; }
.tf-modal textarea { width: 100%; margin: 8px 0; padding: 8px; border: 1px solid var(--tf-border); border-radius: 4px; }
.tf-modal .tf-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.tf-modal-body { color: var(--tf-text); font-size: 0.95em; line-height: 1.5; }
.tf-modal-body p { margin: 0 0 8px; }
.tf-modal-body p:last-child { margin-bottom: 0; }
.tf-modal-body ul { margin: 6px 0 0; padding-left: 18px; }
.tf-modal-body ul li { margin-bottom: 3px; }
.tf-modal-overlay { animation: tf-fade-in .15s ease; }
.tf-modal { animation: tf-slide-up .15s ease; }
@keyframes tf-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tf-slide-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Reply / New Topic forms */
.tf-reply-form, .tf-view-new-topic form {
    background: #fff;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 20px;
    box-shadow: var(--tf-shadow);
}
.tf-reply-form h3 { margin-top: 0; }
.tf-form-row { margin-bottom: 16px; }
.tf-form-row label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.tf-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    font-size: .95rem;
    font-family: inherit;
}
.tf-input:focus { outline: none; border-color: var(--tf-primary); box-shadow: 0 0 0 3px rgba(45,106,46,.15); }
.tf-input-title { font-size: 1rem; }
.tf-required { color: var(--tf-danger); }
.tf-hint { color: var(--tf-text-light); font-size: .8rem; font-weight: normal; }
.tf-form-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }

/* Post preview pane */
.tf-preview-pane {
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    margin-top: 12px;
    overflow: hidden;
}
.tf-preview-pane-header {
    background: var(--tf-bg-alt);
    border-bottom: 1px solid var(--tf-border);
    padding: 6px 14px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--tf-text-light);
    text-transform: uppercase;
    letter-spacing: .05em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tf-preview-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--tf-text-light);
    padding: 0 2px;
    text-transform: none;
    letter-spacing: 0;
}
.tf-preview-close:hover { color: var(--tf-text); }
.tf-preview-content {
    padding: 14px 16px;
    min-height: 40px;
    background: #fff;
}

.tf-file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.tf-file-preview-item {
    background: var(--tf-bg-alt);
    border: 1px solid var(--tf-border);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tf-file-preview-item button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tf-danger);
    font-size: .9rem;
    padding: 0;
    line-height: 1;
}

/* Pagination */
.tf-pagination { display: flex; gap: 6px; margin: 20px 0; flex-wrap: wrap; align-items: center; }
.tf-page-ellipsis { padding: 0 4px; color: var(--tf-text-light); }
.tf-page-btn {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    text-decoration: none;
    color: var(--tf-primary);
    font-size: .875rem;
    transition: all .15s;
}
.tf-page-btn:hover { background: var(--tf-bg-alt); border-color: var(--tf-primary); }
.tf-page-current { background: var(--tf-primary); color: #fff; border-color: var(--tf-primary); }
.tf-page-current:hover { color: #fff; }
.tf-page-prev, .tf-page-next { font-weight: 600; }
.tf-page-disabled { opacity: .4; cursor: default; pointer-events: none; }

/* Locked / empty / error notices */
.tf-locked-notice, .tf-login-notice, .tf-empty, .tf-error {
    padding: 14px 18px;
    border-radius: var(--tf-radius);
    background: var(--tf-bg-alt);
    color: var(--tf-text-light);
    border: 1px solid var(--tf-border);
}
.tf-error { background: #fde8e8; border-color: #f5c6c6; color: #7b1f1f; }

/* Emoji picker */
.tf-emoji-trigger { margin: 6px 0 4px; }

.tf-emoji-picker {
    background: #fff;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    width: 320px;
    max-width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    position: relative;
    z-index: 100;
}
.tf-emoji-picker-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--tf-border);
    padding-bottom: 6px;
}
.tf-ep-tab {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: .78rem;
    cursor: pointer;
    color: var(--tf-text-light);
    transition: all .1s;
}
.tf-ep-tab:hover { background: var(--tf-bg-alt); color: var(--tf-text); }
.tf-ep-tab-active { background: var(--tf-primary); color: #fff; border-color: var(--tf-primary); }
.tf-ep-group {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}
.tf-ep-emoji {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 1.3rem;
    padding: 3px 4px;
    cursor: pointer;
    line-height: 1.2;
    transition: background .1s;
}
.tf-ep-emoji:hover { background: var(--tf-bg-alt); border-color: var(--tf-border); }

/* Editor button bar */
.tf-editor-tools { margin: 4px 0; }
.tf-editor-btns { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.tf-editor-btns .tf-btn { min-width: 90px; text-align: center; height: 30px; line-height: 30px; padding-top: 0; padding-bottom: 0; display: inline-block; vertical-align: middle; }

/* ── Unified Attachments Panel ─────────────────────────────────────────────── */
.tf-att-panel {
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    background: var(--tf-bg);
    margin-top: 8px;
    padding: 10px 12px 8px;
}

/* Drop zone */
.tf-att-dropzone {
    border: 2px dashed var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 16px 12px;
    text-align: center;
    color: var(--tf-text-light);
    font-size: .85rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    margin-bottom: 10px;
    position: relative;
}
.tf-att-dropzone.tf-att-drag-over {
    border-color: var(--tf-primary);
    background: rgba(45, 106, 46, .05);
    color: var(--tf-primary);
}
.tf-att-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.tf-att-browse-label {
    display: inline-block;
    margin-top: 4px;
    font-size: .8rem;
    color: var(--tf-primary);
    text-decoration: underline;
    cursor: pointer;
}

/* File list */
.tf-att-file-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }

.tf-att-file-row {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--tf-border);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.tf-att-file-row-top {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px;
}
.tf-att-file-info { flex: 1; min-width: 0; padding-top: 2px; }
.tf-att-file-name { font-size: .8rem; color: var(--tf-text-light); margin-bottom: 2px; word-break: break-all; }
.tf-att-note { font-size: .75rem; color: var(--tf-text-light); font-style: italic; }
.tf-att-error { font-size: .8rem; color: var(--tf-danger); margin-top: 2px; }

/* Shared with old image uploader — image thumbnail */
.tf-img-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; border: 1px solid var(--tf-border); flex-shrink: 0; }

/* Progress bar (used in file rows during upload) */
.tf-img-progress { height: 4px; background: var(--tf-border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.tf-img-progress-bar { height: 100%; background: var(--tf-primary); border-radius: 2px; width: 0; transition: width 0.15s ease; }

/* Caption row */
.tf-att-caption-wrap {
    border-top: 1px solid var(--tf-border);
    padding: 6px 8px;
    background: var(--tf-surface);
    display: flex;
    align-items: center;
    gap: 6px;
}
.tf-att-caption-wrap::before {
    content: '✏️';
    font-size: .8rem;
    flex-shrink: 0;
    opacity: .6;
}
.tf-att-caption-input { width: 100%; font-size: .85rem; }

/* Remove / Insert buttons */
.tf-att-remove-btn {
    margin-left: auto;
    flex-shrink: 0;
    align-self: flex-start;
    background: none;
    border: 1px solid var(--tf-border);
    border-radius: 3px;
    color: var(--tf-text-light);
    font-size: .75rem;
    padding: 2px 6px;
    cursor: pointer;
    white-space: nowrap;
}
.tf-att-remove-btn:hover { border-color: var(--tf-danger); color: var(--tf-danger); }
.tf-att-insert-btn { flex-shrink: 0; align-self: flex-start; }

/* Type hint badge */
.tf-att-type-hint {
    display: inline-block;
    font-size: .7rem;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 10px;
    padding: 1px 6px;
    color: var(--tf-text-light);
    margin-right: 4px;
    vertical-align: middle;
}

/* Panel footer / status */
.tf-att-footer-hint { font-size: .78rem; color: var(--tf-text-light); margin: 6px 0 0; }
.tf-att-status { font-size: .83rem; color: var(--tf-text-light); margin-bottom: 4px; min-height: 1.2em; }

/* Shared rendered-content helpers */
.tf-file-size { color: var(--tf-text-light); }
.tf-attachment-caption { font-size: 0.9em; font-style: italic; color: var(--tf-text-light); margin: 4px 0 0; }
.tf-gpx-caption { font-weight: 600; font-style: normal; color: var(--tf-text); margin-bottom: 6px; }

/* ── Post count badge ──────────────────────────────────────────────────────── */
.tf-post-count {
    display: block;
    font-size: .72rem;
    color: var(--tf-text-light);
    margin-top: 1px;
}

/* ── Bookmarks ─────────────────────────────────────────────────────────────── */
.tf-bookmark-btn { font-size: .85rem; opacity: .4; }
.tf-bookmark-btn:hover { opacity: 1; }
.tf-bookmark-btn.tf-bookmark-active {
    opacity: 1;
    background: var(--tf-primary) !important;
    color: #fff !important;
    border-color: var(--tf-primary) !important;
}

.tf-bookmarks-panel {
    background: #fff;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    margin-top: 16px;
    box-shadow: var(--tf-shadow);
    overflow: hidden;
}
.tf-bookmarks-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--tf-bg-alt);
    border-bottom: 1px solid var(--tf-border);
    cursor: pointer;
    user-select: none;
}
.tf-bookmarks-panel-header h3 {
    margin: 0;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tf-text-light);
}
.tf-bookmarks-panel-toggle {
    font-size: .75rem;
    color: var(--tf-text-light);
    transition: transform .2s;
}
.tf-bookmarks-panel-body { padding: 4px 16px 8px; }
.tf-bookmark-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid var(--tf-border);
}
.tf-bookmark-item:last-of-type { border-bottom: none; }
.tf-bookmark-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.tf-bookmark-title { color: var(--tf-primary); text-decoration: none; font-size: .9rem; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-bookmark-title:hover { text-decoration: underline; }
.tf-bookmark-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--tf-text-light);
    padding: 0 2px;
    flex-shrink: 0;
    opacity: .5;
}
.tf-bookmark-remove-btn:hover { color: #c0392b; opacity: 1; }
.tf-bookmark-excerpt { font-size: .82rem; color: var(--tf-text-light); font-style: italic; }
.tf-bookmark-meta { font-size: .76rem; color: var(--tf-text-light); }
.tf-bookmarks-view-all { display: block; margin-top: 10px; font-size: .85rem; color: var(--tf-primary); text-decoration: none; }
.tf-bookmarks-view-all:hover { text-decoration: underline; }

/* ── @mentions ─────────────────────────────────────────────────────────────── */
.tf-mention {
    color: var(--tf-primary);
    font-weight: 600;
    background: var(--tf-bg-alt);
    padding: 1px 4px;
    border-radius: 3px;
}
.tf-mention-dropdown {
    position: absolute;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 9999;
    min-width: 200px;
    max-height: 220px;
    overflow-y: auto;
}
.tf-mention-dropdown li {
    padding: 7px 14px;
    cursor: pointer;
    font-size: .9em;
    white-space: nowrap;
}
.tf-mention-dropdown li:hover,
.tf-mention-dropdown li.tf-mention-active {
    background: var(--tf-bg-alt);
    color: var(--tf-primary);
}

/* ── Category header actions ───────────────────────────────────────────────── */
.tf-category-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive — tablet */
@media (max-width: 900px) {
    .tf-topics-header, .tf-topic-row {
        grid-template-columns: 1fr 100px 60px;
    }
    .tf-col-views, .tf-col-last { display: none; }
    .tf-category-stats { min-width: 120px; }
    .tf-last-post-title { max-width: 140px; }
}

/* Responsive — mobile */
@media (max-width: 600px) {
    .tf-topics-header, .tf-topic-row {
        grid-template-columns: 1fr 70px;
    }
    .tf-col-author, .tf-col-views, .tf-col-last { display: none; }
    .tf-category-card { flex-direction: column; align-items: flex-start; gap: 8px; }
    .tf-category-stats { align-items: flex-start; min-width: 0; }
    .tf-last-post-title { max-width: 100%; }
    .tf-topic-admin-controls { flex-wrap: wrap; }
    .tf-post-actions { flex-wrap: wrap; }
    .tf-action-label { display: none; }
}

/* ── Poll ────────────────────────────────────────────────────────────────── */
.tf-poll {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
}
.tf-poll-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
}
.tf-poll-icon { font-size: 1.2em; flex-shrink: 0; margin-top: 1px; }
.tf-poll-question {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--tf-text);
    flex: 1;
    line-height: 1.4;
}
.tf-poll-closed-badge {
    font-size: 0.7em;
    font-weight: 600;
    background: var(--tf-text-light);
    color: #fff;
    border-radius: 3px;
    padding: 2px 7px;
    flex-shrink: 0;
    align-self: center;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Vote form */
.tf-poll-vote-form { display: flex; flex-direction: column; gap: 8px; }
.tf-poll-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid var(--tf-border);
    color: var(--tf-text);
    font-size: 0.95em;
    transition: background .15s, border-color .15s;
}
.tf-poll-option-label:hover { background: var(--tf-bg); border-color: var(--tf-primary); }
.tf-poll-option-label input { cursor: pointer; }
.tf-poll-vote-actions { display: flex; gap: 8px; margin-top: 10px; }
.tf-poll-back-to-vote-btn { margin-top: 10px; }

/* Results */
.tf-poll-results { display: flex; flex-direction: column; gap: 8px; }
.tf-poll-result-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px 12px;
    padding: 4px 0;
}
.tf-poll-result-label {
    font-size: 0.95em;
    color: var(--tf-text);
    grid-column: 1;
    grid-row: 1;
}
.tf-poll-bar-wrap {
    grid-column: 1 / 3;
    grid-row: 2;
    background: var(--tf-border);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}
.tf-poll-bar {
    height: 100%;
    background: var(--tf-primary);
    border-radius: 4px;
    width: 0;
    transition: width .6s ease;
}
.tf-poll-voted .tf-poll-bar { background: var(--tf-primary); opacity: 0.85; }
.tf-poll-result-count {
    font-size: 0.85em;
    color: var(--tf-text-light);
    white-space: nowrap;
    grid-column: 3;
    grid-row: 1 / 3;
    text-align: right;
}
.tf-poll-voted .tf-poll-result-label { font-weight: 600; color: var(--tf-primary); }
.tf-poll-total {
    margin-top: 8px;
    font-size: 0.82em;
    color: var(--tf-text-light);
}
.tf-poll-admin { margin-top: 14px; }

/* Poll builder (new topic form) */
.tf-poll-builder { margin-top: 8px; }
.tf-poll-toggle-row { margin-bottom: 0; }
.tf-poll-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
    color: var(--tf-text);
    font-size: 0.95em;
}
.tf-poll-enable { cursor: pointer; }
.tf-poll-fields {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--tf-border);
    border-radius: 6px;
    background: var(--tf-bg);
}
.tf-poll-options-list { display: flex; flex-direction: column; gap: 6px; }
.tf-poll-option-row { display: flex; gap: 6px; align-items: center; }
.tf-poll-option-row .tf-input { flex: 1; }
.tf-poll-multi-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    color: var(--tf-text);
    cursor: pointer;
}

/* ── Search ────────────────────────────────────────────────────────────────── */
.tf-search-bar {
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
}
.tf-search-input {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    font-size: .9rem;
    color: var(--tf-text);
    background: #fff;
    outline: none;
}
.tf-search-input:focus {
    border-color: var(--tf-primary);
    box-shadow: 0 0 0 2px rgba(45,106,46,.15);
}
.tf-search-hint {
    color: var(--tf-text-light);
    font-size: .9rem;
    margin: 0;
}
.tf-search-header {
    margin-bottom: 12px;
}
.tf-search-count,
.tf-search-no-results {
    font-size: .9rem;
    color: var(--tf-text-light);
    margin: 0;
}
.tf-search-results {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    overflow: hidden;
    margin-bottom: 16px;
}
.tf-search-result {
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid var(--tf-border);
}
.tf-search-result:last-child { border-bottom: none; }
.tf-search-result:hover { background: var(--tf-bg-alt); }
.tf-search-result-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.tf-search-result-title a {
    color: var(--tf-text);
    text-decoration: none;
}
.tf-search-result-title a:hover { color: var(--tf-primary); }
.tf-search-result-meta {
    font-size: .78rem;
    color: var(--tf-text-light);
    margin-bottom: 6px;
}
.tf-search-cat {
    color: var(--tf-primary);
    text-decoration: none;
    font-weight: 500;
}
.tf-search-cat:hover { text-decoration: underline; }
.tf-search-match-count { font-style: italic; }
.tf-search-snippet {
    font-size: .85rem;
    color: var(--tf-text);
    line-height: 1.5;
}
.tf-search-snippet mark,
.tf-search-result-title mark {
    background: #fff3b0;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Recent Posts panel (forum index) ─────────────────────────────────────── */
.tf-recent-posts {
    margin-top: 24px;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    overflow: hidden;
}
.tf-recent-posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--tf-bg-alt);
    border-bottom: 1px solid var(--tf-border);
    cursor: pointer;
    user-select: none;
}
.tf-recent-posts-header h3 {
    margin: 0;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tf-text-light);
}
.tf-recent-posts-toggle {
    font-size: .6rem;
    color: var(--tf-text-light);
    transition: transform .2s;
}
.tf-recent-posts-body { background: #fff; }
.tf-recent-post {
    padding: 10px 16px;
    border-bottom: 1px solid var(--tf-border);
}
.tf-recent-post:last-child { border-bottom: none; }
.tf-recent-post:hover { background: var(--tf-bg-alt); }
.tf-recent-post-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 3px;
}
.tf-recent-post-title {
    font-size: .9rem;
    font-weight: 600;
    min-width: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tf-recent-post-title a { color: var(--tf-text); text-decoration: none; }
.tf-recent-post-title a:hover { color: var(--tf-primary); }
.tf-recent-post-meta {
    font-size: .75rem;
    color: var(--tf-text-light);
    white-space: nowrap;
    flex-shrink: 0;
}
.tf-recent-post-cat { color: var(--tf-primary); text-decoration: none; font-weight: 500; }
.tf-recent-post-cat:hover { text-decoration: underline; }
.tf-recent-post-snippet {
    font-size: .82rem;
    color: var(--tf-text-light);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =====================================================================
   PRIVATE MESSAGES
   ===================================================================== */

/* --- Toolbar (appears on all views for logged-in users) --- */
.tf-pm-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tf-border);
}
.tf-pm-inbox-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--tf-primary);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 600;
}
.tf-pm-inbox-link:hover { text-decoration: underline; }
.tf-pm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #c0392b;
    color: #fff;
    border-radius: 9px;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1;
}
.tf-pm-badge[data-count="0"],
.tf-pm-badge:empty { display: none; }
.tf-pm-compose-btn { flex-shrink: 0; }

/* --- Inbox thread list --- */
.tf-pm-thread-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.tf-pm-thread-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--tf-border);
    border-left: 3px solid transparent;
    border-radius: var(--tf-radius);
    padding: 12px 16px;
    text-decoration: none;
    color: var(--tf-text);
    transition: box-shadow .15s;
}
.tf-pm-thread-row:hover { box-shadow: 0 3px 10px rgba(0,0,0,.1); }
.tf-pm-thread-row.tf-pm-unread { border-left-color: var(--tf-primary); }
.tf-pm-thread-row.tf-pm-unread .tf-pm-thread-other { font-weight: 700; }
.tf-pm-thread-info { flex: 1; min-width: 0; }
.tf-pm-thread-other { font-size: .9rem; margin-bottom: 2px; }
.tf-pm-thread-excerpt {
    font-size: .82rem;
    color: var(--tf-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tf-pm-thread-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.tf-pm-thread-date { font-size: .78rem; color: var(--tf-text-light); }
.tf-pm-unread-badge {
    background: var(--tf-primary);
    color: #fff;
    border-radius: 9px;
    font-size: .7rem;
    font-weight: 700;
    padding: 1px 7px;
}

/* --- Thread / conversation view --- */
.tf-pm-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 4px 12px 4px 0;
}
.tf-pm-message { display: flex; flex-direction: column; max-width: 72%; }
.tf-pm-message-mine  { align-self: flex-end;   align-items: flex-end; }
.tf-pm-message-theirs { align-self: flex-start; align-items: flex-start; }
.tf-pm-message-author {
    font-size: .78rem;
    font-weight: 600;
    color: var(--tf-text-light);
    margin-bottom: 3px;
    padding-left: 2px;
}
.tf-pm-message-bubble {
    background: var(--tf-bg-alt, #f5f5f5);
    border: 1px solid var(--tf-border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: .9rem;
    line-height: 1.6;
}
.tf-pm-message-bubble p:last-child { margin-bottom: 0; }
.tf-pm-message-mine .tf-pm-message-bubble {
    background: var(--tf-primary);
    color: #fff;
    border-color: var(--tf-primary);
}
.tf-pm-message-meta {
    font-size: .72rem;
    color: var(--tf-text-light);
    margin-top: 4px;
}

/* --- Reply form --- */
.tf-pm-reply-form {
    background: #fff;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 16px;
}
.tf-pm-reply-form textarea,
.tf-pm-compose-form textarea {
    width: 100%;
    resize: vertical;
    padding: 8px 12px;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    font-family: inherit;
    font-size: .9rem;
    margin-bottom: 10px;
    box-sizing: border-box;
}
.tf-pm-reply-form textarea:focus,
.tf-pm-compose-form textarea:focus {
    outline: none;
    border-color: var(--tf-primary);
    box-shadow: 0 0 0 3px rgba(45,106,46,.15);
}

/* --- Compose form --- */
.tf-pm-compose-form { max-width: 640px; }
.tf-pm-compose-to,
.tf-pm-compose-body { margin-bottom: 16px; }
.tf-pm-compose-to label,
.tf-pm-compose-body label {
    display: block;
    font-weight: 600;
    font-size: .875rem;
    margin-bottom: 6px;
}
.tf-pm-to-wrapper { position: relative; }
.tf-pm-to-wrapper input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    font-family: inherit;
    font-size: .9rem;
    box-sizing: border-box;
}
.tf-pm-to-wrapper input[type="text"]:focus {
    outline: none;
    border-color: var(--tf-primary);
    box-shadow: 0 0 0 3px rgba(45,106,46,.15);
}

/* --- Autocomplete suggestions --- */
.tf-pm-suggestions {
    position: absolute;
    z-index: 999;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--tf-border);
    border-top: none;
    border-radius: 0 0 var(--tf-radius) var(--tf-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    max-height: 200px;
    overflow-y: auto;
}
.tf-pm-suggestion-item {
    padding: 9px 14px;
    cursor: pointer;
    font-size: .9rem;
}
.tf-pm-suggestion-item:hover { background: var(--tf-bg-alt, #f5f5f5); }

/* --- Search match highlighting --- */
.tf-pm-thread-excerpt mark,
.tf-pm-message-bubble mark {
    background: #fff176;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}
@keyframes tf-pm-flash {
    0%   { background-color: rgba(255, 220, 50, .55); }
    60%  { background-color: rgba(255, 220, 50, .55); }
    100% { background-color: transparent; }
}
.tf-pm-message-flash {
    animation: tf-pm-flash 4s ease-out forwards;
    border-radius: var(--tf-radius);
}
.tf-pm-match-count {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    color: var(--tf-primary);
    background: rgba(45,106,46,.1);
    border-radius: 10px;
    padding: 1px 7px;
    vertical-align: middle;
    margin-left: 4px;
}

/* --- Inbox search --- */
.tf-pm-search-form {
    margin-bottom: 16px;
}
.tf-pm-search-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}
.tf-pm-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    font-family: inherit;
    font-size: .9rem;
}
.tf-pm-search-input:focus {
    outline: none;
    border-color: var(--tf-primary);
    box-shadow: 0 0 0 3px rgba(45,106,46,.15);
}
.tf-pm-search-btn {
    padding: 8px 16px;
    background: var(--tf-primary);
    color: #fff;
    border: none;
    border-radius: var(--tf-radius);
    font-size: .9rem;
    cursor: pointer;
}
.tf-pm-search-btn:hover { background: var(--tf-primary-dark, #1b4d1c); }
.tf-pm-search-clear {
    font-size: .85rem;
    color: var(--tf-muted, #888);
    text-decoration: none;
    white-space: nowrap;
}
.tf-pm-search-clear:hover { text-decoration: underline; }

/* --- Responsive --- */
@media (max-width: 600px) {
    .tf-pm-message { max-width: 90%; }
    .tf-pm-messages { max-height: 50vh; }
}
