/* =========================================================
   ABBUC Forum – post and forum-listing styles
   Depends on abbuc.css (Bootstrap + ABBUC custom properties)
   ========================================================= */

/* ----- Breadcrumb --------------------------------------- */

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
    list-style: none;
    background: none;
    border: none;
    padding: 0.2rem 0;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    
    /* atarixle */
    box-shadow:0 10px 20px rgba(0, 0, 0, 0.2), 0 0 2px 1px rgba(0, 0, 0, 0.1);
    padding:0;
    margin-top:1em;
    border-radius:4px;
    color:white;
    background-color:var(--primary-medium, #479CD1);
    font-family: "Abbuc sans", system-ui, sans-serif;
}

.breadcrumb-item a {
    color: white;
    text-decoration: none;
    padding: 0;
}

.breadcrumb-item:first-of-type a {
    padding-left:0.5em;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
    color: white;
}

.breadcrumb-item.active {
    color:white;
    text-shadow:0 1px 2px black;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    padding: 0 0.45rem;
    color:rgba(255, 255, 255, 0.9);
    text-shadow:none;
}

/* ----- Forum listing ------------------------------------ */

.forum-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.forum-card {
    display: flex;
    border: 1px solid var(--primary-pale, #A1CDE8);
    border-radius: 0.6rem;
    box-shadow: 0 2px 6px rgba(34, 97, 136, 0.09);
    overflow: hidden;
    background: #fff;
}

.forum-card-main {
    flex: 1;
    padding: 0.85rem 1.1rem;
    border-right: 1px solid var(--primary-light, #CEE5F3);
    min-width: 0; /* allow text truncation inside flex child */
}

.forum-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
    line-height: 1.3;
}

.forum-card-title a {
    color: var(--primary-dark, #226188);
    text-decoration: none;
}

.forum-card-title a:hover {
    text-decoration: underline;
    color: var(--primary-medium, #479CD1);
}

/* Downgrade h1/h2 inside forum.md info to subtitle size */
.forum-card-info {
    font-size: 0.875rem;
    color: #555;
}

.forum-card-info h1,
.forum-card-info h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
    margin: 0 0 0.2rem;
}

.forum-card-info > :last-child { margin-bottom: 0; }

/* Stats column */
.forum-card-stats {
    width: 330px;
    flex-shrink: 0;
    padding: 0.85rem 1.1rem;
    background: var(--primary-hint, #EBF5FA);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.45rem;
}

.forum-stat-counts {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.forum-stat-item {
    font-size: 0.82rem;
    color: #555;
}

.forum-stat-item strong {
    font-size: 1rem;
    color: var(--primary-dark, #226188);
    font-variant-numeric: tabular-nums;
}

.forum-last-post {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.8rem;
    min-width: 0;
}

.last-post-title {
    font-weight: 600;
    color: #333;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.last-post-title:hover {
    text-decoration: underline;
    color: var(--primary-medium, #479CD1);
}

.last-post-meta {
    color: #6c757d;
    display: block;
}

.forum-no-posts {
    color: #aaa;
    font-style: italic;
    font-size: 0.8rem;
}

@media (max-width: 575px) {
    .forum-card { flex-direction: column; }
    .forum-card-main { border-right: none; border-bottom: 1px solid var(--primary-light, #CEE5F3); }
    .forum-card-stats { width: auto; }
}

/* ----- Thread listing table ----------------------------- */

.forum-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.forum-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    margin-bottom: 0.6rem;
}

.thread-list-heading {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-dark, #226188);
}

a.btn-new-topic {
    font-size: 0.82rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.3rem;
    text-decoration: none;
    color: #fff;
    background: var(--primary-medium, #479CD1);
    border: 1px solid var(--primary-medium, #479CD1);
    white-space: nowrap;
    box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);
}

a.btn-new-topic:hover {
    background: var(--primary-pale, #A1CDE8);
    border-color: var(--primary-pale, #A1CDE8);
    color: var(--primary-dark, #226188);
    text-decoration: none;
}

.thread-list {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--primary-pale, #A1CDE8);
    border-radius: 0.6rem;
    box-shadow: 0 2px 6px rgba(34, 97, 136, 0.09);
    margin-bottom: 1.5rem;
    overflow: hidden; /* needed for border-radius in most browsers */
}

.thread-list thead th {
    background-color: var(--primary-dark, #226188);
    color: #fff;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    white-space: nowrap;
}

.thread-list thead th.col-title   { width: 100%; } /* greedy: takes remaining space */
.thread-list thead th.col-author  { width: 1%; }   /* shrink-wrap */
.thread-list thead th.col-posts   { width: 1%; text-align: center; }
.thread-list thead th.col-date    { width: 1%; }

.thread-list tbody tr {
    transition: background-color 0.1s;
}

.thread-list tbody tr:hover {
    background-color: var(--primary-hint, #EBF5FA);
}

.thread-list tbody tr.thread-new td {
    background-color: var(--primary-hint, #EBF5FA);
}

.thread-list tbody tr.thread-new .thread-title a {
    color: var(--primary-medium, #479CD1);
}

.thread-list tbody td {
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--primary-light, #CEE5F3);
    vertical-align: middle;
    font-size: 0.9rem;
}

.thread-list tbody tr:first-child td {
    border-top: none;
}

.thread-title a {
    color: var(--primary-dark, #226188);
    font-weight: 600;
    text-decoration: none;
}

.thread-title a:hover {
    text-decoration: underline;
    color: var(--primary-medium, #479CD1);
}

.thread-author {
    white-space: nowrap;
    color: #555;
}

.thread-posts {
    text-align: center;
    white-space: nowrap;
    color: #555;
    font-variant-numeric: tabular-nums;
}

.thread-date {
    white-space: nowrap;
    color: #6c757d;
    font-size: 0.82rem;
    text-align: right;
}

/* ----- Post sort bar ------------------------------------ */

.post-sort-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.post-sort-label {
    font-size: 0.82rem;
    color: #6c757d;
}

.btn-sort-posts {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.2rem 0.5rem;
    margin-left: auto;
    border: 1px solid var(--primary-pale, #A1CDE8);
    border-radius: 0.3rem;
    background: var(--primary-hint, #EBF5FA);
    color: var(--primary-dark, #226188);
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
}

.btn-sort-posts:hover {
    background: var(--primary-light, #CEE5F3);
    border-color: var(--primary-medium, #479CD1);
}

.btn-sort-posts .sort-asc,
.btn-sort-posts .sort-desc {
    opacity: 0.35;
    transition: opacity 0.15s;
}

.btn-sort-posts .sort-asc {
    opacity: 1;
}

.btn-sort-posts.sort-order-desc .sort-asc {
    opacity: 0.35;
}

.btn-sort-posts.sort-order-desc .sort-desc {
    opacity: 1;
}

/* Theme switcher <select> — shares visual style with .btn-sort-posts */
.select-theme {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--primary-pale, #A1CDE8);
    border-radius: 0.3rem;
    background: var(--primary-hint, #EBF5FA);
    color: var(--primary-dark, #226188);
    cursor: pointer;
    line-height: 1;
}

.select-theme:hover,
.select-theme:focus {
    border-color: var(--primary-medium, #479CD1);
    background: var(--primary-light, #CEE5F3);
    outline: none;
}

/* ----- Post card ---------------------------------------- */

.post.card {
    border: 1px solid var(--primary-pale, #A1CDE8);
    border-radius: 0.65rem;
    box-shadow: 0 2px 10px rgba(34, 97, 136, 0.13);
    overflow: hidden;
    margin-bottom: 1.5rem !important;
}

/* New posts (appeared since current visit started) */
article.post.card.post-new {
    border-color: var(--primary-medium, #479CD1);
    box-shadow: 0 2px 12px rgba(71, 156, 209, 0.35);
}
article.post.card.post-new .card-header {
    background-color: var(--primary-medium, #479CD1);
}
.post-new-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-dark, #226188);
    border-radius: 0.2rem;
    padding: 0.05rem 0.3rem;
    margin-left: 0.45rem;
    vertical-align: middle;
}

/* Reply posts (not from thread opener) are left-indented, chat-style */
.post.card.post-reply {
    margin-left: 2.5rem;
}

/* Post header (author · date · optional title) */
.post .card-header {
    background-color: var(--primary-dark, #226188);
    color: #fff;
    border-bottom: none;
    padding: 0.6rem 1rem;
}

.post-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.post-author {
    font-weight: 600;
    font-size: 0.95rem;
}

.post-date {
    font-size: 0.82rem;
    opacity: 0.72;
    white-space: nowrap;
    margin-left: auto;
}

.post-link {
    color: inherit;
    opacity: 0.4;
    font-size: 0.75rem;
    line-height: 1;
    text-decoration: none;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

.post-link:hover {
    opacity: 1;
    color: inherit;
    text-decoration: none;
}

.post-latest-link {
    color: inherit;
    opacity: 0.72;
    font-size: 0.95rem;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
}

.post-latest-link:hover {
    opacity: 1;
    color: inherit;
    text-decoration: none;
}

/* Post body */
.post .card-body.post-body {
    padding: 1rem 1.25rem;
    line-height: 1.5;
}

.post-body p {
    margin-bottom: 0.7em;
}

.post-body pre,
.post-body code {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875em;
}

.post-body pre {
    white-space: pre;
    overflow-x: auto;
    background: var(--primary-hint, #EBF5FA);
    border: 1px solid var(--primary-light, #CEE5F3);
    border-radius: 0.35rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0 1rem;
    line-height: 1.5;
}

.post-body pre code {
    background: transparent;
    padding: 0;
    font-size: inherit;
    border-radius: 0;
}

.post-body code {
    background: var(--primary-hint, #EBF5FA);
    padding: 0.1em 0.3em;
    border-radius: 0.2em;
}

.post .card-body.post-body > :first-child { margin-top: 0; }
.post .card-body.post-body > :last-child  { margin-bottom: 0; }


.post-body img {
    /* (disabled) Images always occupy their own line */
    /* — nothing floats beside them */
    /*    display: block;  */
    max-width: 100%;
    height: auto;
}

/* Blockquotes: each nesting level adds 2vw left indent, capped at 5 levels (≈10vw) */
.post-body blockquote {
    margin: 0.5rem 0 1.5rem 2vw;
    padding: 0.5rem 0.9rem 0.5rem 1rem;
    border-left: 4px solid var(--primary-medium, #479CD1);
    background: var(--primary-hint, #EBF5FA);
    border-radius: 0 0.35rem 0.35rem 0;
    color: #3a5a72;
    font-size: 0.92em;
}

.post-body blockquote p {
    margin: 0 0 0.5rem 0;
}

.post-body blockquote blockquote {
    margin-left: 2vw;
    background: var(--primary-light, #CEE5F3);
}

.post-body blockquote blockquote blockquote {
    margin-left: 2vw;
    background: var(--primary-pale, #A1CDE8);
    color: #2a4a5e;
}

.post-body blockquote blockquote blockquote blockquote {
    margin-left: 2vw;
    background: #8bbbd8;
    color: #1e3a4e;
}

.post-body blockquote blockquote blockquote blockquote blockquote {
    margin-left: 2vw; /* 50vw total — cap reached */
    background: #6aaac9;
    color: #152b3a;
}

/* Level 6+: no further indentation */
.post-body blockquote blockquote blockquote blockquote blockquote blockquote {
    margin-left: 0;
}

/* Signature */
.post-signature {
    padding: 0.45rem 1.25rem 0.5rem;
    border-top: 1px dashed var(--primary-pale, #A1CDE8);
    background: var(--primary-hint, #EBF5FA);
    font-size: 0.82rem;
    color: #555;
}

.post-signature > :first-child { margin-top: 0; }
.post-signature > :last-child  { margin-bottom: 0; }

/* Attachments */
.post-attachments {
    padding: 0.5rem 1.25rem 0.75rem;
    border-top: 1px solid var(--primary-light, #CEE5F3);
    font-size: 0.875rem;
}

.post-attachments ul {
    margin: 0.25rem 0 0;
    padding-left: 1.2rem;
}

/* Like button */
.post-like {
    display: flex;
    justify-content: flex-end;
    padding: 0.35rem 1.25rem 0;
}

.post-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    padding: 0.15rem 0.6rem;
    border-radius: 1rem;
    color: var(--primary-dark, #226188);
    border: 1px solid var(--primary-pale, #A1CDE8);
    background: var(--primary-hint, #EBF5FA);
    line-height: 1.4;
    cursor: pointer;
}

.post-like-btn:hover:not([disabled]) {
    background: var(--primary-light, #CEE5F3);
}

.post-like-btn[disabled] {
    cursor: default;
    opacity: 0.7;
}

.post-like-btn[disabled].post-like-btn--liked {
    background: var(--primary-pale, #A1CDE8);
    border-color: var(--primary-medium, #479CD1);
    opacity: 1;
}

.post-like-emoji { font-size: 0.95rem; }
.post-like-btn .like-count { font-weight: 600; }

/* Like button inside the action bar: pinned to the left */
.post-actions .post-like {
    padding: 0;
    margin-right: auto;
}

/* Reply / quote action buttons */
.post-actions {
    display: flex;
    gap: 0.4rem;
    padding: 0.35rem 1.25rem 0.5rem;
    justify-content: flex-end;
    border-top: 1px solid var(--primary-light, #CEE5F3);
}

.post-actions a {
    font-size: 0.78rem;
    padding: 0.15rem 0.55rem;
    border-radius: 0.25rem;
    text-decoration: none;
    color: var(--primary-dark, #226188);
    border: 1px solid var(--primary-pale, #A1CDE8);
    background: var(--primary-hint, #EBF5FA);
    line-height: 1.4;
    box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);
}

.post-actions a:hover {
    background: var(--primary-light, #CEE5F3);
    text-decoration: none;
}

.post-actions button.post-delete-btn {
    font-size: 0.78rem;
    padding: 0.15rem 0.55rem;
    border-radius: 0.25rem;
    line-height: 1.4;
    color: #a33;
    border: 1px solid #e3b3b3;
    background: #fbebeb;
    cursor: pointer;
}

.post-actions button.post-delete-btn:hover:not([disabled]) {
    background: #f5d3d3;
}

.post-actions button.post-delete-btn[disabled] {
    cursor: default;
    opacity: 0.6;
}

/* Action buttons: icons instead of text on small screens */
.post-actions .act-icon { display: none; }
@media (max-width: 575px) {
    .post-actions .act-label { display: none; }
    .post-actions .act-icon { display: inline; font-size: 1rem; line-height: 1; }
    .post-actions a, .post-actions button.post-delete-btn { padding: 0.25rem 0.7rem; }
}

/* Post author avatar (inside dark card header) */
.post-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 5%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

/* Post author link (inside dark card header) */
.post-author a {
    color: inherit;
    text-decoration: none;
}

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

/* Thread list author link */
.thread-author a {
    color: inherit;
    text-decoration: none;
}

.thread-author a:hover {
    text-decoration: underline;
    color: var(--primary-medium, #479CD1);
}

/* ----- User profile page -------------------------------- */

.user-profile {
    max-width: 640px;
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.user-avatar {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 5%;
    border: 3px solid var(--primary-pale, #A1CDE8);
    flex-shrink: 0;
}

.user-profile-name {
    margin: 0;
    font-size: 1.6rem;
    color: var(--primary-dark, #226188);
}

.user-edit-btn,
.user-pm-btn {
    margin-left: auto;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-color: var(--primary-medium, #479CD1);
    color: var(--primary-medium, #479CD1);
    border-radius: 0.35rem;
    white-space: nowrap;
}
.user-edit-btn:hover,
.user-pm-btn:hover {
    background: var(--primary-medium, #479CD1);
    color: #fff;
    text-decoration: none;
}

.user-profile-fields {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.45rem 1.5rem;
    font-size: 0.9rem;
    border: 1px solid var(--primary-pale, #A1CDE8);
    border-radius: 0.6rem;
    padding: 1rem 1.25rem;
    background: var(--primary-hint, #EBF5FA);
}

.user-profile-fields dt {
    color: #6c757d;
    font-weight: 600;
    white-space: nowrap;
}

.user-profile-fields dd {
    margin: 0;
    word-break: break-word;
}

/* ----- Logged-in user bar (injected by forum.js) ---------- */

.user-login-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.45rem 1.5rem;
    background: var(--primary-hint, #EBF5FA);
    border-top: 1px solid var(--primary-light, #CEE5F3);
    font-size: 0.875rem;
}

a.user-login-bar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-dark, #226188);
    text-decoration: none;
}

a.user-login-bar-link:hover {
    text-decoration: underline;
    color: var(--primary-medium, #479CD1);
}

.user-login-bar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 5%;
    object-fit: cover;
    border: 1px solid var(--primary-pale, #A1CDE8);
}

.user-login-bar-avatar-icon {
    font-size: 28px;
    line-height: 1;
    color: var(--primary-pale, #A1CDE8);
}

/* Username field locked by AMBMU cookie */
#username[readonly] {
    background-color: var(--primary-hint, #EBF5FA);
    border-color: var(--primary-pale, #A1CDE8);
    color: var(--primary-dark, #226188);
    cursor: default;
}

/* Generator version string (injected by render_page() in footer) */
.site-version {
    opacity: 0.6;
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

/* ----- Recent posts page (neue-beitraege.html) ----------- */
a.link-recent-posts {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--primary-medium, #479CD1);
}

.recent-posts-day {
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
    padding-bottom: 0.2rem;
    font-size: 1rem;
    color: var(--primary-dark, #226188);
    border-bottom: 1px solid var(--primary-light, #CEE5F3);
}

.thread-list thead th.col-forum { width: 1%; }   /* shrink-wrap */

.thread-forum {
    white-space: nowrap;
    color: var(--primary-medium, #479CD1);
    font-size: 0.82rem;
}

/* ----- Editor (editor.html) ----------------------------- */

/* FA5 Solid codepoints used by the markdown toolbar (font loaded in abbuc.css) */
.fa-bold:before        { content: "\f032" }
.fa-italic:before      { content: "\f033" }
.fa-underline:before   { content: "\f0cd" }
.fa-image:before       { content: "\f03e" }
.fa-minus:before       { content: "\f068" }
.fa-list-ul:before     { content: "\f0ca" }
.fa-list-ol:before     { content: "\f0cb" }
.fa-quote-right:before { content: "\f10e" }
.fa-code:before        { content: "\f121" }

/* ── Markdown toolbar ──────────────────────────────────── */
.md-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    align-items: center;
    padding: 0.25rem 0.35rem;
    background: var(--primary-hint, #EBF5FA);
    border: 1px solid var(--primary-pale, #A1CDE8);
    border-bottom: none;
    border-radius: 0.35rem 0.35rem 0 0;
}

.md-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 0.2rem;
    padding: 0.1rem 0.45rem;
    font-size: 0.825rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--primary-dark, #226188);
    cursor: pointer;
    min-width: 1.8rem;
    text-align: center;
    font-family: inherit;
}
.md-btn:hover {
    background: var(--primary-light, #CEE5F3);
    border-color: var(--primary-pale, #A1CDE8);
}
.md-btn:active {
    background: var(--primary-pale, #A1CDE8);
}
.md-btn-text {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.md-btn-sep {
    display: inline-block;
    width: 1px;
    height: 1.1rem;
    background: var(--primary-pale, #A1CDE8);
    margin: 0 0.1rem;
    flex-shrink: 0;
}

.att-new-item {
    padding: 0.1rem 0;
    font-size: 0.875rem;
}

.editor-panes {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}
.editor-pane, .preview-pane { flex: 1 1 0; min-width: 0; }

#body-textarea {
    height: 62vh;
    min-height: 200px;
    resize: vertical;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 0.865rem;
    line-height: 1.55;
    border-color: var(--primary-pale, #A1CDE8);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
#body-textarea:focus {
    border-color: var(--primary-medium, #479CD1);
    box-shadow: 0 0 0 0.2rem rgba(71,156,209,.25);
}

.preview-card { height: 100%; border: 1px solid var(--primary-pale, #A1CDE8); border-radius: 0.65rem; overflow: hidden; }
.preview-card-header {
    background: var(--primary-dark, #226188);
    color: #fff;
    font-size: 0.78rem;
    padding: 0.35rem 0.85rem;
}
#preview-content {
    min-height: 62vh;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1rem 1.2rem;
    font-size: 0.9rem;
    line-height: 1.5;
}
#preview-content .preview-placeholder { color: #bbb; font-style: italic; }

/* mirror forum.css blockquote inside preview */
#preview-content blockquote {
    margin: 0.6rem 0;
    padding: 0.5rem 0.9rem 0.5rem 1rem;
    border-left: 4px solid var(--primary-medium, #479CD1);
    background: var(--primary-hint, #EBF5FA);
    border-radius: 0 0.35rem 0.35rem 0;
    color: #3a5a72;
    font-size: 0.92em;
}
#preview-content blockquote p { margin: 0; }
#preview-content blockquote blockquote { background: var(--primary-light, #CEE5F3); margin-top: 0.4rem; }

#saved-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}

#saved-modal {
    background: #fff;
    border-radius: 0.5rem;
    padding: 2rem 2.5rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

#saved-modal h5 {
    color: var(--primary-dark, #226188);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

#saved-modal p {
    color: #555;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

#goto-btn { min-width: 180px; }

@media (max-width: 767px) {
    .editor-panes { flex-direction: column; }
    #body-textarea { height: 45vh; }
    #preview-content { min-height: 30vh; max-height: 50vh; }
}

/* here starts the mobile magic of atarixle */
@media screen and (max-width: 480px) {
    .container h1:first-of-type {
        background-color:var(--primary-medium, #479CD1);
        color:white;
        margin:0; padding:0;
        border-bottom-left-radius:4px;
        border-bottom-right-radius:4px;
        padding:0.125em 0.5rem;
        text-shadow:0 1px 2px black;
    }
    .container h1:first-child {
        margin:1rem 0;
        border-radius:4px;
    }
    .breadcrumb {
        overflow:auto;
        margin-bottom:0;
        border-bottom-left-radius:0;
        border-bottom-right-radius:0;
        box-shadow:none;
    }
    .breadcrumb-item.active {
        font-size:0;
    }
    .breadcrumb-item.active::before {
        font-size:0.875rem;
    }
    .post.card.post-reply {
        margin-left:1rem;
        box-shadow:none;
        box-shadow:inset 0 2px 10px rgba(34, 97, 136, 0.13);
    }
    .post .card-header {
        padding:0.3rem 0.5rem;
    }
    table.thread-list {
        display:block;
        box-shadow:none;
        border:none;
        margin:0; padding:0;
        overflow:auto;
    }
    .thread-list tbody {
        display:block;
    }
    table.thread-list tr {
        display:block;
        width:100%;
        max-width:100%;
        border:1px solid var(--primary-light, #CEE5F3);
        box-shadow:0 2px 4px var(--primary-light, #CEE5F3);
        padding:0; margin:0.75rem 0;
        border-radius:4px;
    }
    table.thread-list thead {
        display:none;
    }
    table.thread-list tr td.thread-title {
        display:block;
        word-break:break-all;
    }
    table.thread-list tr td.thread-author {
        display:inline-block;
        width:50%;
    }
    /* table.thread-list tr td.thread-author::before {
        content:'\1F464';
    } */
    table.thread-list tr td.thread-posts {
        display:inline-block;
        text-align:center;
        width:10%;
        padding-left:0;
        padding-right:0;
        /* background:red;
        color:white; */
        font-family:"Abbuc sans", system-ui, sans-serif;
        font-weight:bold;
        border-radius:1000px;
    }
    table.thread-list tr td.thread-posts::before {
        content:'\1F4AC';
        font-size:95%;
    }
    table.thread-list tr td.thread-date {
        display:inline-block;
        width:40%;
    }
    /* table.thread-list tr td.thread-date::before {
        content:'\1F552';
    } */
    .thread-list tbody td {
        border-top:none;
    }
    .thread-list tbody td.thread-title {
        border-bottom:1px solid var(--primary-light, #CEE5F3);
    }
    .post-body blockquote {
        margin:0.6rem 0;
    }
    .post-actions a {
        padding:0.25rem 1.22rem;
    }
}

/* @mention autocomplete in the editor */
.mention-list { position: fixed; z-index: 1000; min-width: 12rem; max-width: 24rem;
    background: #fff; border: 1px solid var(--primary-pale, #A1CDE8); border-radius: 0.4rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.15); overflow: hidden; font-size: 0.9rem; }
.mention-item { padding: 0.25rem 0.6rem; cursor: pointer; white-space: nowrap; }
.mention-item.active, .mention-item:hover { background: var(--primary-light, #CEE5F3); color: var(--primary-dark, #226188); }

/* ----- Collapsible posts */
.post-collapse-toggle {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0 0.5rem 0 0;
    float: left;
}
.post-collapse-toggle:focus-visible { outline: 2px solid #fff; }
.post.post-collapsed > :not(.card-header) { display: none; }

.user-pm-btn[hidden] { display: none; }

/* ----- Site-wide search */
.forum-search { margin-bottom: 1rem; }
.forum-search-box {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.forum-search-toggle {
    flex: none;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0.4rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--primary-dark, #226188);
    cursor: pointer;
}
.forum-search-toggle:hover, .forum-search.is-open .forum-search-toggle { background: var(--primary-light, #CEE5F3); }
.forum-search-toggle svg { display: block; width: 100%; height: 100%; }
.forum-search-input {
    width: 0;
    padding: 0.4rem 0 0.4rem 0;
    border: 0 solid var(--primary-pale, #A1CDE8);
    border-radius: 4px;
    font-size: 1rem;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.2s ease, padding 0.2s ease;
}
.forum-search.is-open .forum-search-input {
    width: min(22rem, calc(100% - 2.5rem));
    padding: 0.4rem 2.25rem 0.4rem 0.75rem;
    border-width: 1px;
    opacity: 1;
}
.forum-search-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.forum-search-clear {
    position: absolute;
    right: 2.7rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.4rem;
    height: 1.4rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #999;
    color: #fff;
    font-size: 1rem;
    line-height: 1.4rem;
    text-align: center;
    cursor: pointer;
}
.forum-search-clear:hover { background: var(--primary-dark, #226188); }
.forum-search-clear[hidden] { display: none; }
.forum-search-results {
    margin-top: 0.5rem;
    border: 1px solid var(--primary-pale, #A1CDE8);
    border-radius: 4px;
    background: #fff;
    max-height: 70vh;
    overflow-y: auto;
}
.forum-search-info { padding: 0.5rem 0.75rem; color: #666; font-size: 0.9rem; }
.forum-search-list { list-style: none; margin: 0; padding: 0; }
.forum-search-hit { padding: 0.5rem 0.75rem; border-top: 1px solid var(--primary-light, #CEE5F3); }
.forum-search-title { font-weight: 700; color: var(--primary-dark, #226188); }
.forum-search-meta { font-size: 0.8rem; color: #666; }
.forum-search-snippet { font-size: 0.9rem; overflow-wrap: anywhere; }
.forum-search-results[hidden] { display: none; }

/* ----- Current user avatar in the navbar (right of the "Member" badge; name shown only as tooltip) */
.navbar-nav .nav-item:has(.nav-user) { display: flex; align-items: center; }
/* #masthead selector needed: abbuc.css sets padding/display on `#masthead .navbar-nav > li a` */
#masthead .navbar-nav > li > a.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: -1.1rem;          /* slightly overlay the Member badge */
    padding: 1px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-dark, #226188);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    z-index: 1;
}
#masthead .navbar-nav > li > a.nav-user:hover { color: var(--primary-dark, #226188); text-decoration: none; }
.nav-user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* ----- PM envelope (navbar) */
.nav-pm-item { display: flex; align-items: center; }
#masthead .navbar-nav > li > a.nav-pm { display: inline-flex; padding: 0 0.4rem; text-decoration: none; }
#masthead .navbar-nav > li > a.nav-pm-new  { color: #ffc107; }
#masthead .navbar-nav > li > a.nav-pm-none { color: #999; }

/* ----- Badge / PM envelope outside the collapsed hamburger menu */
.nav-user-area { flex-direction: row; align-items: center; margin-left: auto; margin-right: 0.5rem; order: 1; }
.nav-user-area .nav-link { padding-left: 0.4rem; padding-right: 0.4rem; }
.navbar-toggler { order: 2; }
@media (min-width: 1380px) {
    .nav-user-area { order: 3; margin-left: 0; margin-right: 0; }
}
