
/* access */
.access-lock{display:inline-flex;vertical-align:-2px;margin-inline-end:4px;color:var(--text-subtle)}.access-lock .icon{width:14px;height:14px}.access-when{display:none}.access-row .form-help{margin-top:4px}.access-pw{display:flex;gap:8px;justify-content:center;margin-top:12px}.access-pw input{max-width:220px}.access-hidden{margin:12px 0 0;padding:12px 14px;border:1px dashed var(--line);border-radius:var(--radius);background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-sm)}.access-hidden b{color:var(--text)}.access-shown{margin-top:12px;padding:12px 14px;border:1px solid var(--success);border-radius:var(--radius);background:var(--success-soft)}.access-shown > .access-shown-head{display:flex;align-items:center;gap:6px;margin-bottom:6px;color:var(--success);font-size:var(--font-size-sm);font-weight:600}.access-shown .icon{width:15px;height:15px}.access-private{color:var(--text-muted);font-style:italic}

/* albums */
/* ================================================================
   Albums plugin — MadWay-matched dark warm + red accent
   ================================================================ */

/* ---------- Index page (/albums) ---------- */
.albums-index { padding: 8px 0 24px; }
.albums-head { margin-bottom: 24px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.albums-head h1 {
    font-family: var(--font);
    font-size: var(--font-size-3xl); font-weight: 700; letter-spacing: -0.025em;
    margin: 0; color: var(--text);
}
.albums-count { color: var(--text-subtle); font-size: var(--font-size-md); margin: 0; }

/* Sort tabs — under the header, above the grid. */
.albums-sort {
    display: flex; gap: 4px; flex-wrap: wrap;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0;
}
.albums-sort a {
    display: inline-block;
    padding: 6px 10px;
    font-size: var(--font-size-sm); font-weight: 600;
    color: var(--text-subtle);
    text-decoration: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom: 2px solid transparent;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
    margin-bottom: -1px; /* overlap the bottom border */
}
.albums-sort a:hover {
    color: var(--text);
    background: var(--panel-2);
}
.albums-sort a.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.albums-card {
    display: flex; flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none; color: inherit;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.albums-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.albums-card-cover {
    aspect-ratio: 16 / 10;
    background-size: cover; background-position: center;
    background-color: var(--panel-2);
    position: relative;
}
.albums-card-cover-empty {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); opacity: 0.4;
}
.albums-card-cover-empty .icon { width: 36px; height: 36px; }
.albums-card-cover.albums-cover-nsfw,
.albums-card-cover.is-nsfw {
    filter: blur(18px); transform: scale(1.1);
}
.albums-card-nsfw-badge {
    position: absolute; top: 8px; right: 8px;
    background: var(--brand); color: var(--brand-text);
    padding: 2px 8px; border-radius: var(--radius-sm);
    font-size: 10px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.05em;
}
/* "NEW" ribbon — green badge on the top-left corner of any thumbnail whose
   album or photo was uploaded within the last 48h (albums_is_new()). Sits
   opposite the NSFW badge so both can show at once. pointer-events:none so
   clicks pass through to the underlying <a>. */
.albums-new-badge {
    position: absolute; top: 6px; left: 6px;
    background: var(--success, #16a34a); color: #fff;
    padding: 2px 7px; border-radius: var(--radius-sm, 4px);
    font-size: 10px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.05em;
    line-height: 1.4;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.albums-card-body { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.albums-card-title {
    font-family: var(--font);
    font-size: var(--font-size-xl); font-weight: 800;
    color: var(--text); margin: 0;
    line-height: 1.25;
}
.albums-card:hover .albums-card-title { color: var(--brand); }
.albums-card-desc {
    font-size: var(--font-size-sm); color: var(--text-subtle);
    margin: 0; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.albums-card-meta {
    display: flex; align-items: center; gap: 10px;
    font-size: var(--font-size-sm); color: var(--text-muted);
    margin-top: auto; padding-top: 6px;
}
.albums-card-photos, .albums-card-views {
    display: inline-flex; align-items: center; gap: 4px;
}
.albums-card-photos .icon, .albums-card-views .icon { width: 13px; height: 13px; }
.albums-card-meta b { color: var(--text); font-weight: 700; }
.albums-card-date { margin-left: auto; }

/* ---------- Album page (/album/{id}-{slug}) ---------- */
.albums-album { padding: 8px 0 24px; }
.albums-album-head {
    margin-bottom: 18px; padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.albums-album-head-text { min-width: 0; }
/* Title + action buttons share one inline row: title on the left, buttons pushed to the far right.
   Buttons wrap below on very narrow screens. */
.albums-album-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 8px;
}
.albums-album-title-row .albums-album-title { margin: 0; }
.albums-album-title {
    font-family: var(--font);
    font-size: var(--font-size-3xl); font-weight: 700; letter-spacing: -0.025em;
    margin: 0 0 8px; color: var(--text);
    line-height: 1.1;
}
.albums-album-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex: none;
    margin-left: auto; /* push to the far right of the title row */
}
.albums-album-actions .btn { white-space: nowrap; }
.albums-album-desc {
    font-size: var(--font-size-md); color: var(--text-muted);
    margin: 0 0 12px; line-height: 1.5;
    max-width: 720px;
}
.albums-album-meta {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 6px 8px; font-size: var(--font-size-sm);
    color: var(--text-muted);
}
.albums-album-owner a { color: var(--text); font-weight: 700; }
.albums-album-owner a:hover { color: var(--brand); }
.albums-album-meta b { color: var(--text-muted); }
.albums-album-meta .icon { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px;}
/* Icon-only stats (no text labels) — the icons are universally understood.
   Tooltips on each span explain what they count for anyone unsure. */
.albums-album-meta .label { display: none; }
.albums-album-meta .albums-album-photos,
.albums-album-meta .albums-album-views,
.albums-album-meta .albums-album-likes,
.albums-album-meta .albums-album-comments { white-space: nowrap; }
.albums-nsfw-tag {
    background: var(--brand); color: var(--brand-text);
    padding: 2px 8px; border-radius: var(--radius-sm);
    font-size: 10px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.albums-album-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.albums-tag {
    background: var(--panel-2); color: var(--text-subtle);
    padding: 3px 9px; border-radius: var(--radius-sm);
    font-size: var(--font-size-sm); font-weight: 600;
}

.albums-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
.albums-photo-thumb {
    display: flex; flex-direction: column;
    text-decoration: none; color: inherit;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s;
}
.albums-photo-thumb:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
}
.albums-photo-thumb-img {
    background-color: var(--panel-2);
    background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1; /* square thumbs in the grid for tidy layout */
    overflow: hidden;
}
.albums-photo-thumb-img img {
    width: 100%; height: 100%; object-fit: cover;
}
.albums-photo-thumb.is-private .albums-photo-thumb-img img {
    filter: blur(14px); transform: scale(1.1);
}
.albums-photo-thumb-empty {
    color: var(--text-muted); opacity: 0.4;
}
.albums-photo-thumb-empty .icon { width: 24px; height: 24px; }

/* Title overlay — hidden by default, appears on hover, centered over the image */
.albums-photo-thumb-img { position: relative; }
.albums-photo-thumb-overlay {
    position: absolute;
    display: flex; align-items: center; justify-content: center;
    padding: 12px; text-align: center;
    background: rgba(0,0,0,0.55);
    color: #fff; font-size: var(--font-size-sm); font-weight: 600;
    line-height: 1.3; word-break: break-word;
    opacity: 0; transition: opacity 0.15s;
    pointer-events: none; width: 100%;
}
.albums-photo-thumb:hover .albums-photo-thumb-overlay { opacity: 1; }

/* Meta bar below the image — 3-slot row: Likes (left) · Comments (center) · Views (right).
   `justify-content: space-between` pins likes to the left edge and views to the right edge;
   comments sit at the midpoint. All three slots are always shown, even at 0. */
.albums-photo-thumb-meta {
    padding: 5px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: var(--font-size-xs); color: var(--text-muted);
}
.albums-photo-thumb-meta .icon { width: 12px; height: 12px; opacity: 0.7; margin-right: 3px; }
.albums-photo-thumb-meta b { color: var(--text-muted); font-weight: 600; }
.albums-thumb-likes,
.albums-thumb-views,
.albums-thumb-comments { display: inline-flex; align-items: center; }

/* Interactive thumbs — likes (heart) and comments (speech bubble) are clickable.
   Views stays display-only. Hover only fires on devices that actually support
   hover (mouse/trackpad) — touch devices get the active state on tap instead. */
.albums-thumb-likes,
.albums-thumb-comments {
    cursor: pointer;
    padding: 2px 4px;
    margin: -2px -4px; /* negative margin offsets padding so layout doesn't shift */
    border-radius: var(--radius-sm);
    transition: color 0.12s, background 0.12s;
}
@media (hover: hover) {
    .albums-photo-thumb:hover .albums-thumb-likes:hover,
    .albums-photo-thumb:hover .albums-thumb-comments:hover {
        color: var(--text);
        background: var(--panel-2);
    }
    .albums-photo-thumb:hover .albums-thumb-likes:hover .icon,
    .albums-photo-thumb:hover .albums-thumb-comments:hover .icon { opacity: 1; }
    .albums-photo-thumb:hover .albums-thumb-likes:hover b,
    .albums-photo-thumb:hover .albums-thumb-comments:hover b { color: var(--text); }
}

/* Liked state — heart fills with the brand red, matching the photo page like button.
   .active is rendered server-side based on the current user's likes; toggled
   client-side by the AJAX handler. */
.albums-thumb-likes.active { color: var(--brand); }
.albums-thumb-likes.active .icon { fill: var(--brand); opacity: 1; }
.albums-thumb-likes.active b { color: var(--brand); }

/* Busy state — while the AJAX like request is in flight, dim the heart and
   disable pointer events so rapid clicks don't stack up race conditions. */
.albums-thumb-likes.is-busy {
    opacity: 0.55;
    pointer-events: none;
}

.albums-thumb-dot { opacity: 0.4; } /* legacy — no longer rendered, kept for back-compat */

/* ---------- Photo page (/photo/{id}-{slug}) ----------
   Uses flatbb's own .topic-page / .topic-head / .post / .post-head / .post-body /
   .post-actions classes — those are styled by flatbb core. We only override the
   photo-specific bits: image sizing, NSFW blur, missing-photo state. */

/* The photo image: large, centered, contained within the post-content area.
   No card/background/border around the image — it sits on the page background. */
.albums-photo-figure {
    position: relative; margin: 0 0 12px;
    display: flex; align-items: center; justify-content: center;
    min-height: 240px;
}
.albums-photo-img {
    display: block; max-width: 100%; max-height: 80vh;
    width: auto; height: auto;
    object-fit: contain;
    transition: filter 0.2s;
    cursor: zoom-in;
}
.albums-photo-img.is-blurred {
    filter: blur(24px); transform: scale(1.05);
}
.albums-photo-reveal {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px;
    background: var(--brand); color: var(--brand-text);
    border: 0; border-radius: var(--radius);
    font-family: var(--font);
    font-weight: 700; font-size: var(--font-size-sm);
    cursor: pointer; transition: background 0.15s;
    z-index: 2;
}
.albums-photo-reveal:hover { background: var(--brand-hover); }
.albums-photo-reveal .icon { width: 14px; height: 14px; }
.albums-photo-missing {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 60px 20px; color: var(--text-muted);
}
.albums-photo-missing .icon { width: 40px; height: 40px; }

/* Photo description (rendered Markdown) — sits inside .post-content, inherits flatbb styles */
.albums-photo-desc { margin-top: 12px; }
.albums-photo-desc :first-child { margin-top: 0; }
.albums-photo-desc :last-child { margin-bottom: 0; }

/* Like button in the post-actions row — keep our red active state */
.albums-photo-like-label { font-size: var(--font-size-sm); }
.post-actions [data-albums-like].active { color: var(--brand); }
.post-actions [data-albums-like].active .icon { fill: var(--brand); }

/* "Deleted" banner — shown to admins viewing a soft-deleted photo (matches
   flatbb's post.php deleted-state styling — a muted alert with the alert icon). */
.post-deleted-banner {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 12px;
    color: var(--text-subtle);
    font-size: var(--font-size-sm);
    display: flex; align-items: center; gap: 8px;
}
.post-deleted-banner .icon { width: 16px; height: 16px; color: var(--brand); flex: none; }

/* When admin is viewing a soft-deleted photo, dim the photo slightly so the
   deleted state is visually obvious at a glance. */
.post-content.is-deleted .albums-photo-img { opacity: 0.5; filter: grayscale(0.5); }

/* Right-align the Share button in the post-actions row (pushes it to the end) */
.post-actions .act-right,
.post-actions .share-menu { margin-inline-start: auto; }
.post-actions .share-menu .dropdown-toggle { padding: 4px 8px; }

/* ---------- Sidebar card ---------- */
.albums-sidecard { padding: 4px 0; }
.albums-sidecard-list { display: flex; flex-direction: column; gap: 8px; }
.albums-sidecard-item {
    display: flex; gap: 10px; align-items: center;
    text-decoration: none; color: inherit;
    padding: 4px; border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.albums-sidecard-item:hover { background: var(--panel-2); }
.albums-sidecard-cover {
    flex: none; width: 56px; height: 42px;
    background-size: cover; background-position: center;
    background-color: var(--panel-2);
    border-radius: var(--radius-sm);
}
.albums-sidecard-cover.is-nsfw { filter: blur(10px); }
.albums-sidecard-text {
    display: flex; flex-direction: column; gap: 2px;
    min-width: 0;
}
.albums-sidecard-title {
    font-size: var(--font-size-sm); font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.albums-sidecard-meta { font-size: var(--font-size-xs); color: var(--text-subtle); }
.albums-sidecard-all {
    display: block; margin-top: 10px; padding: 8px;
    text-align: center; text-decoration: none;
    background: var(--panel-2); color: var(--brand);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm); font-weight: 700;
    transition: background 0.15s;
}
.albums-sidecard-all:hover { background: var(--brand); color: var(--brand-text); }

/* ---------- Photo of the day (sidebar card) ---------- */
.albums-potd { display: flex; flex-direction: column; gap: 8px; }
.albums-potd-link { display: block; text-decoration: none; }
.albums-potd-img {
    width: 100%; aspect-ratio: 16 / 10;
    background-size: cover; background-position: center;
    background-color: var(--panel-2);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    transition: border-color 0.15s;
}
.albums-potd-link:hover .albums-potd-img { border-color: var(--brand); }
.albums-potd-info { display: flex; flex-direction: column; gap: 2px; }
.albums-potd-title {
    font-weight: 700; color: var(--text); text-decoration: none;
    font-size: var(--font-size-sm); line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.albums-potd-title:hover { color: var(--brand); }
.albums-potd-album {
    color: var(--text-muted); text-decoration: none;
    font-size: var(--font-size-xs);
}
.albums-potd-album:hover { color: var(--brand); }

/* ---------- Empty state ---------- */
.albums-empty {
    padding: 60px 20px; text-align: center;
    font-size: var(--font-size-lg);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .albums-photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
    .albums-photo-nav { grid-template-columns: 1fr; }
    .albums-photo-album-link { order: -1; justify-content: center; }
    .albums-photo-prev, .albums-photo-next { justify-content: center; }
    /* On mobile: hide the text labels so only icons show — saves horizontal space. */
    .albums-album-actions .btn-label { display: none; }
    .albums-album-actions .btn { padding: 7px 10px; }
}

/* (Photo action bar no longer needed — actions now live in flatbb's .post-actions row at the bottom of the post card, styled by core.) */

/* ---------- Upload form ---------- */
.albums-upload { padding: 8px 0 24px; max-width: 720px; margin: 0 auto; }
.albums-upload-title {
    font-family: var(--font);
    font-size: var(--font-size-3xl);
    font-weight: 600;
    letter-spacing: -0.025em;
    margin: 12px 0 4px;
    color: var(--text);
    line-height: 1.1;
}

/* Dropzone — large, centered icon + prompt. Click anywhere or drag files. */
.albums-upload-dropzone {
    border: 2px dashed var(--brand);
    border-radius: var(--radius);
    padding: 16px 24px; text-align: center;
    background: var(--panel-2);
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
    position: relative;
}
.albums-upload-dropzone:hover,
.albums-upload-dropzone.is-dragover {
    border-color: var(--brand);
    background: var(--panel);
}
.albums-upload-dropzone-icon {
    width: 25px; height: 25px;
    color: var(--text-subtle);
    margin-bottom: 6px;
}
.albums-upload-dropzone:hover .albums-upload-dropzone-icon,
.albums-upload-dropzone.is-dragover .albums-upload-dropzone-icon {
    color: var(--brand);
}
.albums-upload-dropzone-prompt p { margin: 4px 0; }
.albums-upload-dropzone-prompt p b { color: var(--text); font-weight: 700; }
/* (dropzone is compact in both states — no collapsed override needed) */

/* Selected files list — appears below the dropzone */
.albums-upload-list {
    list-style: none; margin: 16px 0 0; padding: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.albums-upload-list:empty { display: none; }
.albums-upload-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px; align-items: center;
    padding: 8px 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    animation: albums-upload-item-in 0.15s ease-out;
}
@keyframes albums-upload-item-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.albums-upload-thumb {
    width: 56px; height: 56px;
    border-radius: var(--radius-sm);
    background: var(--panel-2);
    background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex: none;
}
.albums-upload-thumb .icon { width: 24px; height: 24px; color: var(--text-muted); }
.albums-upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.albums-upload-info { min-width: 0; }
.albums-upload-title-input {
    width: 100%;
    background: none;
    border: 0;
    border-bottom: 1px dashed transparent;
    color: var(--text);
    font-family: var(--font);
    font-size: var(--font-size-md); font-weight: 600;
    padding: 2px 0;
    margin: 0 0 2px;
    outline: none;
    transition: border-color 0.15s;
}
.albums-upload-title-input:hover { border-bottom-color: var(--brand); }
.albums-upload-title-input:focus { border-bottom-color: var(--brand); }
.albums-upload-title-input::placeholder { color: var(--text-muted); font-weight: 400; }
.albums-upload-name {
    font-size: var(--font-size-md); font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.albums-upload-meta {
    font-size: var(--font-size-sm); color: var(--text-subtle);
    margin-top: 2px;
}
.albums-upload-meta.is-over-limit { color: var(--brand); font-weight: 700; }
.albums-upload-remove {
    background: none; border: 0;
    color: var(--text-muted);
    padding: 6px; border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex; align-items: center;
    transition: color 0.15s, background 0.15s;
}
.albums-upload-remove:hover { color: var(--brand); background: var(--panel-2); }
.albums-upload-remove .icon { width: 16px; height: 16px; }

/* Upload button — disabled state when no files selected */
[data-albums-upload-btn][disabled],
[data-albums-upload-btn].disabled {
    opacity: 0.5; cursor: not-allowed; pointer-events: none;
}

/* ---------- Edit photo form ---------- */
.albums-photo-edit { padding: 8px 0 24px; max-width: 720px; margin: 0 auto; }
.albums-photo-edit-title {
    font-family: var(--font);
    font-size: var(--font-size-3xl); font-weight: 700; letter-spacing: -0.025em;
    margin: 12px 0 16px; color: var(--text); line-height: 1.1;
}

/* ---------- Comments section (custom system — comments styled as flatbb .post cards) ----------
   Comments use flatbb's .post / .post-head / .post-body / .post-actions classes so they
   look identical to topic replies. We only style the section wrapper, title, and empty state. */
.albums-comments { margin-top: 16px; max-width: 100%; }
.albums-comments-title {
    font-family: var(--font);
    font-size: var(--font-size-lg); font-weight: 600; color: var(--text);
    margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.albums-comments-count {
    background: var(--panel-2); color: var(--text-subtle);
    padding: 1px 8px; border-radius: var(--radius-pill); font-size: var(--font-size-sm); font-weight: 700;
}
.albums-comments-empty { margin: 0 0 16px; font-size: var(--font-size-sm); }
.albums-comments-form { margin-top: 12px; }
.albums-comments-form-actions { margin-top: 8px; display: flex; justify-content: flex-end; }
.albums-comments-form-actions .btn { padding: 6px 16px; font-size: var(--font-size-sm); }

/* (data-confirm CSS removed — flatbb core already styles this) */

/* ---------- Admin form: upload permission radios + group checkboxes (v2.10.0) ---------- */
.albums-perm-radios { display: flex; flex-direction: column; gap: 8px; }
.radio-line { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; cursor: pointer; }
.radio-line input[type="radio"] { margin-top: 3px; flex: none; }
.radio-line b { color: var(--text); }
.radio-line .muted { display: block; margin-top: 2px; }
.albums-perm-groups { margin-top: 12px; padding: 12px; background: var(--panel-2); border-radius: var(--radius-sm); border: 1px solid var(--line); }
.albums-perm-groups-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.checkbox-line { display: flex; align-items: center; gap: 6px; padding: 4px 6px; cursor: pointer; }
.checkbox-line input[type="checkbox"] { flex: none; }

/* ---------- Upload quota box (v2.10.1) ---------- */
.albums-upload-quota {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; margin-bottom: 20px;
    background: var(--brand-soft); color: var(--brand);
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm); font-weight: 600;
}
.albums-upload-quota .icon { width: 16px; height: 16px; flex: none; }
.albums-upload-quota.is-blocked {
    background: var(--panel-2); color: var(--text-subtle);
    border-color: var(--line);
}
.albums-upload-quota.is-blocked .icon { color: var(--brand); }

/* ---------- Admin: photo management table ---------- */
/* Thumbnails in the admin photo table — small, square, fixed size so the table rows line up.
   The thumbnail links to the photo page (target="_blank") so the admin can preview without
   losing their place in the table. */
.albums-photo-admin-table .albums-photo-admin-thumb {
    width: 56px; height: 56px;
    padding: 4px;
}
.albums-photo-admin-table .albums-photo-admin-thumb a {
    display: block; width: 48px; height: 48px;
    border-radius: var(--radius-sm); overflow: hidden;
    background: var(--panel-2);
}
.albums-photo-admin-table .albums-photo-admin-thumb img {
    width: 100%; height: 100%; object-fit: cover;
}
/* Deleted photos — dim the row so the deleted state is visually obvious at a glance */
.albums-photo-admin-table tr.is-deleted { opacity: 0.55; }
.albums-photo-admin-table tr.is-deleted .albums-photo-admin-thumb img { filter: grayscale(0.6); }
/* Bulk action bar — sits below the table, sticks the action buttons together */
.albums-bulk-bar { padding: 8px 0; }
.albums-bulk-bar .btn { white-space: nowrap; }

/* ---------- Related photos (photo page, below the photo, above comments) ---------- */
/* A strip of up to 6 square thumbnails from the same album, most-viewed first.
   Title appears on hover (gradient overlay from the bottom). Clicking jumps to
   that photo's page. The section title links back to the album. */
.albums-related { margin-top: 10px; }
.albums-related-title {
    font-family: var(--font);
    font-size: var(--font-size-lg); font-weight: 600; color: var(--text);
    margin: 0 0 12px;
}
.albums-related-title a { color: var(--brand); }
.albums-related-title a:hover { text-decoration: underline; }
.albums-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.albums-related-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1; /* square thumbs — matches the album grid's square thumbs */
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel-2);
    border: 1px solid var(--line);
    transition: border-color 0.15s, transform 0.15s;
}
.albums-related-thumb:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
}
.albums-related-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.2s;
}
.albums-related-thumb:hover img { transform: scale(1.06); }
/* NSFW blur on related thumbs — same pattern as album grid thumbs (.is-private).
   Applies when the parent album is tagged NSFW and the viewer hasn't enabled
   "Show NSFW" in Preferences. Without this, related photos on a NSFW photo
   page would show explicit content unblurred to guests. */
.albums-related-thumb.is-nsfw img {
    filter: blur(14px); transform: scale(1.1);
}
.albums-related-thumb.is-nsfw:hover img { transform: scale(1.1); }
/* NSFW badge on related thumbs — same orange brand color as everywhere else,
   just lifted above the blurred image so it doesn't get hidden behind it.
   The default .albums-card-nsfw-badge has no z-index, which means the
   blurred <img> (which gets transform: scale(1.1) on blur) can render
   on top of it in some stacking contexts. z-index: 1 fixes that. */
.albums-related-thumb .albums-card-nsfw-badge {
    z-index: 1;
}
.albums-related-empty {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); opacity: 0.4;
}
.albums-related-empty .icon { width: 24px; height: 24px; }
.albums-related-overlay {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 8px 8px 6px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff; font-size: var(--font-size-xs); font-weight: 600;
    line-height: 1.3; word-break: break-word;
    opacity: 0; transition: opacity 0.15s;
    pointer-events: none;
}
.albums-related-thumb:hover .albums-related-overlay { opacity: 1; }

@media (max-width: 768px) {
    .albums-related-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
    /* Mobile shows only the first 3 — quick browse, no need to scroll past a wall of thumbs.
       Desktop keeps all 5. We hide thumbs 4 and 5 via nth-child. */
    .albums-related-thumb:nth-child(4),
    .albums-related-thumb:nth-child(5) { display: none; }
}


/* announce */
.announce-bar{display:flex;align-items:center;gap:8px;padding:9px 14px;margin-bottom:12px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);font-size:var(--font-size-md)}.announce-icon{display:inline-flex;color:var(--brand);flex:none}.announce-icon svg{width:18px;height:18px}.announce-label{color:var(--brand);flex:none}.announce-list{position:relative;flex:1;min-width:0;height:1.6em;overflow:hidden}.announce-item{position:absolute;inset:0;display:flex;align-items:center;gap:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:0;transform:translateY(110%);transition:opacity .35s,transform .35s}.announce-item.on{opacity:1;transform:none}.announce-item.off{opacity:0;transform:translateY(-110%)}.announce-item a{color:var(--text);font-weight:550}.announce-item a:hover{color:var(--brand)}.announce-item time{color:var(--text-subtle);font-size:var(--font-size-xs);flex:none}.announce-nav{display:inline-flex;gap:2px;flex:none;margin-inline-start:auto}.announce-nav button{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border:0;border-radius:var(--radius-sm);background:none;color:var(--text-subtle);cursor:pointer;padding:0}.announce-nav button:hover{background:var(--panel-2);color:var(--text)}.announce-nav svg{width:16px;height:16px}[dir="rtl"] .announce-nav svg{transform:scaleX(-1)}.col-right .announce-bar{flex-wrap:wrap}.col-right .announce-list{flex-basis:100%}.col-right .announce-nav{order:-1;margin-inline-start:auto}@media(max-width:640px){.announce-bar{margin:0 calc(-1 * var(--page-x,12px)) 10px;border-radius:0;border-left:0;border-right:0;padding:8px var(--page-x,12px);font-size:var(--font-size-sm)}.announce-item time{display:none}}

/* back_to_top */

    #back-to-top {
      position: fixed;
      bottom: 24px;
      inset-inline-end: 24px;
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      border: 1px solid var(--line);
      border-radius: var(--radius-sm);
      background: var(--panel);
      color: var(--text-muted);
      box-shadow: var(--shadow-md);
      cursor: pointer;
      opacity: 0;
      visibility: hidden;
      transform: translateY(10px);
      transition: opacity .2s ease, visibility .2s ease, transform .2s ease, background .12s, color .12s, border-color .12s;
    }
    #back-to-top.show {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }
    #back-to-top:hover {
      background: var(--panel-2);
      color: var(--brand);
      border-color: var(--brand);
    }
    #back-to-top .icon {
      width: 18px;
      height: 18px;
    }

/* badge */
.badge-strip{display:inline-flex;align-items:center;gap:3px;vertical-align:middle}.badge-pic{display:inline-block;object-fit:contain;vertical-align:middle}.badge-pic-empty{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--panel-2);border:1px solid var(--line);color:var(--text-muted);font-size:11px;font-weight:700}.badge-more{font-size:var(--font-size-xs);color:var(--text-subtle)}.badge-profile{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 14px}.badge-profile-label{font-size:var(--font-size-sm);color:var(--text-muted)}.badge-profile .badge-pic{width:34px;height:34px}.badge-profile a{margin-inline-start:auto;font-size:var(--font-size-sm)}.profile-card .badge-profile{margin:0;gap:8px}.profile-card .badge-profile .badge-strip{order:3;flex-basis:100%;flex-wrap:wrap}.profile-card .badge-profile .badge-pic{width:30px;height:30px}.badge-wall{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}.badge-card{display:flex;gap:12px;align-items:flex-start;padding:14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel)}.badge-card.locked{opacity:.55}.badge-card .badge-pic{width:48px;height:48px;flex:none}.badge-card b{display:block}.badge-card p{margin:2px 0 6px;font-size:var(--font-size-sm);color:var(--text-muted)}.badge-how{font-size:var(--font-size-xs);color:var(--text-subtle)}.badge-have{display:block;margin-top:3px;font-size:var(--font-size-xs);color:var(--brand);font-weight:600}.badge-admin-pic{width:32px;height:32px;object-fit:contain;vertical-align:middle}

/* callouts */
/* ---------------------------------------------------------------- callouts
   Admonition boxes for Markdown, created by the Callouts plugin.
   Source syntax in posts/pages:
       > [!warning]
       > Body text — anything Markdown allows.
   The renderer turns this into:
       <div class="callout callout-warning">
         <div class="callout-head"><svg class="callout-icon">…</svg><span class="callout-label">Warning</span></div>
         <div class="callout-body">…rendered markdown…</div>
       </div>
   Colors come from FlatBB's semantic CSS variables (--info, --success,
   --warning, --danger) so each theme's palette is respected automatically.
*/

.callout {
    --co-color: var(--info, #2563eb);
    --co-soft: var(--info-soft, #dbeafe);
    margin: 16px 0;
    padding: 0;
    border: 1px solid var(--co-color);
    border-left-width: 4px;
    border-radius: var(--radius, 6px);
    background: var(--co-soft);
    overflow: hidden;
}

/* Type variants — only the color tokens change, structure stays identical. */
.callout-note      { --co-color: var(--info,    #2563eb); --co-soft: var(--info-soft,    #dbeafe); }
.callout-tip       { --co-color: var(--success, #16a34a); --co-soft: var(--success-soft, #dcfce7); }
.callout-success   { --co-color: var(--success, #16a34a); --co-soft: var(--success-soft, #dcfce7); }
.callout-warning   { --co-color: var(--warning, #d97706); --co-soft: var(--warning-soft, #fef3c7); }
.callout-danger    { --co-color: var(--danger,  #dc2626); --co-soft: var(--danger-soft,  #fee2e2); }

/* Header bar: icon + label, sits above the body. Uses the callout's color
   for the icon + label text so the type is unmistakable even when scanning. */
.callout-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 6px;
    font-weight: 700;
    color: var(--co-color);
}
.callout-icon { width: 18px; height: 18px; flex: none; }
.callout-label {
    font-size: var(--font-size-sm, 14px);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}

/* Body — keeps the same horizontal padding as the head, a touch more vertical.
   Inner paragraphs use the post-content pipeline (so bold/links/lists/code
   all work). The first paragraph's top margin is zeroed so the body sits
   flush with the head, and the last paragraph's bottom margin is zeroed so
   the callout doesn't have an awkward gap at the bottom. */
.callout-body {
    padding: 4px 10px 8px;
    color: var(--text, inherit);
}
.callout-body > *:first-child { margin-top: 0; }
.callout-body > *:last-child { margin-bottom: 0; }

/* Dark theme tweaks — the soft tints get a translucent alpha via the
   --*-soft variables already redefined in [data-theme="dark"], so we don't
   need a separate override here. But the colored border can feel harsh on
   a dark background, so we soften it slightly. */
[data-theme="dark"] .callout,
[data-theme="auto"] .callout {
    border-color: color-mix(in srgb, var(--co-color) 50%, transparent);
}

/* Inside .post-content (post body) the existing rule sets `> :first-child`
   margin to 0 — our callout sits there fine. But inside a blockquote
   (someone nested a callout in a regular quote — unusual but valid),
   the existing blockquote styles would add italic. Undo that. */
blockquote .callout { font-style: normal; }

/* Mobile: tighten the padding so a callout doesn't dominate a small screen. */
@media (max-width: 600px) {
    .callout-head { padding: 8px 10px 4px; }
    .callout-body { padding: 2px 10px 10px; }
}


/* featured */
.featured-badge{display:inline-flex;vertical-align:-2px;margin-right:3px;align-items:center}.featured-badge .icon{width:14px;height:14px;}.featured-bold{font-weight:700}.featured-red,.featured-red a{color:#d93025}.featured-orange,.featured-orange a{color:#e7672e}.featured-green,.featured-green a{color:#188038}.featured-blue,.featured-blue a{color:#1a73e8}.featured-purple,.featured-purple a{color:#7b3fe4}.featured-menu{position:relative;display:inline-block}.featured-menu summary{list-style:none;cursor:pointer}.featured-menu summary::-webkit-details-marker{display:none}.featured-form{position:absolute;left:0;top:calc(100% + 6px);z-index:30;min-width:230px;padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 8px 24px rgba(0,0,0,.12)}.featured-form .form-row{margin-bottom:8px}.featured-form select{width:100%}.topic-bar .featured-form{left:auto;right:0}

/* growth */
/* Growth: the pages (head and tabs, hero, overview boxes, calendar, leaderboards, levels) and the sidebar card. */
.growth-page{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
.growth-page>*{min-width:0}
.growth-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.growth-head h1{margin:0;font-size:var(--font-size-2xl)}
.growth-tabs{margin:0}
.growth-pill{display:inline-block;padding:0 6px;border:1px solid var(--line);border-radius:var(--radius-pill);background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-xs);font-weight:600;line-height:1.6;white-space:nowrap;vertical-align:middle}
/* buttons */
.growth-go{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 18px;height:40px;border:0;border-radius:999px;background:var(--brand);color:var(--brand-text,#fff);font:inherit;font-weight:650;cursor:pointer;box-shadow:0 4px 12px color-mix(in srgb,var(--brand) 25%,transparent);transition:transform .12s}
.growth-go:hover{transform:translateY(-1px);color:var(--brand-text,#fff);text-decoration:none}
.growth-go:disabled{opacity:.7;cursor:default;transform:none}
.growth-go svg,.growth-done svg{width:17px;height:17px}
.growth-go b{padding:1px 8px;border-radius:999px;background:color-mix(in srgb,#fff 24%,transparent);font-size:var(--font-size-sm)}
.growth-done{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 16px;border-radius:999px;background:var(--success-soft);color:var(--success);font-weight:650}
.growth-done:hover{color:var(--success);text-decoration:none}
/* layout: two columns on wide screens, one below 900px */
.growth-top2{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:14px}
.growth-split{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:14px;align-items:start}
.growth-split-cal{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}
.growth-col{display:flex;flex-direction:column;gap:14px;min-width:0}
/* the warm cards (the streak, the level): the one tinted surface of a page */
.growth-warm{padding:16px 18px;border-radius:var(--radius);background:var(--brand-soft);color:color-mix(in srgb,var(--brand) 55%,var(--text))}
.growth-warm-line{display:flex;align-items:center;gap:6px;margin:0;font-size:var(--font-size-sm)}
.growth-warm-line svg{width:16px;height:16px;flex:none}
.growth-warm .growth-go{box-shadow:none}
.growth-streak-num{display:flex;align-items:baseline;gap:8px;margin-top:12px;color:color-mix(in srgb,var(--brand) 35%,var(--text))}
.growth-streak-num svg{width:22px;height:22px;align-self:center;color:var(--brand)}
.growth-streak-num b{font-size:2rem;font-weight:600;line-height:1}
.growth-streak-num span{font-size:var(--font-size-sm)}
.growth-steps{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin-top:14px}
.growth-seg{text-align:center;font-size:var(--font-size-xs);line-height:1.3}
.growth-seg i{display:block;height:6px;margin-bottom:5px;border-radius:3px;background:color-mix(in srgb,var(--brand) 22%,transparent)}
.growth-seg.on i{background:var(--brand)}
.growth-seg span{display:inline-flex;align-items:center;gap:2px}
.growth-seg svg{width:12px;height:12px}
.growth-level-top{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.growth-level-top b{font-size:1.75rem;font-weight:600;line-height:1;color:color-mix(in srgb,var(--brand) 35%,var(--text))}
.growth-level-top small{margin-inline-start:auto;font-size:var(--font-size-xs)}
.growth-warm-bar{height:8px;margin:14px 0 6px;border-radius:4px;background:color-mix(in srgb,var(--brand) 22%,transparent);overflow:hidden}
.growth-warm-bar i{display:block;height:100%;border-radius:inherit;background:var(--brand)}
.growth-level p{margin:0;font-size:var(--font-size-xs)}
/* my card and the three numbers (overview) */
.growth-me .card-body{display:flex;align-items:center;gap:14px;height:100%}
.growth-me-main{flex:1;min-width:0}
.growth-me-name{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.growth-me-name .user-link{font-size:var(--font-size-md);font-weight:600}
.growth-lvtag{padding:1px 8px;border:1px solid color-mix(in srgb,var(--brand) 40%,var(--line));border-radius:999px;color:var(--brand);font-size:var(--font-size-xs);font-weight:600;white-space:nowrap}
.growth-me-main small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-thin{display:block;height:6px;margin:10px 0 6px;border-radius:3px;background:var(--line);overflow:hidden}
.growth-thin i{display:block;height:100%;border-radius:inherit;background:var(--brand)}
.growth-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.growth-stats a{display:flex;flex-direction:column;gap:2px;padding:12px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);color:var(--text)}
.growth-stats a:hover{border-color:color-mix(in srgb,var(--brand) 40%,var(--line));text-decoration:none}
.growth-stats small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-stats b{font-size:var(--font-size-xl);font-weight:600;line-height:1.2}
/* today's tasks: one row each */
.growth-tasks{list-style:none;margin:0;padding:0}
.growth-task{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line-soft)}
.growth-task:last-child{border:0}
.growth-ic{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:var(--brand-soft);color:var(--brand)}
.growth-ic svg{width:16px;height:16px}
.growth-task-main{flex:1;min-width:0}
.growth-task-name{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px}
.growth-task-name a,.growth-task-name span{color:var(--text);font-weight:500}
.growth-task-name small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-task .growth-thin{margin:6px 0 0}
.growth-task-num{flex:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:3px;min-width:44px;color:var(--text-muted);font-size:var(--font-size-xs);font-variant-numeric:tabular-nums;white-space:nowrap}
.growth-task.is-done .growth-task-num{color:var(--brand);font-weight:600}
.growth-task-num svg{width:13px;height:13px}
.growth-tasks+.growth-chips{margin:0 0 6px 44px}
.growth-note{display:flex;align-items:center;gap:6px;margin:8px 0 0;color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-note svg{width:13px;height:13px;color:var(--brand)}
/* lists: top members, today's check-ins */
.growth-toplist .growth-n{width:18px}
.growth-n.top{color:var(--brand)}
.growth-page .growth-toplist li>b{color:var(--text-muted);font-weight:500}
.growth-toplist li.me .user-link{font-weight:600}
.growth-pts{padding:1px 8px;border-radius:999px;background:var(--brand-soft)}
/* overview lists */
.growth-box .card-head a{font-size:var(--font-size-sm)}
.growth-toplist,.growth-rows{list-style:none;margin:0;padding:0}
.growth-toplist li,.growth-rows li{display:flex;align-items:center;gap:9px;padding:6px 0;border-bottom:1px solid var(--line-soft)}
.growth-toplist li:last-child,.growth-rows li:last-child{border:0}
.growth-toplist li>b,.growth-rows li>b{margin-inline-start:auto;color:var(--brand);font-size:var(--font-size-sm);white-space:nowrap}
.growth-toplist .user-link{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.growth-who{display:flex;flex-direction:column;min-width:0}
.growth-who small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-earn-group{margin:14px 0 2px;color:var(--text-muted);font-size:var(--font-size-xs);font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.growth-earn-group:first-of-type{margin-top:4px}
.growth-earn-intro{margin:0 0 6px}
.growth-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:-6px}
.growth-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border:1px solid var(--line);border-radius:999px;color:var(--text);font-size:var(--font-size-xs)}
.growth-chip b{color:var(--brand)}
.growth-chip.ok{border-color:transparent;background:var(--success-soft);color:var(--success)}
.growth-chip svg{width:12px;height:12px}
a.growth-chip:hover{border-color:var(--brand);text-decoration:none}
.growth-more-list{list-style:none;margin:0;padding:0}
.growth-more-list li{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid var(--line-soft);font-size:var(--font-size-sm)}
.growth-more-list li:last-child{border:0}
.growth-more-list li b{margin-inline-start:auto;color:var(--brand)}
.growth-box .growth-earn-intro{margin:14px 0 0}
/* calendar: checked days tinted circles, today ringed (solid once checked in) */
.growth-cal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.growth-cal-head h3{margin:0;font-size:var(--font-size-md)}
.growth-cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px 4px;justify-items:center}
.growth-cal .wd{padding-bottom:2px;color:var(--text-subtle);font-size:var(--font-size-xs)}
.growth-cal .d{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;color:var(--text);font-size:var(--font-size-sm)}
.growth-cal .d.pad{visibility:hidden}
.growth-cal .d.on{background:var(--brand-soft);color:color-mix(in srgb,var(--brand) 55%,var(--text));font-weight:600}
.growth-cal .d.today{box-shadow:inset 0 0 0 1.5px var(--brand)}
.growth-cal .d.on.today{background:var(--brand);color:#fff;box-shadow:none}
.growth-cal .d.ahead{color:var(--text-subtle)}
.growth-cal-foot{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line-soft)}
.growth-cal-foot span{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-cal-foot svg{width:13px;height:13px}
/* leaderboards */
.growth-board-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.growth-board-head .tabs{margin:0}
.growth-board-sub{margin:-6px 0 0}
.growth-mine{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-size:var(--font-size-sm);font-weight:600}
.growth-mine svg{width:14px;height:14px}
.growth-podium{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.12fr) minmax(0,1fr);gap:14px;align-items:end;margin-top:26px}
.growth-top.r1,.growth-top.r2,.growth-top.r3{--tint:rgba(122,167,255,.16);--ring:#7aa7ff;--num:#4c7fe8;display:block;min-width:0;padding:44px 10px 18px;border:1px solid var(--line-soft);border-radius:16px;background:linear-gradient(180deg,var(--tint) 0%,var(--panel) 100%);text-align:center}
.growth-top.r1{--tint:rgba(255,178,36,.2);--ring:#f5a623;--num:#e8641c;padding-top:50px;transform:translateY(-14px)}
.growth-top.r3{--tint:rgba(240,138,155,.16);--ring:#f08a9b;--num:#e2576f}
.growth-top.empty{min-height:110px;border-style:dashed;background:none}
.growth-top.me{box-shadow:0 0 0 2px var(--brand)}
.growth-pic{position:relative;display:inline-block;line-height:0}
.growth-crown{position:absolute;z-index:1;top:-28px;left:50%;width:40px;height:40px;transform:translateX(-50%);color:var(--ring);line-height:normal}
.growth-crown svg{width:40px;height:40px;fill:currentColor}
.growth-crown i{position:absolute;top:14px;left:0;right:0;color:#fff;font-size:12px;font-style:normal;font-weight:700;text-align:center}
.growth-top .avatar{width:72px;height:72px;font-size:28px;border:3px solid var(--ring)}
.growth-name{margin-top:10px;overflow:hidden;font-weight:600;white-space:nowrap;text-overflow:ellipsis}
.growth-val{margin-top:8px;color:var(--num);font-weight:700;font-size:1.15rem}
.growth-sub{margin-top:2px;overflow:hidden;color:var(--text-muted);font-size:var(--font-size-xs);white-space:nowrap;text-overflow:ellipsis}
.growth-table ol{list-style:none;margin:0;padding:4px 16px}
.growth-table li{padding:10px 0;border-bottom:1px solid var(--line-soft)}
.growth-table li:last-child{border:0}
.growth-table .growth-row{display:flex;align-items:center;gap:10px}
.growth-n{flex:none;width:28px;color:var(--text-subtle);font-weight:600;text-align:center}
.growth-table li.me{margin:0 -16px;padding-inline:16px;background:var(--brand-soft)}
.growth-table .growth-row>b{margin-inline-start:auto;white-space:nowrap}
/* levels: reached ones ticked, the current one tinted, the ones ahead as open circles */
.growth-ladder{list-style:none;margin:0 0 8px;padding:0}
.growth-ladder li{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:var(--radius-sm)}
.growth-ladder li>svg{flex:none;width:16px;height:16px;color:var(--text-subtle)}
.growth-ladder li.past>svg,.growth-ladder li.now>svg{color:var(--brand)}
.growth-ladder li b{font-weight:500}
.growth-ladder li .muted{margin-inline-start:auto;font-variant-numeric:tabular-nums}
.growth-ladder li.now{background:var(--brand-soft)}
.growth-ladder li.now b{font-weight:600}
.growth-ladder li.past .growth-pill{border-color:color-mix(in srgb,var(--brand) 40%,var(--line));color:var(--brand)}
.growth-ladder li.now .growth-pill{border-color:var(--brand);background:var(--brand);color:#fff}
/* sidebar card */
.growth-sidecard .card-head{gap:8px}
.growth-more{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;color:var(--text-muted)}
.growth-more:hover{background:var(--panel-2);color:var(--text)}
.growth-more svg{width:15px;height:15px}
.growth-card{display:flex;flex-direction:column;gap:10px}
.growth-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.growth-wd{display:flex;flex-direction:column;align-items:center;gap:5px}
.growth-wd i{color:var(--text-subtle);font-size:11px;font-style:normal;font-weight:500;line-height:1}
.growth-wd.today i{color:var(--brand);font-weight:700}
.growth-wd b{display:flex;align-items:center;justify-content:center;width:100%;max-width:26px;aspect-ratio:1;border:1px solid var(--line);border-radius:50%;background:var(--panel-2);color:#fff}
.growth-wd b.on{border-color:var(--brand);background:var(--brand)}
.growth-wd.today b:not(.on){border:2px dashed var(--brand);background:var(--brand-soft)}
.growth-wd b.ahead{opacity:.45}
.growth-wd b svg{width:12px;height:12px;stroke-width:3}
.growth-inline{margin:0}
.growth-card .growth-go,.growth-card .growth-done{width:100%}
/* in the sidebar the check-in is the second action: soft, so New Topic in the member card above stays the one solid button */
.growth-card .growth-go{background:var(--brand-soft);color:var(--brand);box-shadow:none}
.growth-card .growth-go:hover{background:color-mix(in srgb,var(--brand) 18%,var(--panel));color:var(--brand)}
.growth-card .growth-go b{background:color-mix(in srgb,var(--brand) 16%,transparent)}
.growth-hint{margin:0;color:var(--text-muted);font-size:var(--font-size-xs);text-align:center}
/* the streak line in the account dropdown menu: smaller, just "N days in a row" with the flame icon */
.um-action[data-action="checkin"]{font-size:var(--font-size-sm)}
.growth-lv{display:block;padding-top:10px;border-top:1px solid var(--line-soft);color:var(--text)}
.growth-lv:hover{text-decoration:none}
.growth-card.just-done .growth-done{animation:growth-pop .4s ease}
@keyframes growth-pop{0%{transform:scale(.9)}60%{transform:scale(1.04)}100%{transform:scale(1)}}
@media (prefers-reduced-motion:reduce){.growth-card.just-done *{animation:none}}
@media (max-width:900px){.growth-top2,.growth-split,.growth-split-cal{grid-template-columns:minmax(0,1fr)}.growth-split-cal>.growth-col{order:-1}}
@media (max-width:640px){
.growth-head h1{font-size:var(--font-size-xl)}
.growth-head{flex-wrap:nowrap;flex-direction:column;align-items:stretch}
.growth-tabs{width:100%;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
.growth-tabs .tab{flex:none}
.growth-stats{gap:8px}
.growth-stats a{padding:10px 12px}
.growth-stats b{font-size:var(--font-size-lg)}
.growth-cal .d{width:100%;max-width:38px;height:auto;aspect-ratio:1}
.growth-tasks+.growth-chips{margin-inline-start:0}
.growth-podium{gap:8px;margin-top:22px}
.growth-top.r1,.growth-top.r2,.growth-top.r3{padding:30px 6px 12px;border-radius:12px}
.growth-top.r1{padding-top:34px;transform:translateY(-10px)}
.growth-top .avatar{width:52px;height:52px;font-size:20px;border-width:2px}
.growth-crown{top:-20px;width:28px;height:28px}.growth-crown svg{width:28px;height:28px}.growth-crown i{top:9px;font-size:10px}
.growth-name{font-size:var(--font-size-sm)}
.growth-val{font-size:var(--font-size-md)}
}
/* the Leaderboard card of the right column (board.php): a segmented switch, then the top members of the board */
.growth-topcard .card-body{padding-top:4px}
.growth-top-tabs{display:flex;gap:2px;margin:0 0 6px;padding:3px;border-radius:9px;background:var(--panel-2)}
.growth-top-tab{flex:1;min-width:0;padding:5px 2px;border:0;border-radius:7px;background:none;color:var(--text-muted);font:inherit;font-size:var(--font-size-xs);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.growth-top-tab:hover{color:var(--text)}
.growth-top-tab.active{background:var(--panel);color:var(--text);font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.growth-top-list{list-style:none;margin:0;padding:0}
.growth-top-list[hidden]{display:none}
.growth-top-list li{display:flex;align-items:center;gap:9px;padding:6px 2px;font-size:var(--font-size-sm)}
.growth-top-list .avatar{width:26px;height:26px;flex:none}
.growth-top-rank{display:inline-grid;place-items:center;width:20px;height:20px;flex:none;border-radius:50%;color:var(--text-subtle);font-size:11px;font-weight:700}
.growth-top-rank.r1{background:#fac775;color:#633806}.growth-top-rank.r2{background:#d3d1c7;color:#444441}.growth-top-rank.r3{background:#f0997b;color:#712b13}
.growth-top-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.growth-top-name .user-link{color:var(--text)}
.growth-top-value{display:inline-flex;align-items:center;gap:3px;flex:none;color:var(--text-muted);font-size:var(--font-size-xs);font-variant-numeric:tabular-nums}
.growth-top-value .icon{width:13px;height:13px;color:var(--brand)}
.growth-top-list li.me{margin:0 -6px;padding-inline:8px;border-radius:9px;background:var(--brand-soft)}
.growth-top-list li.growth-top-you{margin-top:4px}
.growth-top-list li.me .growth-top-name,.growth-top-list li.me .growth-top-value{color:var(--brand);font-weight:600}
.growth-top-empty{padding:8px 2px}
.growth-guest{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 24px}
.growth-guest-main{min-width:0}
.growth-guest h2{margin:0 0 6px;overflow-wrap:anywhere;font-size:var(--font-size-xl);color:var(--text)}
.growth-guest p{margin:0 0 16px;font-size:var(--font-size-sm)}
.growth-guest-btns{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.growth-guest-btns .btn{height:40px;border-radius:999px;padding:0 18px}
.growth-guest .growth-streak-num{flex:none;margin:0;flex-direction:column;align-items:center;gap:2px}
.growth-ways{list-style:none;margin:0;padding:0}
.growth-ways li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-top:1px solid var(--line-soft)}
.growth-ways li:first-child{border-top:0}
.growth-ways span{display:flex;flex-direction:column;min-width:0}
.growth-ways small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-ways b{color:var(--brand);font-weight:650}
@media (max-width:640px){.growth-guest{flex-direction:column;align-items:stretch;padding:18px}.growth-guest .growth-streak-num{flex-direction:row;align-items:baseline}}


/* guests */
.guests-reply{margin-block-start:16px}
.guests-identity{grid-template-columns:1fr 1fr;gap:12px}
.guests-captcha .check{display:inline-flex;gap:8px;align-items:center}
.guests-captcha-q{font-weight:600;white-space:nowrap}
.guests-flag{background:var(--brand-soft);color:var(--brand)}
/* Quote-preview banner — mirrors the core's "↩ @user cancel" bar that shows
   above the editor when a Reply button is clicked. Uses the theme's danger
   color (same as the core's reply-to banner), not a fixed red. */
.guests-reply-to{display:flex;align-items:center;gap:8px;margin-block-end:12px;padding:8px 12px;border-radius:var(--radius-sm);background:var(--danger-soft);color:var(--danger);font-size:var(--font-size-sm);font-weight:600}
.guests-reply-to[hidden]{display:none}
.guests-reply-to-text{flex:1;min-width:0}
.guests-reply-to-cancel{color:inherit;opacity:.7;font-weight:400}
.guests-reply-to-cancel:hover{opacity:1;text-decoration:none}
/* Guest posts: hide the Lv1 level badge and any other level/role badges
   (guests don't have levels). We hide every .flag, .badge, [class*="level"],
   [class*="lvl"] inside a guest post EXCEPT our own .guests-flag.
   Also make the username link non-interactive (the profile is a stub). */
.post:has(.guests-flag) .flag:not(.guests-flag),
.post:has(.guests-flag) .badge:not(.guests-flag),
.post:has(.guests-flag) [class*="level"]:not(.guests-flag),
.post:has(.guests-flag) [class*="lvl"]:not(.guests-flag){display:none !important}
.post:has(.guests-flag) .user-link{pointer-events:none;cursor:default;text-decoration:none}

/* image_gallery */
/* ============================================================
   Image Gallery — assets/gallery.css
   Two parts:
     1. The grid (.imgallery) — wraps consecutive <img> tags inside
        a post into a responsive grid.
     2. The lightbox (.imgallery-lightbox) — a full-screen overlay
        with prev/next navigation, opened by clicking a gallery image.

   All colours come from the forum's CSS variables, so the gallery
   follows light/dark themes and any brand-colour override.
   ============================================================ */

/* ---------- 1. Grid ---------- */
[data-imgallery] {
  display: grid;
  grid-template-columns: repeat(var(--imgallery-cols, 2), 1fr);
  gap: 6px;
  margin: 12px 0;
  /* Cap each image's height so a row of three portraits doesn't push
     the rest of the topic down by 3000 pixels. */
  --imgallery-cell-h: 220px;
}

/* Column-count modifiers — set by the PHP hook based on image count.
   .imgallery-2 → two columns, .imgallery-3 → three, and so on up to 5. */
.imgallery-2 { --imgallery-cols: 2; }
.imgallery-3 { --imgallery-cols: 3; }
.imgallery-4 { --imgallery-cols: 4; --imgallery-cell-h: 180px; }
.imgallery-5 { --imgallery-cols: 5; --imgallery-cell-h: 160px; }

/* On small screens, cap the column count at 2 so thumbnails stay big enough to tap. */
@media (max-width: 540px) {
  [data-imgallery] { --imgallery-cols: 2 !important; --imgallery-cell-h: 140px; }
  .imgallery-2     { --imgallery-cols: 2 !important; }
}

[data-imgallery] img[data-imgallery-item] {
  width: 100%;
  height: var(--imgallery-cell-h);
  object-fit: cover;
  border-radius: var(--radius-sm, 8px);
  cursor: zoom-in;
  background: var(--panel-2, #f8f9fb);
  border: 1px solid var(--line-soft, #eff1f4);
  transition: transform .2s cubic-bezier(.22, .61, .2, 1), box-shadow .2s, filter .2s;
  display: block;
}

[data-imgallery] img[data-imgallery-item]:hover {
  transform: scale(1.008);
  box-shadow: var(--shadow-md);
  filter: brightness(1.05);
  z-index: 1;
}

[data-imgallery] img[data-imgallery-item]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* When images live inside the grid, the .post-image-max setting of the
   forum shouldn't make them tiny — override it for gallery items only. */
.post-content [data-imgallery] img[data-imgallery-item] {
  max-width: none;
}

/* ---------- 1b. Single-image gallery ---------- */
/* A post whose body is a single image gets wrapped in a one-cell
   gallery so it can open the lightbox, but the image should NOT be
   shrunk to a thumbnail — it keeps its natural display size and
   only becomes clickable (cursor: zoom-in, inherited above). */
.imgallery-single {
  display: block;
  grid-template-columns: none;
  gap: 0;
  --imgallery-cell-h: auto;
}

.imgallery-single img[data-imgallery-item] {
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  /* Keep a subtle border so the clickable region is visible even
     when the image is transparent / has white background. */
  background: var(--panel-2, #f8f9fb);
}

/* Single images should respect the post's normal image max width —
   they are NOT exempt like grid thumbnails. This overrides the
   .post-content [data-imgallery] img { max-width: none } rule above
   for the single-image case only. (Same specificity, later in the
   file, so it wins.) */
.post-content .imgallery-single img[data-imgallery-item] {
  max-width: 100%;
}

/* On small screens the single image still displays at its natural
   size, capped to the viewport width. */
@media (max-width: 540px) {
  .imgallery-single img[data-imgallery-item] {
    max-width: 100%;
  }
}

/* ---------- 2. Lightbox ---------- */
[data-imgallery-lightbox] {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 10, 14, .92);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: imgallery-fade-in .25s cubic-bezier(.22, .61, .2, 1);
}

[data-imgallery-lightbox][hidden] {
  display: none;
}

@keyframes imgallery-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* The big image */
.imgallery-stage {
  margin: 0;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imgallery-stage img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
  animation: imgallery-zoom-in .25s cubic-bezier(.22, .61, .2, 1);
}

@keyframes imgallery-zoom-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Caption (the image's alt text, if any) */
.imgallery-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80vw;
  padding: 6px 14px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: var(--font-size-sm, 12px);
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.imgallery-caption:empty { display: none; }

/* Counter ("3 / 7") */
.imgallery-counter {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: var(--font-size-xs, 11px);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.imgallery-counter:empty { display: none; }

/* Close button (top-right) */
.imgallery-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s, transform .15s;
}
.imgallery-close:hover {
  background: rgba(255, 255, 255, .18);
  transform: scale(1.05);
}
.imgallery-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Prev / next buttons (vertically centred on each side) */
.imgallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s, transform .15s;
}
.imgallery-nav:hover {
  background: rgba(255, 255, 255, .18);
}
.imgallery-prev:hover { transform: translateY(-50%) scale(1.05) translateX(-2px); }
.imgallery-next:hover { transform: translateY(-50%) scale(1.05) translateX(2px); }
.imgallery-nav svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; }

.imgallery-prev { inset-inline-start: 16px; }
.imgallery-next { inset-inline-end: 16px; }

/* On small screens, move the prev/next buttons to the bottom and make
   them bigger so they're easy to tap. */
@media (max-width: 540px) {
  [data-imgallery-lightbox] { padding: 12px; }
  .imgallery-stage,
  .imgallery-stage img { max-width: 95vw; max-height: 70vh; }
  .imgallery-nav {
    top: auto;
    bottom: 24px;
    transform: none;
    width: 56px;
    height: 56px;
  }
  .imgallery-prev:hover,
  .imgallery-next:hover { transform: scale(1.05); }
  .imgallery-prev { inset-inline-start: 16px; }
  .imgallery-next { inset-inline-end: 16px; }
  .imgallery-caption { bottom: 90px; }
  .imgallery-close { width: 36px; height: 36px; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  [data-imgallery-lightbox],
  .imgallery-stage img,
  [data-imgallery] img[data-imgallery-item] {
    animation: none !important;
    transition: none !important;
  }
}

/* Print: hide the lightbox; galleries print as simple image grids. */
@media print {
  [data-imgallery-lightbox] { display: none !important; }
  [data-imgallery] img[data-imgallery-item] { height: auto; cursor: default; }
}


/* latest_comments */
.latest-comments-list{display:flex;flex-direction:column;gap:0}
.latest-comments-item{display:flex;flex-direction:column;gap:4px;padding:10px 0;border-bottom:1px solid var(--line-soft,var(--line))}
.latest-comments-item:first-child{padding-top:0}
.latest-comments-item:last-child{border-bottom:none;padding-bottom:0}
.latest-comments-head{display:flex;align-items:center;gap:6px;min-width:0}
.latest-comments-user{font-size:var(--font-size-sm);font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.latest-comments-user .user-link{color:var(--text)}
.latest-comments-time{margin-inline-start:auto;flex:none;color:var(--text-subtle);font-size:var(--font-size-xs)}
.latest-comments-topic{display:flex;align-items:center;gap:4px;font-size:var(--font-size-sm);color:var(--text-subtle);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.latest-comments-topic .icon{flex:none;width:13px;height:13px;color:var(--text-subtle)}
.latest-comments-topic span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.latest-comments-body{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:var(--font-size-md);line-height:1.45;color:var(--text-muted,var(--text));transition:color .15s}
.latest-comments-body:hover{color:var(--brand-hover,var(--brand))}
@media (max-width: 640px) {
  /* 2. Scale up discussion/post contents so they are super readable on mobile */
  .latest-comments-body {
    font-size:14.5px!important;
    line-height: 1.5!important;
  }

  /* 3. Slightly larger row titles in topic lists */
  .latest-comments-topic {
    font-size: 15px!important;
  }
}
.latest-comments-no-avatar{display:inline-block;width:24px;height:24px;border-radius:50%;background:var(--panel-2,var(--panel));border:1px solid var(--line)}
[dir="rtl"] .latest-comments-time{margin-inline-start:0;margin-inline-end:auto}

/* mad_mascot */
.logo-image {
    position: relative !important;
    overflow: hidden !important;
    display: inline-flex !important;
    align-items: flex-end;
}

#character-sensor {
    position: absolute;
    bottom: 0px; 
    left: 176px; 
    z-index: 2; 
    cursor: pointer;
    transition: left 0.1s; 
    overflow: hidden; 
    width: 45px;
    height: 100%;
}

#hiding-character {
    width: 100%;
    height: 100%;
    opacity: 1; 
    transform: translateY(100px); 
    transition: transform 2.0s ease-out; 
    pointer-events: none; 
}

#hiding-character.visible {
    transform: translateY(0);
}

#hiding-character.scared {
    opacity: 0;
    transform: translateY(100px); 
    transition: transform 0.15s ease-in, opacity 0.15s ease-in;
}

#hiding-character img {
    max-height: 45px !important;
    width: auto;
    display: block;
    box-shadow: none;
    position: absolute;
    bottom: 0;
    left: 0;
}

.logo-img {
    position: relative !important;
    z-index: 1 !important;
}

/* Explicit fallback media query for screens under 640px */
@media (max-width: 640px) {
    #character-sensor {
        display: none !important;
    }
}

/* market */
.market-filter-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}.market-filter-row .tabs{margin:0}.market-search{margin-inline-start:auto;width:200px;height:32px;padding:0 10px}.market-search input{font-size:var(--font-size-sm)}.market-filter-row .icon-btn{width:32px;height:32px}.market-cat-form select{width:auto;max-width:220px;height:32px;padding:0 8px;font-size:var(--font-size-sm)}@media(max-width:640px){.market-search{width:100%;margin-inline-start:0;order:2}.market-filter-row .icon-btn{order:3}}.market-connect{padding:18px 16px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel-2);text-align:center}.market-connect p:first-child{max-width:520px;margin:0 auto 12px}.market-connect .btn-lg{margin:4px 0 8px}.market-token-fold{margin-top:14px}.market-token-fold summary{cursor:pointer}.market-token-fold .admin-form{margin-top:10px}@media(max-width:640px){.plugin-item{flex-direction:column;gap:10px}.plugin-ops{justify-content:flex-start}.market-account-card .btn-row{margin-inline-start:0}.admin-toolbar form.inline{margin:0}}.market-other{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;margin:0 0 14px;border-radius:var(--radius-sm);background:var(--warning-soft,var(--info-soft));color:var(--text)}.market-other svg{width:20px;height:20px;flex:none;margin-top:2px;color:var(--warning,var(--info))}.market-other p{margin:0 0 6px}.market-other-stop{background:var(--danger-soft)}.market-other-stop svg{color:var(--danger)}.market-tabs{margin-bottom:12px}.market-free{background:var(--success-soft,#dcfce7);color:var(--success,#15803d)}.market-paid{background:#fff1e6;color:#c2410c}[data-theme=dark] .market-paid{background:rgba(194,65,12,.25);color:#fdba74}.market-account{display:inline-flex;align-items:center;gap:6px;margin-inline-start:auto;color:var(--text-muted);font-size:var(--font-size-sm);white-space:nowrap}.market-account svg{width:16px;height:16px}.market-account b{color:var(--text)}.market-account-card{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel-2)}.market-account-card>svg{width:28px;height:28px;color:var(--brand);flex:none}.market-account-card>div:first-of-type{flex:1;min-width:200px}.market-account-card .btn-row{margin-inline-start:auto}.plugin-ops small{display:block;text-align:right;margin-top:4px}.plugin-ops .btn[disabled]{opacity:.5;cursor:default}.market-foot{margin-top:14px}.market-theme-blank{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--text-subtle)}.market-theme-blank .icon{width:40px;height:40px}.market-theme-badges{margin:2px 0}.theme-ops small{display:block;width:100%}.market-publish-themes{margin-top:18px;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel-2)}.market-publish-themes h3{margin:0 0 4px;font-size:var(--font-size-md)}.market-publish-themes p{margin:0}.market-publish-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.market-publish-list .muted{font-weight:400}

/* market */
.market-shots-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:8px}.market-shot{position:relative;aspect-ratio:3/2;border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden;background:var(--panel-2);user-select:none;-webkit-user-select:none}.market-shot img{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none;-webkit-user-drag:none}.market-shots.is-js .market-shot{cursor:grab}.market-shot.is-dragging{opacity:.45;pointer-events:none;outline:2px dashed var(--brand);outline-offset:-2px}.market-shots.is-sorting,.market-shots.is-sorting *{cursor:grabbing}.market-shot:first-child{border:2px solid var(--brand)}.market-shot-cover{display:none;position:absolute;left:5px;bottom:5px;padding:1px 7px;border-radius:4px;background:var(--brand);color:var(--brand-text,#fff);font-size:11px;font-weight:600;line-height:1.5}.market-shot:first-child .market-shot-cover{display:block}.market-shot-x,.market-shot-grip{position:absolute;top:5px;display:flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:0;border-radius:50%;background:rgba(0,0,0,.62);color:#fff;font-size:16px;line-height:1;cursor:pointer}.market-shot-x{right:5px}.market-shot-x:hover{background:var(--danger,#dc2626)}.market-shot-grip{left:5px;cursor:grab;touch-action:none}.market-shot-grip:hover{background:rgba(0,0,0,.8)}.market-shot-x:focus-visible,.market-shot-grip:focus-visible{outline:2px solid var(--brand);outline-offset:1px}.market-shot-keep{position:absolute;left:5px;top:5px;display:flex;gap:4px;align-items:center;margin:0;padding:1px 6px;border-radius:4px;background:var(--panel);font-size:var(--font-size-xs)}.market-shots.is-js .market-shot-keep,.market-shots:not(.is-js) .market-shot-x,.market-shots:not(.is-js) .market-shot-grip{display:none}.market-shot-add{position:relative;aspect-ratio:3/2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;margin:0;border:1px dashed var(--text-subtle);border-radius:var(--radius-sm);color:var(--text-muted);font-size:var(--font-size-sm);font-weight:500;cursor:pointer}.market-shot-add:hover{border-color:var(--brand);color:var(--brand);background:var(--brand-soft)}.market-shot-add .icon{width:20px;height:20px}.market-shot-add[hidden],.market-shots-error[hidden]{display:none}.market-shots.is-js .market-shot-add input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.market-shots:not(.is-js) .market-shot-add{grid-column:1/-1;aspect-ratio:auto;align-items:stretch;border:0;cursor:default}.market-shots:not(.is-js) .market-shot-add .icon,.market-shots:not(.is-js) .market-shot-add span{display:none}.market-shots-error{margin:6px 0 0;color:var(--danger,#dc2626);font-size:var(--font-size-sm)}

/* messages */
.page-messages .layout-main{max-width:100%!important;padding:0!important}
.chat{--chat-bg:var(--panel-2);display:grid;grid-template-columns:340px 1fr;height:min(80vh,880px);min-height:460px;overflow:hidden;background:var(--panel);border:1px solid var(--line);border-radius:14px}
.chat .avatar{flex-shrink:0;border-radius:50%}
.chat span.avatar,.chat div.avatar{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;font-weight:700;display:flex;align-items:center;justify-content:center}
/* list */
.chat-list{border-inline-end:1px solid var(--line);overflow-y:auto;background:var(--panel);scrollbar-width:thin}
.chat-list-head{position:sticky;top:0;z-index:2;padding:14px 16px 12px;background:var(--panel);border-bottom:1px solid var(--line)}
.chat-list-head h3{margin:0;font-size:19px;font-weight:700;color:var(--text)}
.chat-search{display:block;width:100%;margin-top:10px;padding:9px 16px;border:1px solid transparent;border-radius:20px;background:var(--panel-2);color:var(--text);font:inherit;font-size:14px;transition:border-color .15s,background .15s}
.chat-search:focus{outline:none;border-color:var(--brand);background:var(--panel)}
.chat-item{display:flex;gap:12px;align-items:center;padding:10px 14px;color:inherit;text-decoration:none;transition:background .12s}
.chat-item[hidden]{display:none}
.chat-item:hover{background:var(--panel-2);text-decoration:none}
.chat-item.active{background:var(--brand-soft)}
.chat-item-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.chat-item-top,.chat-item-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px}
.chat-item-top b{font-size:15px;font-weight:600;color:var(--text);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
.chat-item-top time{font-size:12px;color:var(--text-muted);white-space:nowrap}
.chat-item-last{flex:1;min-width:0;font-size:13.5px;color:var(--text-muted);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
.chat-item-last em{font-style:italic}
.chat-item.unread .chat-item-last{color:var(--text)}
.chat-item.unread .chat-item-top time{color:var(--brand);font-weight:600}
.chat-badge{min-width:21px;height:21px;padding:0 6px;border-radius:11px;background:var(--brand);color:#fff;font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.chat-item-last .chat-tick{margin-inline-end:4px;vertical-align:-1px;color:var(--text-muted)}
.chat-item-last .chat-tick.is-read{color:var(--brand)}
/* pane and header */
.chat-pane{display:flex;flex-direction:column;min-width:0;min-height:0;position:relative;overflow:hidden}
.chat-head{display:flex;align-items:center;gap:12px;padding:8px 14px;border-bottom:1px solid var(--line);background:var(--panel);flex-shrink:0;position:relative;z-index:3}
.chat-back{display:none;color:inherit;width:36px;height:36px;border-radius:50%;align-items:center;justify-content:center}
.chat-back:hover{background:var(--panel-2)}
.chat-who{display:flex;flex-direction:column;min-width:0;line-height:1.25;flex:1;}
.chat-who a{font-size:15.5px;font-weight:600;color:var(--text);text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
.chat-who a:hover{text-decoration:underline}
.chat-who small{color:var(--text-muted);font-size:12.5px;margin-top:2px}
.chat-who small.is-online{color:var(--brand)}
.chat-menu{position:relative}
.chat-menu-btn{list-style:none;display:flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:50%;color:var(--text-muted);cursor:pointer;transition:background .12s}
.chat-menu-btn::-webkit-details-marker{display:none}
.chat-menu-btn:hover,.chat-menu[open] .chat-menu-btn{background:var(--panel-2);color:var(--text)}
.chat-menu-pop{position:absolute;inset-inline-end:0;top:calc(100% + 6px);min-width:180px;padding:6px;background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 28px rgba(0,0,0,.16);z-index:10}
.chat-menu-pop form{display:block;margin:0}
.chat-menu-item{display:block;width:100%;text-align:start;padding:10px 12px;border:0;border-radius:8px;background:none;color:var(--text);font:inherit;font-size:14px;cursor:pointer}
.chat-menu-item:hover{background:var(--panel-2)}
.chat-menu-item.is-danger{color:#d32f2f}
.chat-more{text-align:center;color:var(--text-muted);font-size:12.5px;padding:6px 0;font-weight:500}
/* log: my messages on the right, theirs on the left, whatever the page direction */
.chat-log{background-color:var(--chat-bg);background-image:radial-gradient(circle at 15% 12%,rgba(127,127,127,.07) 0,transparent 38%),radial-gradient(circle at 85% 88%,rgba(127,127,127,.07) 0,transparent 38%);flex:1;min-height:0;overflow-y:scroll;padding:14px 20px;display:flex;flex-direction:column;gap:8px;scrollbar-width:thin;scrollbar-color:var(--line) transparent;direction:ltr;overscroll-behavior:contain}
.chat-log::-webkit-scrollbar{width:5px}.chat-log::-webkit-scrollbar-thumb{background:var(--line);border-radius:3px}
.chat-day{text-align:center;margin:10px 0 4px;position:sticky;top:0;z-index:1}
.chat-day span{display:inline-block;padding:4px 12px;background:rgba(127,127,127,.22);color:var(--text);border-radius:12px;font-size:12px;font-weight:600;backdrop-filter:blur(4px)}
.chat-msg{display:flex;align-items:flex-end;gap:8px;max-width:100%}
.chat-msg.me{justify-content:flex-end}
.chat-msg.me+.chat-msg.me,.chat-msg:not(.me)+.chat-msg:not(.me){margin-top:-5px}
/* bubbles with a tail on the last one of a run */
.bubble{max-width:min(70%,560px);padding:8px 12px 7px;border-radius:18px 18px 18px 5px;line-height:1.55;font-size:14.5px;position:relative;overflow-wrap:anywhere;background:var(--panel);color:var(--text);box-shadow:0 1px 1px rgba(0,0,0,.08);text-align:start}
.chat-msg.me .bubble{background:var(--brand);color:#fff;border-radius:18px 18px 5px 18px}
.chat-msg:not(.me):not(.chat-recalled):has(+ .chat-msg:not(.me):not(.chat-recalled)) .bubble{border-bottom-left-radius:18px}
.chat-msg.me:has(+ .chat-msg.me) .bubble{border-bottom-right-radius:18px}
.bubble .post-content{display:inline;line-height:1.55}
.bubble .post-content p{display:inline;margin:0}
.bubble .post-content p+p::before{content:"\A";white-space:pre}
.bubble a{text-decoration:underline}
.chat-msg.me .bubble a{color:#e3f2fd}
.chat-meta{display:inline-flex;align-items:center;gap:4px;margin-inline-start:10px;white-space:nowrap;font-weight:500;font-size:11px;color:var(--text-muted);vertical-align:bottom;position:relative;top:3px;opacity:.85}
.chat-msg.me .chat-meta{color:rgba(255,255,255,.82)}
.chat-edited{font-style:italic;font-size:10.5px}
.chat-tick{display:inline-flex;line-height:0}
.chat-tick svg{width:14px;height:10px}
.chat-tick .chat-tick-2{display:none}
.chat-tick.is-read .chat-tick-2{display:inline}
.chat-msg.me .chat-meta:has(.is-read){opacity:1}
.chat-clock svg{width:12px;height:12px}
.chat-pending .bubble{opacity:.72;white-space:pre-wrap}
/* tools on my own message */
.chat-tools{display:none;gap:4px}
.chat-msg.me:hover .chat-tools,.chat-msg.show-tools .chat-tools,.chat-tools:focus-within{display:inline-flex}
.chat-tool{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;border-radius:50%;background:var(--panel);color:var(--text-muted);cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.15);transition:transform .12s}
.chat-tool:hover{color:var(--text);transform:scale(1.08)}
.chat-tool svg{width:14px;height:14px}
.chat-recalled{justify-content:center}
.chat-note{padding:4px 12px;border-radius:12px;background:rgba(127,127,127,.2);color:var(--text);font-size:12.5px;font-weight:500;text-align:center}
/* new messages slide in */
@keyframes chat-pop{from{opacity:0;transform:translateY(10px) scale(.96)}to{opacity:1;transform:none}}
.chat-new{animation:chat-pop .18s ease-out}
.chat-msg.me.chat-new{transform-origin:100% 100%}
.chat-msg.chat-new:not(.me){transform-origin:0 100%}
@media (prefers-reduced-motion:reduce){.chat-new{animation:none}}
/* jump to the latest message */
.chat-jump{position:absolute;inset-inline-end:16px;z-index:4;width:42px;height:42px;border-radius:50%;border:1px solid var(--line);background:var(--panel);color:var(--text-muted);box-shadow:0 3px 10px rgba(0,0,0,.18);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .12s}
.chat-jump[hidden]{display:none}
.chat-jump:hover{color:var(--text);transform:translateY(-1px)}
.chat-jump-n{position:absolute;top:-7px;inset-inline-start:-4px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:var(--brand);color:#fff;font-size:11.5px;font-weight:700;display:flex;align-items:center;justify-content:center}
.chat-jump-n[hidden]{display:none}
/* input */
.chat-editing{display:flex;align-items:center;gap:10px;padding:8px 16px;border-top:1px solid var(--line);background:var(--panel);color:var(--text-muted);font-size:13px;font-weight:500}
.chat-editing svg{width:15px;height:15px;color:var(--brand)}
.chat-editing span{flex:1}
.chat-editing[hidden]{display:none}
.chat-editing+.chat-input{border-top:0}
.chat-input{display:flex;gap:10px;padding:10px 14px;border-top:1px solid var(--line);align-items:flex-end;background:var(--panel);flex-shrink:0}
.chat-input.muted{justify-content:center;padding:16px;font-size:14px}
.chat-input textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 11px 18px; border: 2px solid transparent;font: inherit; font-size: 15px; background: var(--panel-2); color: var(--text); line-height: 1.5; transition: border-color .15s, background .15s; }
.chat-input textarea:focus { outline: none; border-color: var(--brand); }
.chat-input textarea::placeholder{color:var(--text-muted)}
.chat-send{flex-shrink:0;width:44px;height:44px;padding:0;border-radius:50%;border:0;background:var(--brand);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:.45;transform:scale(.92);transition:opacity .15s,transform .15s}
.chat-input.has-text .chat-send{opacity:1;transform:none}
.chat-send:active{transform:scale(.94)}
.chat-empty{padding:50px 20px;text-align:center;color:var(--text-muted);display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100%}
.chat-empty svg{width:50px;height:50px;margin-bottom:14px;opacity:.3}
.chat-empty p{margin:0;font-size:14px;font-weight:500}
.chat-none .chat-empty{margin:auto}
/* phones: an open chat fills the screen */
@media (max-width:760px){
.chat{grid-template-columns:1fr;height:100vh;border:0;border-radius:0}
.chat:not(.chat-open) .chat-list{overflow:visible}
.chat-open .chat-list{display:none}
.chat:not(.chat-open) .chat-pane{display:none}
.chat-open{position:fixed;left:0;right:0;top:0;z-index:85;height:100vh;height:100dvh;height:var(--chat-vh,100dvh)}
.chat-back{display:flex}
.chat-log{padding:12px 12px calc(12px + env(safe-area-inset-bottom))}
.chat-open .bubble{max-width:82%}
body.page-messages-chat,.body.page-messages-chat{overflow:hidden}
.chat-input{padding:8px 10px calc(8px + env(safe-area-inset-bottom))}
.chat-input textarea{font-size:16px}
.chat-msg.me:hover .chat-tools{display:none}
.chat-msg.show-tools .chat-tools{display:inline-flex}
}

/* nsfw */
.nsfw-badge{display:inline-block;margin-inline-start:4px;padding:0 6px;border-radius:4px;background:#e0245e;color:#fff;font-size:10px;font-weight:700;letter-spacing:.3px;line-height:1.7;vertical-align:middle}.topic-title .nsfw-badge{font-size:12px;line-height:1.8;padding:0 8px}.nsfw-row.is-promoted{margin:0 0 10px;padding:8px 10px;border:1px solid rgba(224,36,94,.35);border-radius:6px;background:rgba(224,36,94,.04)}.nsfw-row.is-promoted .form-help{margin-top:2px;color:#666;font-size:12px}.nsfw-hidden-pill{display:inline-block;padding:0 6px;border-radius:4px;background:#6b7280;color:#fff;font-size:10px;font-weight:700;letter-spacing:.3px;line-height:1.7;vertical-align:middle}

/* pages */
.pages-page h1{margin-bottom:4px}.pages-page .post-content{margin-top:16px}.pages-page .post-content h2{margin-top:26px}.pages-page .post-content h3{margin-top:18px}

/* reactions */
.card-reactions-top .card-body {padding-top: 4px;}
.reactions{display:flex;align-items:center;gap:3px;flex-wrap:wrap;margin-top:10px;position:relative}
.reactions-pills{display:flex;align-items:center;gap:4px;flex-wrap:wrap;min-width:0}
.reactions-pill{display:inline-flex;align-items:center;gap:4px;padding:3px 8px 3px 5px;border-radius:999px;background:var(--panel-2,var(--panel));border:1px solid var(--line-soft,var(--line));cursor:pointer;font-size:var(--font-size-xs);line-height:1.4;color:var(--text);user-select:none;transition:background .12s,border-color .12s,transform .12s}
.reactions-pill:hover{background:var(--brand-soft,var(--panel));border-color:var(--brand)}
.reactions-pill:active{transform:scale(.94)}
.reactions-pill.active{background:var(--brand-soft,var(--panel));border-color:var(--brand);color:var(--brand-hover,var(--brand))}
.reactions-pill[aria-disabled="true"]{cursor:default;opacity:.85}
.reactions-pill[aria-disabled="true"]:hover{background:var(--panel-2,var(--panel));border-color:var(--line-soft,var(--line))}
.reactions-count{font-variant-numeric:tabular-nums;font-weight:600;color:var(--text-muted,var(--text))}
.reactions-pill.active .reactions-count{color:var(--brand-hover,var(--brand))}

.reactions-more{display:inline-flex;align-items:center}
.reactions-more>summary{list-style:none;cursor:pointer;font-size:var(--font-size-xs);color:var(--text-subtle);padding:3px 6px;border-radius:999px;user-select:none}
.reactions-more>summary::-webkit-details-marker{display:none}
.reactions-more>summary:hover{color:var(--brand-hover,var(--brand));text-decoration:underline}
.reactions-more[open]>summary{color:var(--brand)}
.reactions-more-list{display:inline-flex;align-items:center;gap:4px;flex-wrap:wrap}

.reactions-add{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px solid var(--line-soft,var(--line));background:transparent;color:var(--text-muted);cursor:pointer;padding:0;transition:background .12s,border-color .12s,color .12s,transform .12s}
.reactions-add:hover{background:var(--brand-soft,var(--panel));border-color:var(--brand);color:var(--brand-hover,var(--brand))}
.reactions-add:active{transform:scale(.92)}
.reactions-add svg{width:16px;height:16px}
.reactions-add[aria-expanded="true"]{background:var(--brand-soft,var(--panel));border-color:var(--brand);color:var(--brand-hover,var(--brand))}

.reactions-picker{position:absolute;top:calc(100% + 4px);inset-inline-start:0;z-index:50;min-width:200px;max-width:min(90vw,320px);padding:6px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);animation:reactions-pop .12s ease-out}
.reactions-picker[hidden]{display:none}
.reactions-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(32px,1fr));gap:2px}
.reactions-picker-item{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:var(--radius-sm);cursor:pointer;font-size:20px;line-height:1;padding:0;transition:background .1s,transform .1s}
.reactions-picker-item:hover{background:var(--panel-2,var(--panel));transform:scale(1.15)}
.reactions-picker-item.active{background:var(--brand-soft,var(--panel));box-shadow:inset 0 0 0 2px var(--brand)}

@keyframes reactions-pop{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}

/* RTL: nothing direction-specific here (we use inset-inline-start), but keep
   the picker anchored to the start edge in RTL too. */
[dir="rtl"] .reactions-picker{inset-inline-start:0;inset-inline-end:auto}

/* Reduced motion */
@media (prefers-reduced-motion:reduce){
  .reactions-pill,.reactions-add,.reactions-picker-item,.reactions-picker{transition:none;animation:none}
}

/* Topic-list reactions bar — same .reactions markup as in-topic, but placed
   in the title_suffix region under the topic's excerpt. We just trim the
   default margin-top a bit so it doesn't push too hard against the excerpt
   above, and add a small bottom margin so the meta row below has air. */
.reactions-topic-list-bar .reactions,
.reactions-topic-list-bar.reactions{margin-top:6px;margin-bottom:2px}

/* Mobile: even tighter, since the topic row is denser on narrow screens. */
@media (max-width:640px){
  .reactions-topic-list-bar .reactions,
  .reactions-topic-list-bar.reactions{margin-top:4px}
}

/* When xstyle is enabled, our JS moves the .reactions-topic-list-bar
   wrapper from .row-title INTO xstyle's .xstyle-body, right before
   .xstyle-actions. We give the wrapper a bit of vertical breathing room
   so it sits between the post content (excerpt + media) and the actions
   row without crowding either; the inner .reactions then needs no extra
   margin of its own. The selector is scoped to .xstyle-body so it only
   applies in xstyle context — the no-xstyle case keeps the rules above. */
.xstyle-body > .reactions-topic-list-bar,.xmad-body > .reactions-topic-list-bar{margin-top:10px;margin-bottom:8px}
.xstyle-body > .reactions-topic-list-bar .reactions,.xmad-body > .reactions-topic-list-bar .reactions{margin-top:0;margin-bottom:0}

/* Reactions sidebar widget (Latest + Top tabs) */
.reactions-top-list{display:flex;flex-direction:column;gap:0}
.reactions-top-item{display:flex;flex-direction:column;gap:4px;padding:10px 0;border-bottom:1px solid var(--line-soft,var(--line))}
.reactions-top-item:first-child{padding-top:0}
.reactions-top-item:last-child{border-bottom:none;padding-bottom:0}
.reactions-top-topic{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--font-size-sm);font-weight:600;color:var(--text);text-decoration:none}
.reactions-top-topic:hover{color:var(--brand-hover,var(--brand))}
.reactions-top-breakdown{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.reactions-top-chip{display:inline-flex;align-items:center;gap:3px;font-size:var(--font-size-xs);color:var(--text-muted,var(--text));font-variant-numeric:tabular-nums;line-height:1.4}
.reactions-top-chip-more{color:var(--text-subtle);font-weight:600}
.reactions-top-sep{color:var(--text-subtle);font-size:var(--font-size-xs);user-select:none}
.reactions-top-body{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:var(--font-size-sm);line-height:1.4;color:var(--text-muted,var(--text));text-decoration:none;transition:color .12s}
.reactions-top-body:hover{color:var(--brand-hover,var(--brand))}

/* Reactions widget tab toggle (Latest | Top). Segmented control matching
   the growth leaderboard tabs: a rounded gray container with the active tab
   as a raised pill. Mirrors .growth-top-tabs/.growth-top-tab exactly so the
   two widgets look like the same component. */
.reactions-top-tabs{display:flex;gap:2px;margin:0 0 6px;padding:3px;border-radius:9px;background:var(--panel-2)}
.reactions-top-tab{flex:1;min-width:0;padding:5px 2px;border:0;border-radius:7px;background:none;color:var(--text-muted);font:inherit;font-size:var(--font-size-xs);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reactions-top-tab:hover{color:var(--text)}
.reactions-top-tab.active{background:var(--panel);color:var(--text);font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.reactions-top-panel[hidden]{display:none}
.reactions-top-empty{padding:14px 0;text-align:center;color:var(--text-subtle);font-size:var(--font-size-sm)}

/* seo_pro */
.seo-pro-panel{border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px;margin-bottom:12px;background:var(--panel-2)}.seo-pro-panel summary{cursor:pointer;display:flex;align-items:center;gap:6px;font-weight:600}.seo-pro-panel summary svg{width:15px;height:15px;color:var(--brand)}.seo-pro-panel[open] summary{margin-bottom:10px}.seo-pro-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:0 14px}.seo-pro-map{margin:0;padding-inline-start:18px;line-height:1.8}.seo-pro-tags .tag{margin:0 6px 6px 0}.seo-pro-card{max-width:520px;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:var(--panel)}.seo-pro-card img{display:block;width:100%;max-height:270px;object-fit:cover}.seo-pro-noimg{height:120px;display:flex;align-items:center;justify-content:center;background:var(--panel-2);color:var(--text-muted)}.seo-pro-card-body{padding:10px 12px}.seo-pro-card-body b{display:block;margin:2px 0}.seo-pro-card-body p{margin:0;color:var(--text-muted);font-size:var(--font-size-sm)}

/* share */
.share-menu .dropdown-menu{min-width:190px;inset-inline-end:auto;inset-inline-start:0}.topic-bar .share-menu .dropdown-menu{inset-inline-start:auto;inset-inline-end:0}.share-menu .dropdown-menu a{text-decoration:none}.share-menu .dropdown-menu .icon{width:18px;height:18px;flex:none}.post-actions .share-menu{display:inline-block}.post-actions .share-menu .dropdown-toggle{padding:4px 8px}

/* social_login */
.social-login{margin-top:18px}.social-login-or{display:flex;align-items:center;gap:10px;margin-bottom:10px;color:var(--text-subtle);font-size:var(--font-size-sm)}.social-login-or::before,.social-login-or::after{content:"";flex:1;border-top:1px solid var(--line)}.social-login-btns{display:grid;gap:8px}.social-login-btn{justify-content:center;gap:9px;font-weight:550}.social-login-btn svg{width:18px;height:18px;flex:none}.social-login-list{display:grid;gap:8px;margin-bottom:6px}.social-login-row{display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--line);border-radius:var(--radius)}.social-login-row svg{width:18px;height:18px;flex:none}.social-login-row .btn{margin-left:auto}

/* spoiler */
/* ---------------------------------------------------------------- spoiler
   Collapsible hidden-content blocks for Markdown, created by the Spoiler
   plugin. Source syntax in posts/pages:

       [spoiler]
       The butler did it.
       [/spoiler]

       [spoiler=Ending]
       They lived happily ever after.
       [/spoiler]

   The renderer turns each block into a native <details> element:

       <details class="spoiler">
         <summary>Spoiler</summary>
         <div class="spoiler-body">…rendered markdown…</div>
       </details>

   Collapsing/expanding is the browser's native <details> behavior — no JS.
   Colors and radii come from FlatBB's CSS variables so each theme's
   palette is respected automatically.
*/

/* The box itself: a subtle panel with a thin border, matching the language
   of blockquotes and callouts. margin: 16px 0 gives it air on both sides;
   overflow:hidden keeps the summary's bottom border flush with the body. */
.spoiler {
    margin: 16px 0;
    border: 1px solid var(--line-soft, var(--line));
    border-radius: var(--radius, 6px);
    background: var(--panel-2, var(--panel));
    overflow: hidden;
}

/* The clickable summary bar. We hide the native disclosure triangle and
   draw our own chevron (::below) so it rotates smoothly on open.
   flex + gap keeps the chevron and label aligned. */
.spoiler > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    font-weight: 600;
    font-size: var(--font-size-sm, 14px);
    color: var(--text-muted, var(--text));
    user-select: none;
    transition: color .12s, background .12s;
}
/* Hide the default triangle on WebKit/Blink (Firefox respects list-style:none
   above, but Safari/Chrome also need this pseudo-element hidden). */
.spoiler > summary::-webkit-details-marker { display: none; }

/* Custom chevron: a right-pointing triangle drawn with borders, rotated 90°
   to point down when the <details> is open. transition gives a smooth flip. */
.spoiler > summary::before {
    content: '';
    flex: none;
    width: 0;
    height: 0;
    border-left: 4px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform .15s ease;
}
.spoiler[open] > summary::before {
    transform: rotate(90deg);
}

/* Hover: brighten the text and tint the background with the brand color so
   the affordance is clear. The tint uses --brand-soft (or falls back to a
   semi-transparent brand) so it works in both light and dark themes. */
.spoiler > summary:hover {
    color: var(--text);
    background: var(--brand-soft, color-mix(in srgb, var(--brand, #2563eb) 8%, transparent));
}

/* When open, separate the header from the body with a border so the
   boundary is visible even when the body has no top margin. */
.spoiler[open] > summary {
    border-bottom: 1px solid var(--line-soft, var(--line));
    color: var(--text);
}

/* Body: same horizontal padding as the summary, a touch more vertical.
   Inner paragraphs/lists/etc. come through the post-content pipeline, so
   we just zero the first child's top margin and last child's bottom margin
   so content sits flush inside the box. */
.spoiler-body {
    padding: 7px 12px;
    color: var(--text, inherit);
}
.spoiler-body > *:first-child { margin-top: 0; }
.spoiler-body > *:last-child { margin-bottom: 0; }

/* When a spoiler sits inside a <blockquote> (unusual but valid), the
   blockquote's italic style would leak in. Undo it, same as callouts. */
blockquote .spoiler { font-style: normal; }

/* Guest-gated spoiler body: shown instead of the real content when the
   viewer is not logged in (hide_from_guests setting). The real text is
   not in the HTML at all — this prompt is all a guest (or scraper) sees.
   Styled as a quiet, italic login nudge so it reads as "you're missing
   something, here's how to see it" without looking like an error. */
.spoiler-guest {
    margin: 0;
    font-style: italic;
    color: var(--text-muted, var(--text));
    font-size: var(--font-size-sm, 14px);
}
.spoiler-guest a {
    color: var(--brand, #2563eb);
    text-decoration: none;
    font-weight: 600;
    font-style: normal; /* keep the link itself upright inside italic body */
}
.spoiler-guest a:hover {
    text-decoration: underline;
}

/* Mobile: tighten padding so the box doesn't dominate a small screen. */
@media (max-width: 600px) {
    .spoiler > summary { padding: 8px 10px; }
    .spoiler-body { padding: 8px 10px; }
}


/* tabre_chatroom */
[hidden]{display:none!important}
.tabre-cr{display:flex;flex-direction:column;gap:14px;max-width:1000px}
.tabre-cr-pagehead{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.tabre-cr-title{display:flex;align-items:center;gap:12px;min-width:0}
.tabre-cr-glyph{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;flex:none;border-radius:14px;background:var(--brand-soft);color:var(--brand)}
.tabre-cr-glyph .icon{width:24px;height:24px}
.tabre-cr-title h1{margin:0;font-size:var(--font-size-2xl);line-height:1.15}
.tabre-cr-title p{margin:2px 0 0;color:var(--text-muted);font-size:var(--font-size-sm)}
.tabre-cr-live{display:inline-flex;align-items:center;gap:7px;padding:5px 11px;border:1px solid var(--line);border-radius:var(--radius-pill);background:var(--panel);color:var(--text-muted);font-size:var(--font-size-xs);font-weight:600;white-space:nowrap}
.tabre-cr-live i{width:7px;height:7px;border-radius:50%;background:var(--text-muted);flex:none}
.tabre-cr-live[data-state="live"]{color:color-mix(in srgb,var(--success) 70%,var(--text));border-color:color-mix(in srgb,var(--success) 38%,var(--line))}
.tabre-cr-live[data-state="live"] i{background:var(--success);box-shadow:0 0 0 3px color-mix(in srgb,var(--success) 18%,transparent)}
.tabre-cr-live[data-state="wait"] i{background:var(--warning)}
.tabre-cr-stage{position:relative;display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:calc(var(--radius) + 4px);box-shadow:var(--shadow);overflow:hidden}
.tabre-cr-feed{position:relative;height:clamp(340px,calc(100dvh - 300px),640px);overflow-y:auto;overscroll-behavior:contain;padding:16px 16px 20px;background:var(--bg);scrollbar-width:thin;scroll-behavior:smooth}
.tabre-cr-stream{display:flex;flex-direction:column;gap:2px;min-height:100%}
.tabre-cr-msg{position:relative;display:flex;align-items:flex-start;gap:10px;padding:3px 6px;border-radius:10px}
.tabre-cr-msg.is-start{margin-top:12px}
.tabre-cr-msg:first-child.is-start{margin-top:0}
.tabre-cr-msg.is-mine{flex-direction:row-reverse}
.tabre-cr-av{display:inline-flex;align-items:center;justify-content:center;width:34px;flex:none;align-self:flex-start;text-decoration:none;border-radius:50%}
.tabre-cr-msg:not(.is-start) .tabre-cr-av{visibility:hidden}
.tabre-cr-body{position:relative;min-width:0;flex:0 1 auto;max-width:min(76%,640px)}
.tabre-cr-msg.is-mine .tabre-cr-body{margin-inline-start:auto}
.tabre-cr-head{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;min-height:21px}
.tabre-cr-msg:not(.is-start) .tabre-cr-head{display:none}
.tabre-cr-msg.is-mine .tabre-cr-head{justify-content:flex-end}
.tabre-cr-name{font-weight:700;font-size:var(--font-size-sm);color:var(--text);text-decoration:none}
.tabre-cr-name:hover{text-decoration:underline}
.tabre-cr-clock{flex:none;margin-inline-start:auto;color:var(--text-muted);font-size:11px;font-variant-numeric:tabular-nums}
.tabre-cr-msg.is-mine .tabre-cr-clock{margin-inline-start:0}
.tabre-cr-text{width:fit-content;max-width:100%;padding:6px 12px;border:1px solid var(--line-soft);border-radius:14px;background:var(--panel-2);color:var(--text);font-size:var(--font-size-md);line-height:1.5;overflow-wrap:anywhere}
.tabre-cr-msg.is-start .tabre-cr-text{border-start-start-radius:5px}
.tabre-cr-msg.is-mine.is-start .tabre-cr-text{border-start-start-radius:14px;border-start-end-radius:5px}
.tabre-cr-msg.is-mine .tabre-cr-text{border-color:transparent;background:var(--brand);color:#fff}
.tabre-cr-text p{margin:0 0 5px}
.tabre-cr-text p:last-child{margin-bottom:0}
.tabre-cr-text a{color:var(--brand);text-decoration:underline;text-underline-offset:2px}
.tabre-cr-text pre{margin:5px 0;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel);overflow-x:auto;max-width:100%;font-size:var(--font-size-xs)}
.tabre-cr-text code{font-family:var(--mono);font-size:.92em}
.tabre-cr-text :not(pre)>code{padding:1px 5px;border-radius:5px;background:var(--panel);border:1px solid var(--line-soft)}
.tabre-cr-text blockquote{margin:5px 0;padding-left:10px;border-left:2px solid var(--line);color:var(--text-muted)}
.tabre-cr-text img{max-width:100%;height:auto;border-radius:8px}
.tabre-cr-msg.is-mine .tabre-cr-text a{color:inherit}
.tabre-cr-msg.is-mine .tabre-cr-text :not(pre)>code{background:color-mix(in srgb,#fff 34%,transparent);border-color:transparent}
.tabre-cr-msg.is-mine .tabre-cr-text pre{background:color-mix(in srgb,#fff 34%,transparent);border-color:transparent}
.tabre-cr-msg.is-mine .tabre-cr-text blockquote{border-left-color:color-mix(in srgb,#2b1602 45%,transparent);color:color-mix(in srgb,#2b1602 82%,transparent)}
.tabre-cr-del{margin-top:2px;opacity:0;transition:opacity .12s}
.tabre-cr-msg.is-mine .tabre-cr-del{display:flex;justify-content:flex-end}
.tabre-cr-msg:hover .tabre-cr-del,.tabre-cr-del:focus-within{opacity:1}
.tabre-cr-delbtn{display:inline-flex;align-items:center;justify-content:center;height:24px;min-width:24px;padding:0 4px;border:0;border-radius:7px;background:transparent;color:var(--text-muted);font-size:11px;font-weight:700;cursor:pointer}
.tabre-cr-delbtn:hover{background:var(--danger-soft);color:var(--danger)}
.tabre-cr-delbtn .icon{width:14px;height:14px}
.tabre-cr-delbtn.is-armed{padding:0 8px;background:var(--danger-soft);color:var(--danger)}
.tabre-cr-day{display:flex;align-items:center;gap:10px;margin:16px 0 8px;color:var(--text-muted);font-size:var(--font-size-xs);font-weight:600}
.tabre-cr-day::before,.tabre-cr-day::after{content:"";height:1px;flex:1;background:var(--line-soft)}
.tabre-cr-day span{padding:2px 9px;border:1px solid var(--line-soft);border-radius:var(--radius-pill);background:var(--panel)}
.tabre-cr-older{display:flex;margin:0 auto 8px;padding:5px 12px;border:1px solid var(--line);border-radius:var(--radius-pill);background:var(--panel);color:var(--text-muted);font:inherit;font-size:var(--font-size-xs);cursor:pointer}
.tabre-cr-older:hover{border-color:var(--brand);color:var(--text)}
.tabre-cr-loading{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px;color:var(--text-muted);font-size:var(--font-size-sm)}
.tabre-cr-spin{width:14px;height:14px;border:2px solid var(--line);border-top-color:var(--brand);border-radius:50%;animation:tabre-cr-spin .7s linear infinite}
@keyframes tabre-cr-spin{to{transform:rotate(360deg)}}
.tabre-cr-empty{display:flex;flex-direction:column;align-items:center;gap:10px;padding:48px 16px;color:var(--text-muted);text-align:center}
.tabre-cr-emptyicon{display:inline-flex;align-items:center;justify-content:center;width:52px;height:52px;border-radius:50%;background:var(--panel-2);color:var(--brand)}
.tabre-cr-emptyicon .icon{width:24px;height:24px}
.tabre-cr-error{margin:10px auto;padding:8px 12px;border-radius:var(--radius-sm);background:var(--danger-soft);color:var(--danger);font-size:var(--font-size-sm);text-align:center}
.tabre-cr-jump{position:absolute;left:50%;bottom:98px;z-index:3;transform:translateX(-50%);display:inline-flex;align-items:center;gap:6px;padding:7px 13px;border:0;border-radius:var(--radius-pill);background:var(--brand);color:var(--brand-text);font:inherit;font-size:var(--font-size-xs);font-weight:700;cursor:pointer;box-shadow:var(--shadow-md)}
.tabre-cr-jump .icon{width:14px;height:14px}
.tabre-cr-composer{display:grid;grid-template-columns:1fr auto;gap:8px 10px;padding:12px 14px 9px;border-top:1px solid var(--line);background:var(--panel)}
.tabre-cr-field{min-width:0}
.tabre-cr-input{display:block;width:100%;min-height:40px;max-height:120px;padding:9px 12px;resize:none;border:1px solid var(--line);border-radius:12px;background:var(--panel-2);color:var(--text);font:inherit;font-size:var(--font-size-md);line-height:1.45}
.tabre-cr-input::placeholder{color:var(--text-muted)}
.tabre-cr-input:focus{outline:0;border-color:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 16%,transparent)}
.tabre-cr-send{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border:0;border-radius:50%;background:var(--brand);color:var(--brand-text);cursor:pointer;transition:background .15s,opacity .15s}
.tabre-cr-send:hover{background:var(--brand-hover)}
.tabre-cr-send:disabled{background:var(--line);color:var(--text-disabled);cursor:not-allowed}
.tabre-cr-send .icon{width:18px;height:18px}
.tabre-cr-foot{grid-column:1/-1;display:flex;justify-content:space-between;gap:10px;color:var(--text-muted);font-size:11px}
.tabre-cr-count{font-variant-numeric:tabular-nums}
.tabre-cr-count.is-near{color:var(--warning);font-weight:600}
.tabre-cr-notice{margin:0;padding:12px 16px;border-top:1px solid var(--line);background:var(--panel);color:var(--text-muted);font-size:var(--font-size-sm);text-align:center}
.tabre-cr-guest{max-width:640px;margin:24px auto}
.tabre-cr-guestcard{display:flex;flex-direction:column;align-items:center;gap:12px;padding:44px 28px;border:1px solid var(--line);border-radius:calc(var(--radius) + 6px);background:var(--panel);box-shadow:var(--shadow);text-align:center}
.tabre-cr-guestcard .tabre-cr-glyph{width:60px;height:60px;border-radius:18px}
.tabre-cr-guestcard h1{margin:0;font-size:var(--font-size-2xl)}
.tabre-cr-guestcard p{margin:0;max-width:42ch;color:var(--text-muted);line-height:1.6}
.tabre-cr-guestbtns{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:6px}
.tabre-cr :focus-visible{}
@media (hover:none){.tabre-cr-del{opacity:.55}}
@media (max-width:640px){
  .tabre-cr-pagehead{gap:10px}
  .tabre-cr-title h1{font-size:var(--font-size-xl)}
  .tabre-cr-glyph{width:40px;height:40px;border-radius:12px}
  .tabre-cr-stage{border-radius:var(--radius)}
  .tabre-cr-feed{height:calc(100dvh - 300px);min-height:300px;padding:12px 10px 16px}
  .tabre-cr-composer{padding:10px 10px 8px}
  .tabre-cr-body{max-width:84%}
  .tabre-cr-input{font-size:16px}
  .tabre-cr-foot span:first-child{display:none}
  .tabre-cr-foot{justify-content:flex-end}
  .tabre-cr-jump{bottom:92px}
  .tabre-cr-guestcard{padding:32px 20px}
}
@media (prefers-reduced-motion:reduce){
  .tabre-cr-feed{scroll-behavior:auto}
  .tabre-cr-send,.tabre-cr-del{transition:none}
  .tabre-cr-spin{animation-duration:2.4s}
}


/* tabre_ignore */
.tabre-ignore-hidden{margin:2px 0;padding:10px 12px;border:1px dashed var(--line);border-radius:var(--radius-sm);background:var(--panel-2)}.tabre-ignore-hidden>summary{display:flex;align-items:center;flex-wrap:wrap;gap:8px;cursor:pointer;list-style:none;color:var(--text-muted);font-size:var(--font-size-sm);line-height:1.5}.tabre-ignore-hidden>summary::-webkit-details-marker{display:none}.tabre-ignore-hidden>summary .icon{flex:none;width:15px;height:15px;color:var(--text-subtle)}.tabre-ignore-tag{display:inline-flex;align-items:center;padding:2px 9px;border-radius:var(--radius-pill);background:var(--text);color:var(--panel);font-size:var(--font-size-xs);font-weight:700;letter-spacing:.03em;text-transform:uppercase}.tabre-ignore-note{min-width:0;overflow-wrap:anywhere}.tabre-ignore-hidden[open]>summary{margin-bottom:10px}.tabre-ignore-body{padding-top:10px;border-top:1px solid var(--line-soft)}.post:has(.post-main>.post-content>.tabre-ignore-hidden) .post-main>:not(.post-content){display:none}.tabre-ignore-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}.tabre-ignore-row{display:flex;align-items:center;gap:12px;padding:10px 4px;border-bottom:1px solid var(--line)}.tabre-ignore-row:last-child{border-bottom:0}.tabre-ignore-row .avatar{flex:none}.tabre-ignore-who{display:flex;flex-direction:column;min-width:0;line-height:1.3}.tabre-ignore-who .user-link{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tabre-ignore-who small{color:var(--text-muted);font-size:var(--font-size-xs)}.tabre-ignore-unignore{margin-left:auto;flex:none}.tabre-ignore-unignore .icon{width:14px;height:14px;margin-right:4px;vertical-align:-2px}.tabre-ignore-row .btn{white-space:nowrap}

/* tag_block */

    /* Block button — tag page positioning */
    .tag-block-tagpage { margin: 0px 0 10px 10px; }
    .tag-block-form { display: inline; }

    /* Blocked state — override btn-danger with success green
       (content is hidden, green = click to restore) */
    .tag-block-btn.is-blocked {
        color: var(--success);
        border-color: var(--success);
        background: transparent;
    }
    .tag-block-btn.is-blocked:hover {
        background: var(--success-soft);
        border-color: var(--success);
        color: var(--success);
    }

    /* Settings → Blocked tags: hide the core Save button */
    body.page-settings-tag_block .settings-form .form-actions { display: none; }

    /* Settings → Blocked tags list */
    .tag-block-list { display: flex; flex-direction: column; gap: 8px; }
    .tag-block-item {
        display: flex; align-items: center; gap: 12px;
        padding: 8px 12px; background: var(--panel); border: 1px solid var(--line);
        border-radius: var(--radius);
    }
    .tag-block-name { font-weight: 700; color: var(--text); text-decoration: none; }
    .tag-block-name:hover { color: var(--brand); }
    .tag-block-count { margin-right: auto; }
    

/* translate */
.translate-box{margin-top:10px;padding:10px 12px;border-inline-start:3px solid var(--brand);background:var(--panel-2);border-radius:var(--radius-sm)}.translate-foot{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:8px;font-size:var(--font-size-xs);color:var(--text-subtle)}.translate-foot button{border:0;background:none;color:var(--brand);cursor:pointer;font:inherit;font-size:inherit;padding:0}.translate-btn.busy{opacity:.6;pointer-events:none}.translate-title{display:block;margin-top:4px;color:var(--text-muted);font-weight:400;font-size:.8em}

/* video */

    
audio {
    width: 100%;
}

    video {
  border: 0;
  width: 100%;
  max-height:400px;
  display: inline-block;
  border-radius: 5px;
}

      iframe {
  border: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
    height:100%;
    object-fit: cover;
  border-radius: 5px; 
}
    .audio-container {
        margin: 1rem 0;
        border-radius: 8px;
        overflow: hidden;
    }
    .tweet-container {
        margin: 1rem 0;
        max-width: 550px;
    }
    .tweet-container iframe{
        border-radius: 8px;
    }

/* votes */
/* Vote widget — replaces the core like button. Two layouts:
   .votes-vertical: ▲ score ▼ stacked (9gag/Reddit style)
   .votes-horizontal: ▲ score ▼ inline
   Tokens from the flatbb CSS variable set so each theme is respected. */

.votes{display:inline-flex;align-items:center;gap:0;margin-right:6px}

/* Vertical layout: stack the buttons and score in a column. */
.votes-vertical{flex-direction:column;gap:0;border:1px solid var(--line-soft,var(--line));border-radius:var(--radius-sm,4px);overflow:hidden;background:var(--panel-2,var(--panel));margin-right:8px}
.votes-vertical .vote-btn{width:32px;height:24px;display:flex;align-items:center;justify-content:center;padding:0;border:none;background:none;cursor:pointer;color:var(--text-subtle);transition:background .1s,color .1s}
.votes-vertical .vote-btn .icon{width:16px;height:16px}
.votes-vertical .vote-score{min-width:32px;text-align:center;font-size:var(--font-size-sm,14px);font-weight:700;font-variant-numeric:tabular-nums;line-height:1;padding:1px 0;color:var(--text-muted)}
.votes-vertical .vote-btn:hover{background:var(--brand-soft,var(--panel));color:var(--brand)}
.votes-vertical .vote-up.active{color:var(--brand);background:var(--brand-soft,var(--panel))}
.votes-vertical .vote-down.active{color:var(--danger);background:var(--danger-soft,var(--panel))}
.votes-vertical .vote-down:hover{color:var(--danger);background:var(--danger-soft,var(--panel))}

/* Horizontal layout: inline buttons with score between them. */
.votes-horizontal{flex-direction:row;gap:2px;align-items:center}
.votes-horizontal .vote-btn{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:none;border-radius:var(--radius-sm,4px);background:none;cursor:pointer;color:var(--text-subtle);transition:background .1s,color .1s}
.votes-horizontal .vote-btn .icon{width:16px;height:16px}
.votes-horizontal .vote-score{min-width:24px;text-align:center;font-size:var(--font-size-sm,14px);font-weight:700;font-variant-numeric:tabular-nums;color:var(--text-muted);padding:0 2px}
.votes-horizontal .vote-btn:hover{background:var(--brand-soft,var(--panel));color:var(--brand)}
.votes-horizontal .vote-up.active{color:var(--brand)}
.votes-horizontal .vote-down.active{color:var(--danger)}
.votes-horizontal .vote-down:hover{color:var(--danger);background:var(--danger-soft,var(--panel))}

/* Guest vote buttons are <a> links to /login (with a back= redirect), not
   interactive <button>s — see votes_widget_html(). Reset the link underline
   so they render identically to the member buttons; the .vote-btn color and
   layout rules above already apply (class specificity beats the element). */
a.vote-btn{text-decoration:none}

/* Static variant — score only, no buttons. No longer emitted by the plugin
   (guests now get the full widget with login-link buttons), kept for themes
   that may reference the class independently. */
.votes-static{padding:4px 8px;border-radius:var(--radius-sm,4px);background:var(--panel-2,var(--panel));color:var(--text-muted,var(--text));font-size:var(--font-size-sm,14px);font-weight:700;font-variant-numeric:tabular-nums;display:inline-flex;align-items:center;gap:4px}

/* Score color shifts when net-negative: a subtle red tint so a downvoted
   post reads as "community disagrees" at a glance. Only applies when the
   score is actually negative (the widget carries data-negative="1"). */
.votes[data-negative="1"] .vote-score{color:var(--danger)}
.votes-static[data-negative="1"]{color:var(--danger)}

/* Reduced motion */
@media (prefers-reduced-motion:reduce){.vote-btn{transition:none}}

/* Mobile: the vertical widget is already compact; horizontal tightens slightly. */
@media (max-width:600px){
  .votes-horizontal .vote-btn{width:24px;height:24px}
}

/* xmad */
/* X Mad: a topic row that carries .xmad-head is laid out as a post of a timeline.
   Grid: the avatar in the first column; head, title (core .row-main) and body stacked in the second. */
:root {
  --xmad-like: var(--brand);
}

.nsfw-badge {
    padding: 0 5px;
    line-height: 1.6;
}

.topic-title .nsfw-badge {
        line-height: 1.6;
    padding: 0 6px;
}

.announce-bar {
    padding: 0px 5px;
    margin-bottom: 12px;
    background: none;
    border: none;
}

.topic-row  {
    margin-bottom: 16px;
    background: var(--card-bg, var(--panel));
    border: 1px solid var(--card-line, var(--line));
    border-radius: var(--card-radius, var(--radius));
}

.list-card {
    background: none;
    border: none;
    border-radius: none;
}
.list-card > .list-head
 {
    padding: 0px 5px 10px;
    border-bottom: none;
}
/* Hide the core's duplicate meta line (author, views, replies, time, tags, category)
   on any xmad-styled row, whether the after-slot is still in its core position (a
   direct child of the row) or has been moved into the title by xmad_arrange_rows_dom
   / xmad_arrange_js. The :has(.xmad-head) selector (no > .slot) matches both shapes,
   so this fires immediately on first paint — no flash, no JS dependency. */
.topic-row:has(.xmad-head) .row-meta { display: none !important; }

/* X Style: a topic row that carries .xmad-head is laid out as a post of a timeline.
   Uses :has(.xmad-head) (not :has(> .slot .xmad-head)) so the layout applies on first
   paint regardless of whether the after-slot is a direct child of the row (older core)
   or already inside the h3 (core 0.2.4+, where slot() sits in the title). This eliminates
   the 2-second FOUC where the vote widget sat at the bottom until xmad_arrange_js ran. */
.topic-row:has(.xmad-head) {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; row-gap: 4px;
  padding: 14px 16px 8px; cursor: pointer;
}
.topic-row:has(.xmad-head) > * { grid-column: 2; }
.topic-row:has(.xmad-head) > .slot[data-slot="topic_list.item.after"] { display: contents; }
.topic-row:has(.xmad-head) > .row-avatar { grid-column: 1; grid-row: 1 / span 3; padding-top: 2px; }
.topic-row:has(.xmad-head) > .row-main { grid-row: 1; }
.topic-row:has(.xmad-head) .row-meta,
.topic-row:has(.xmad-head) .meta-cat,
.topic-row:has(.xmad-head) .topic-category,
.topic-row:has(.xmad-head) .row-icon-pin { display: none !important; }
/* the core's own stats bar, tags, excerpt and last reply (the plugin re-renders them): hidden, so no doubles.
   The JS also sets [data-xmad-hidden] on any other non-title child of .row-main as a catch-all. */
.topic-row:has(.xmad-head) .row-stats,
.topic-row:has(.xmad-head) .row-tags,
.topic-row:has(.xmad-head) .row-excerpt,
.topic-row:has(.xmad-head) .row-last,
.topic-row:has(.xmad-head) .row-actions,
.topic-row:has(.xmad-head) .row-info,
.topic-row:has(.xmad-head) .topic-stats,
.topic-row:has(.xmad-head) .topic-tags,
.topic-row:has(.xmad-head) .topic-excerpt,
.topic-row:has(.xmad-head) [data-xmad-hidden] { display: none !important; }
.topic-row:has(.xmad-head) .row-title { margin: 0; font-size: var(--font-size-lg); font-weight: 600; line-height: 1.4; }
.topic-row.read:has(.xmad-head) .row-title a { font-weight: 500; }
/* the New / unread badge, moved inline with the title by the JS: a small accent pill right after the title text */
.topic-row:has(.xmad-head) .row-title .xmad-new,
.topic-row:has(.xmad-head) .row-title .row-new,
.topic-row:has(.xmad-head) .row-title .badge-new,
.topic-row:has(.xmad-head) .row-title .new-badge,
.topic-row:has(.xmad-head) .row-title .is-new,
.topic-row:has(.xmad-head) .row-title .unread,
.topic-row:has(.xmad-head) .row-title .unread-badge,
.topic-row:has(.xmad-head) .row-title [data-new],
.topic-row:has(.xmad-head) .row-title .new {
  margin-inline-start: 6px; display: inline-block; padding: 0 0px;
  font-size: var(--font-size-xs); border-radius: 999px;
  white-space: nowrap;
}
/* if the badge is a bare dot (no text), keep it round */
.topic-row:has(.xmad-head) .row-title .xmad-new:empty,
.topic-row:has(.xmad-head) .row-title .row-new:empty,
.topic-row:has(.xmad-head) .row-title .badge-new:empty,
.topic-row:has(.xmad-head) .row-title .new:empty {
  width: 8px; height: 8px; padding: 0; border-radius: 50%; margin-left: 6px; vertical-align: middle;
}

/* a member's own list (no avatar): one column, and the name is not repeated */
.topic-row:has(.xmad-head):not(:has(> .row-avatar)) { grid-template-columns: minmax(0, 1fr); }
.topic-row:has(.xmad-head):not(:has(> .row-avatar)) > * { grid-column: 1; }
.topic-row:not(:has(> .row-avatar)) .xmad-name, .topic-row:not(:has(> .row-avatar)) .xmad-name + .xmad-dot { display: none; }

.row-icon-pin
 {
    display:none;
}

.xmad-head { grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; font-size: var(--font-size-sm); color: var(--text-subtle); line-height: 1.4; }
.xmad-pinned { flex-basis: 100%; display: inline-flex; align-items: center; gap: 4px; font-size: var(--font-size-xs); font-weight: 600; color: #fb923c; }
.xmad-pinned .icon { width: 12px; height: 12px; }
.xmad-who { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.xmad-head .xmad-name { font-weight: normal; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xmad-head .xmad-name:hover { color: var(--text); text-decoration: underline; }
.xmad-time { color: var(--text-subtle); white-space: nowrap; }
.xmad-time:hover { color: var(--text-subtle); text-decoration: underline; }
.xmad-cat { margin-inline-start: auto; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-muted); font-size: var(--font-size-xs); white-space: nowrap; }
.xmad-cat:hover { border-color: var(--text-subtle); color: var(--text); }

.xmad-body { grid-row: 3; min-width: 0; }
/* paragraphs stay paragraphs (one line break each), with a little air between them */
.xmad-text { color: var(--text-muted);  margin-top: 5px; font-size: var(--font-size-md); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.xmad-more { display: inline-block; margin-top: 2px; color: var(--brand); font-size: var(--font-size-sm); }
.xmad-more:hover { text-decoration: underline; }
.xmad-tags { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 6px; font-size: var(--font-size-sm); }
.xmad-tags a { }
.xmad-tags a:hover { text-decoration: underline; }

/* up to four pictures, the way a timeline shows them: one wide, two side by side, one tall beside two, or four squares; "+N" on the fourth */
.xmad-media { display: grid; gap: 2px; max-width: 560px; margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel-2); }
.xmad-pic { position: relative; display: block; min-width: 0; min-height: 0; padding: 0; border: 0; background: none; cursor: zoom-in; }
a.xmad-media .xmad-pic { cursor: pointer; }
.xmad-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.xmad-media-1 img { height: auto; max-height: 420px; }
.xmad-media-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 260px; }
.xmad-media-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); height: 280px; }
.xmad-media-3 > :first-child { grid-row: 1 / span 2; }
.xmad-media-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); height: 280px; }
.xmad-plus {  background: rgba(0, 0, 0, .45); color: #fff;  position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 1;}
/* a video: its cover and a play button, the player takes its place when pressed */
.xmad-video { position: relative; display: flex; align-items: center; justify-content: center; max-width: 560px; margin-top: 12px; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #1c1c1e; }
.post-content .xmad-video { max-width: 100%; }
.post-content .xmad-video img, .xmad-video video, .xmad-video iframe {max-width:100%}
.xmad-video img, .xmad-video video, .xmad-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.xmad-video.is-file video { object-fit: contain; background: #000; }
.xmad-play { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); cursor: pointer; transition: transform .12s, background .12s; }
.xmad-play:hover { background: var(--brand); transform: scale(1.06); }
.xmad-tri { display: block; width: 0; height: 0; margin-left: 5px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }
.xmad-badge { position: absolute; z-index: 1; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: var(--font-size-xs); }
.xmad-badge .icon { width: 13px; height: 13px; }
.xmad-video.playing .xmad-play, .xmad-video.playing .xmad-badge { display: none; }
/* the picture viewer */
.xmad-viewer { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .92); }
.xmad-viewer[hidden] { display: none; }
.xmad-viewer img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 4px; }
.xmad-viewer button { position: absolute; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.xmad-viewer button:hover { background: rgba(255, 255, 255, .24); }
.xmad-v-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.xmad-v-next { right: 16px; top: 50%; transform: translateY(-50%); }
.xmad-v-close { top: 16px; right: 16px; }
.xmad-viewer.single .xmad-v-prev, .xmad-viewer.single .xmad-v-next, .xmad-viewer.single .xmad-count { display: none; }
.xmad-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .8); font-size: var(--font-size-sm); }
/* the NSFW warning card shown to signed-out visitors on topics marked mature:
   centered lock + notice + Sign in button, in place of the excerpt/tags/media.
   The row is itself clickable (the whole row opens the topic), so the button
   keeps pointer-events:auto; the form stops the row click from navigating when
   the visitor picks Sign in instead. Signed-in visitors never see this card —
   they get the normal excerpt/media for NSFW topics (the title badge is enough). */
.xmad-nsfw { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; padding: 5px 0px; text-align: center; color: var(--text-muted); font-size: var(--font-size-md); line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
.xmad-nsfw-icon .icon,
.xmad-nsfw-icon svg,
.xmad-nsfw-icon img { width: 40px; height: 40px; color: var(--text-muted); opacity: .55; display: block; stroke: currentColor; fill: none; }
.xmad-nsfw-text { max-width: 420px; font-size: var(--font-size-md)!important; }
.xmad-nsfw-form { margin: 0; padding: 0; pointer-events: auto; }
.xmad-nsfw-btn { pointer-events: auto; cursor: pointer; text-decoration: none; }
.topic-row:hover .xmad-nsfw,
a:hover .xmad-nsfw { text-decoration: none; }


/* fixed columns (replies, like, views, last reply, then bookmark and share), so the buttons line up from one row to the next */
.xmad-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr) auto; align-items: center; gap: 8px; max-width: 600px; margin-top: 8px; margin-inline-start: -8px; color: var(--text-subtle); font-size: var(--font-size-sm); }
.xmad-actions > * { justify-self: start; }
.xmad-actions .action-form { display: inline-flex; margin: 0; }
.xmad-act { display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 8px; border: 0; border-radius: 999px; background: none; color: var(--text-muted); font: inherit; line-height: 1; cursor: pointer; white-space: nowrap; }
.xmad-act .icon { flex: none; }
.xmad-act span:empty { display: none; }
.xmad-reply:hover { color: var(--brand); background: var(--brand-soft, var(--panel-2)); }
.xmad-like:hover, .xmad-like.active { color: var(--xmad-like); }
.xmad-like:hover { background: color-mix(in srgb, var(--xmad-like) 10%, transparent); }
.xmad-like.active .icon { fill: var(--xmad-like); }

/* Vote widget in the actions row (shown when the Votes plugin is active).
   Matches the .xmad-act pill aesthetic: same 16px icons, same border-radius,
   same hover tint. The Votes plugin's JS handles the click (delegated on
   .vote-btn inside .votes); the AJAX response updates the score in place. */
.xmad-actions .votes-list { display: inline-flex; align-items: center; gap: 0; }
.xmad-actions .votes-list .vote-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--text-muted); cursor: pointer; transition: background .1s, color .1s; }
.xmad-actions .votes-list .vote-btn .icon { width: 16px; height: 16px; flex: none; }
.xmad-actions .votes-list .vote-btn:hover { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.xmad-actions .votes-list .vote-up.active { color: var(--brand); }
.xmad-actions .votes-list .vote-down:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.xmad-actions .votes-list .vote-down.active { color: var(--danger); }
.xmad-actions .votes-list .vote-score { min-width: 24px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-muted); padding: 0 2px; }
.xmad-actions .votes-list[data-negative="1"] .vote-score { color: var(--danger); }
.xmad-actions .votes-list.votes-static { padding: 5px 10px; border-radius: 999px; color: var(--text-muted); }
.xmad-actions .votes-list.votes-static .vote-score { color: var(--text-muted); }
.xmad-views { cursor: default; }
.xmad-last { max-width: 100%; overflow: hidden; }
.xmad-last time { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xmad-last span { overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.xmad-last time { color: var(--text-subtle); }
.xmad-last:hover { color: var(--text); background: var(--panel-2); }
.xmad-end { justify-self: end; display: inline-flex; align-items: center; gap: 2px; }
.xmad-end .action-form { display: inline-flex; margin: 0; }
.xmad-bookmark span { display: none; } /* the core script writes Bookmark / Bookmarked into it: it stays the tooltip only */
.xmad-actions .share-menu .dropdown-toggle span { display: none !important; } /* icon-only share button */
.xmad-actions .share-menu { display: inline-flex; }
.xmad-actions .share-menu .dropdown-toggle { padding: 5px 8px; }
.xmad-bookmark:hover, .xmad-bookmark.active { color: var(--brand); }
.xmad-bookmark:hover { background: var(--panel-2); }
.xmad-bookmark.active .icon { fill: var(--brand); }
.xmad-share:hover { color: var(--brand); background: var(--panel-2); }



@media (max-width: 640px) {
    .topic-row  {
    margin-bottom: 10px;
}
  .topic-row:has(.xmad-head) { grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; padding: 12px 12px 8px; }
  .topic-row:has(.xmad-head) .row-avatar .avatar { width: 36px; height: 36px; }
  .topic-row:has(.xmad-head) .row-title { font-size: 15px; }
  .xmad-cat { display: none; }
  .xmad-media, .xmad-video { border-radius: 12px; }
  .xmad-media-2, .xmad-media-3, .xmad-media-4 { height: 200px; }
  .xmad-v-prev, .xmad-v-next { display: none !important; }
  .xmad-last, .xmad-actions > span:empty { display: none; } /* no room for the last reply (or its empty place) beside the buttons on a phone; the topic shows it */
  .xmad-actions { max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
  .xmad-text {
    font-size: 16px!important; 
    line-height: 1.5!important;
  }
}

.topic-row.unread .xmad-head,
.topic-row.unread .xmad-head *,
.topic-row.unread .xmad-name,
.topic-row.unread .user-link,
.topic-row.unread .xmad-tags a,
.topic-row.unread .xmad-actions,
.topic-row.unread .xmad-actions * {
    font-weight: normal !important;
}

.xmad-head a, .xmad-tags a, .xmad-actions a {
    color:var(--text-muted)!important;
}
/* ================================================================
   XMad Magazine Layout — DESKTOP ONLY (min-width: 993px).
   Mobile is completely untouched — uses the core's own drawer/sidebar
   behavior exactly as xstyle did.
   ================================================================ */

@media (min-width: 993px) {

/* Sidebar OFF (user clicked hamburger): left sidebar hidden.
   Main content stays at its normal width (doesn't stretch).
   Container is constrained to compensate for the missing left column.
   Pages with no right sidebar (body.no-right, like Growth/Leaderboard) are
   left alone — they stretch full width naturally since there's no right column. */
body.xmad-on:not(.show-sidebar):not(.page-admin):not(.no-right) .container.page-grid {
    max-width: calc(var(--container) - var(--left-w) - var(--gap) + 36px) !important;
}
body.xmad-on:not(.show-sidebar):not(.page-admin):not(.no-right) .page-grid {
    grid-template-columns: minmax(0, 1fr) var(--right-w) !important;
}
body.xmad-on:not(.show-sidebar):not(.page-admin):not(.no-right) .col-left {
    display: none !important;
}

/* Pages with no right sidebar (Growth, Leaderboard, etc.): when sidebar is off,
   let the main content stretch full width — no constraint at all. */
body.xmad-on:not(.show-sidebar):not(.page-admin).no-right .container.page-grid {
    max-width: var(--container) !important;
}
body.xmad-on:not(.show-sidebar):not(.page-admin).no-right .page-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: none !important;
}
body.xmad-on:not(.show-sidebar):not(.page-admin).no-right .col-left {
    display: none !important;
}

/* Sidebar ON: full 3-column layout, normal container width.
   Skip no-right pages (Growth, Leaderboard) — they have their own layout. */
body.xmad-on.show-sidebar:not(.page-admin):not(.no-right) .container.page-grid {
    max-width: var(--container) !important;
}
body.xmad-on.show-sidebar:not(.page-admin):not(.no-right) .page-grid {
    grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w) !important;
}
body.xmad-on.show-sidebar:not(.page-admin):not(.no-right) .col-left {
    display: block !important;
}

/* Hamburger button visible on desktop too */
body.xmad-on:not(.page-admin) .drawer-toggle {
    display: inline-flex !important;
}

} /* end @media (min-width: 993px) — mobile untouched */

/* Audio player (direct MP3/WAV/FLAC/etc. links detected by the theme) */
.xmad-audio {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 560px;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 50%;
}
.xmad-audio audio {
    width: 100%;
}


/* yourimageshare */
/* YourImageShare toolbar button + status indicator */

.yourimageshare-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}


.yourimageshare-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 7px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    font-size: var(--font-size-sm);
    flex: none;
}

.yourimageshare-btn:hover, .yourimageshare-btn:active {
    background: var(--panel-2);
    color: var(--text);
}

.yourimageshare-btn:disabled {
    opacity: 0.5;
    cursor: progress;
}

.yourimageshare-btn svg {
    width: 1.1em;
    height: 1.1em;
    flex: 0 0 auto;
}

.yourimageshare-status {
    font-size: 0.78em;
    color: var(--text-muted, #636c76);
    padding: 0 0.3em;
}

.yourimageshare-status.yourimageshare-error {
    color: var(--danger, #cf222e);
}


/* infinite_scroll */

    .infscroll-loader {
        width: 24px;
        height: 24px;
        border: 3px solid rgba(0, 0, 0, 0.1);
        border-radius: 50%;
        border-top-color: currentColor;
        animation: infscroll-spin 0.8s linear infinite;
        margin: 0 auto;
    }
    @keyframes infscroll-spin {
        to { transform: rotate(360deg); }
    }
