:root {
    --bg: #080808;
    --bg-panel: #121212;
    --bg-panel-alt: #181818;
    --bg-row-alt: #141414;
    --border: #2a2a2a;
    --border-light: #333333;
    --text: #a8a8a8;
    --text-bright: #e0e0e0;
    --text-white: #ffffff;
    --link: #5eb8ff;
    --link-hover: #9fd4ff;
    --nav-top: #2470c4;
    --nav-bottom: #0f3568;
    --section-top: #1a1a1a;
    --section-bottom: #0c0c0c;
    --accent: #3d8fd9;
    --accent-glow: #1a9fff;
    --error: #ff7070;
    --success: #6ecf9a;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Verdana, Tahoma, Arial, sans-serif;
    --radius: 8px;
    --mobile-header-h: 52px;
    --desktop-header-h: 44px;
    --layout-max-width: 1470px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --page-scrollbar-size: 10px;
    --page-side-gutter: var(--page-scrollbar-size);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%23a8a8a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

[data-theme="light"] {
    --bg: #eef2f6;
    --bg-panel: #ffffff;
    --bg-panel-alt: #f7f9fc;
    --bg-row-alt: #f0f4f8;
    --border: #d0d7de;
    --border-light: #c5ced8;
    --text: #4a5568;
    --text-bright: #1a202c;
    --text-white: #1a202c;
    --link: #1a6fc4;
    --link-hover: #2470c4;
    --section-top: #f7f9fc;
    --section-bottom: #eef2f6;
    --accent: #2470c4;
    --accent-glow: #3d8fd9;
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow: hidden;
    max-width: 100%;
    height: 100%;
    height: 100dvh;
}

body {
    margin: 0;
    font-family: var(--font-main);
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    max-width: 100%;
    height: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

/*
 * Page frame: scrollable content + footer docked under the scroll box
 * (scrollbar stops at the footer top). Spacer reserves the footer footprint
 * so the end of the page already has the right gap before docking.
 */
.page-frame {
    --site-footer-gap: 28px;
    --site-footer-height: 88px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page-shell {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overflow-anchor: none;
    overscroll-behavior: contain;
    padding-left: var(--page-side-gutter);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.2s ease;
}

.footer-reach-spacer {
    flex-shrink: 0;
    height: calc(var(--site-footer-gap) + var(--site-footer-height));
}

.page-frame.is-footer-reached .footer-reach-spacer {
    height: var(--site-footer-gap);
}

.page-shell.is-scrolling {
    scrollbar-color: var(--nav-top) transparent;
}

.page-shell::-webkit-scrollbar {
    width: var(--page-scrollbar-size);
}

.page-shell::-webkit-scrollbar-track {
    background: transparent;
}

.page-shell::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 5px;
    transition: background 0.2s ease;
}

.page-shell.is-scrolling::-webkit-scrollbar-thumb {
    background: var(--nav-top);
}

.page-shell.is-scrolling::-webkit-scrollbar-thumb:hover,
.page-shell::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

[data-theme="light"] .page-shell.is-scrolling {
    scrollbar-color: var(--nav-top) transparent;
}

/* Nested scroll areas keep a subtle always-available bar */
.main-nav-inner,
.modal-body,
pre,
.codehilite {
    scrollbar-width: thin;
    scrollbar-color: var(--nav-top) transparent;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover,
a:focus-visible {
    color: var(--link-hover);
    text-decoration: none;
}

.container {
    width: min(var(--layout-max-width), calc(100% - 1.25rem));
    margin: 0 auto;
}

/* Mobile sticky header */
.mobile-sticky-header {
    display: none;
}

/* Top bar */
.desktop-top-header {
    position: relative;
    z-index: 200;
}

.topbar {
    background: var(--bg-panel-alt);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    font-size: 12px;
}

.topbar-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    margin-right: auto;
}

.topbar-nav a {
    display: block;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-bright);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.topbar-nav a:hover,
.topbar-nav a:focus-visible {
    background: rgba(36, 112, 196, 0.15);
    color: var(--link);
}

.topbar-nav .nav-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar-nav .nav-user-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-bright);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.topbar-nav .nav-user-link:hover,
.topbar-nav .nav-user-link:focus-visible {
    background: rgba(36, 112, 196, 0.15);
    color: var(--link);
}

.topbar-nav .nav-user-menu {
    position: relative;
    display: inline-flex;
}

.topbar-nav .nav-submenu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    background: none;
    border-radius: 6px;
    color: var(--text-bright);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.topbar-nav .nav-submenu-trigger-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar-nav .nav-accordion-chevron {
    display: none;
}

.topbar-nav .nav-submenu-trigger:hover,
.topbar-nav .nav-submenu-trigger:focus-visible {
    background: rgba(36, 112, 196, 0.15);
    color: var(--link);
}

.topbar-nav .nav-user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    justify-content: flex-start;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
}

.topbar-nav .nav-user-trigger-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

@media (min-width: 721px) {
    .topbar-nav .nav-link-search {
        display: none;
    }
}

.topbar-nav .nav-submenu-dropdown,
.topbar-nav .nav-user-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 220px;
    margin-top: 2px;
    padding: 6px 0;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 250;
}

.topbar-nav .nav-user-menu:hover .nav-user-dropdown,
.topbar-nav .nav-user-menu:focus-within .nav-user-dropdown {
    display: block;
}

.topbar-nav .nav-submenu {
    position: relative;
    display: inline-flex;
}

.topbar-nav .nav-submenu-trigger {
    color: var(--text-bright);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--radius);
}

.topbar-nav .nav-submenu-trigger:hover,
.topbar-nav .nav-submenu:focus-within .nav-submenu-trigger {
    background: rgba(36, 112, 196, 0.15);
    color: var(--link);
}

.topbar-nav .nav-submenu:hover .nav-submenu-dropdown,
.topbar-nav .nav-submenu:focus-within .nav-submenu-dropdown {
    display: block;
}

.topbar-nav .nav-submenu-dropdown a,
.topbar-nav .nav-submenu-dropdown .nav-submenu-item,
.topbar-nav .nav-user-dropdown a,
.topbar-nav .nav-user-dropdown .nav-logout-btn {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    box-shadow: none;
}

.topbar-nav .nav-submenu-dropdown a:hover,
.topbar-nav .nav-submenu-dropdown .nav-submenu-item:hover,
.topbar-nav .nav-submenu-dropdown .nav-submenu-item:focus-visible,
.topbar-nav .nav-user-dropdown a:hover,
.topbar-nav .nav-user-dropdown .nav-logout-btn:hover,
.topbar-nav .nav-user-dropdown .nav-logout-btn:focus-visible {
    background: rgba(36, 112, 196, 0.12);
    color: var(--link);
}

.topbar-nav .nav-submenu-form {
    margin: 0;
}

.topbar-nav .unread-badge.nav-submenu {
    margin-left: 6px;
}

.topbar-nav .nav-user-dropdown .nav-logout-form {
    display: block;
    margin: 0;
    border: none;
}

.topbar-nav .nav-user-avatar {
    display: inline-flex;
    flex-shrink: 0;
    line-height: 0;
}

.topbar-nav .nav-logout-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.topbar-nav .nav-logout-btn {
    display: block;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--text-bright);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.topbar-nav .nav-logout-btn:hover,
.topbar-nav .nav-logout-btn:focus-visible {
    background: rgba(36, 112, 196, 0.15);
    color: var(--link);
}

[data-theme="light"] .topbar-nav a:hover,
[data-theme="light"] .topbar-nav a:focus-visible {
    background: rgba(36, 112, 196, 0.1);
    color: var(--link);
}

[data-theme="light"] .topbar-nav .nav-user-link:hover,
[data-theme="light"] .topbar-nav .nav-user-link:focus-visible {
    background: rgba(36, 112, 196, 0.1);
    color: var(--link);
}

.topbar-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.topbar-search {
    flex: 0 1 280px;
    max-width: 280px;
}

.topbar-search input[type="search"] {
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1.2;
    min-height: 30px;
    box-sizing: border-box;
}

.topbar-search .search-submit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    flex-shrink: 0;
}

.topbar-search .search-icon {
    width: 15px;
    height: 15px;
    display: block;
}

.header-toggles {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.theme-toggle,
.lang-pref-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 30px;
    height: 30px;
    min-width: 30px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel-alt);
    color: var(--text-bright);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0;
    line-height: 0;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.lang-pref-flag {
    display: block;
    width: 18px;
    height: 12px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.lang-pref-flag svg {
    display: block;
    width: 100%;
    height: 100%;
}

.lang-pref-google {
    display: none;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.lang-pref-google svg {
    display: block;
    width: 100%;
    height: 100%;
}

html[data-ugc-translate="on"] .lang-pref-google,
.lang-pref-toggle[aria-pressed="true"] .lang-pref-google {
    display: block;
}

html[data-ugc-translate="on"] .lang-pref-toggle,
.lang-pref-toggle[aria-pressed="true"] {
    width: auto;
    gap: 5px;
    padding: 0 6px;
}

@media (hover: hover) {
    .theme-toggle:hover,
    .lang-pref-toggle:hover {
        border-color: var(--nav-top);
        color: var(--link);
    }
}

.theme-toggle-icon {
    display: none;
    position: absolute;
    inset: 0;
    margin: auto;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    pointer-events: none;
    overflow: visible;
}

html:not([data-theme="light"]) .theme-icon-dark,
[data-theme="light"] .theme-icon-light {
    display: block;
}

[data-theme="light"] .main-nav-inner,
[data-theme="light"] .modal-body {
    scrollbar-color: var(--nav-top) #e8edf2;
}

[data-theme="light"] .site-banner {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: radial-gradient(ellipse 90% 120% at 50% 40%, #f4f8fc 0%, #dce2e8 78%);
    border-bottom-color: rgba(36, 112, 196, 0.22);
}

[data-theme="light"] .site-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse 70% 90% at 50% 50%,
        rgba(255, 255, 255, 0.88) 0%,
        rgba(255, 255, 255, 0.35) 48%,
        transparent 78%
    );
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] .banner-inner {
    position: relative;
    z-index: 1;
}

[data-theme="light"] .site-logo {
    color: var(--text-bright);
}

[data-theme="light"] .banner-brand:hover .site-logo {
    color: var(--text-bright);
}

[data-theme="light"] .site-subtitle {
    color: var(--text);
}

[data-theme="light"] .section-title h2 {
    color: var(--text-bright);
}

[data-theme="light"] .hero.panel {
    background: linear-gradient(135deg, #f0f4f8 0%, var(--bg-panel) 100%);
}

[data-theme="light"] .hero h2 {
    color: var(--text-bright);
}

[data-theme="light"] .category-summary {
    background: linear-gradient(to right, #e8eef5, var(--bg-panel-alt));
}

[data-theme="light"] .search-form input[type="search"],
[data-theme="light"] .search-form input[type="text"],
[data-theme="light"] .form-group input[type="search"],
[data-theme="light"] .form-group input[type="text"],
[data-theme="light"] .form-group input[type="email"],
[data-theme="light"] .form-group input[type="password"],
[data-theme="light"] .form-group input[type="url"],
[data-theme="light"] .form-group input[type="number"],
[data-theme="light"] .form-group input[type="date"],
[data-theme="light"] .form-group input[type="datetime-local"],
[data-theme="light"] .form-group input[type="time"],
[data-theme="light"] .form-group textarea,
[data-theme="light"] .staff-user-mod-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
[data-theme="light"] .staff-user-mod-field textarea,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-select,
[data-theme="light"] .search-form select,
[data-theme="light"] .admin-form select,
[data-theme="light"] .admin-user-form-row select,
[data-theme="light"] .staff-user-mod-field select,
[data-theme="light"] .topic-view-select,
[data-theme="light"] .topic-jump-select,
[data-theme="light"] .shoutbox-form input[type="text"] {
    background-color: var(--bg-panel-alt);
    color: var(--text-bright);
}

[data-theme="light"] .alert-success {
    background: #e8f5ee;
    border-color: #a8d4bc;
    color: #1a5c3a;
}

[data-theme="light"] .alert-error {
    background: #fce8e8;
    border-color: #e8b4b4;
    color: #8b1a1a;
}

[data-theme="light"] .cookie-banner-card {
    background: var(--bg-panel);
    border-color: rgba(36, 112, 196, 0.22);
    box-shadow: 0 10px 36px rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .cookie-banner-cat {
    background: var(--bg-panel-alt);
    border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .mod-bar {
    background: #f5f0d8;
    border-color: #d4c8a0;
}

[data-theme="light"] .tooltip-popover {
    background: #fff;
    border-color: #ccc;
    color: #333;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .category-summary:hover {
    background: linear-gradient(to right, #dfe8f2, var(--bg-panel-alt));
}

[data-theme="light"] .forum-row:hover,
[data-theme="light"] .topic-row:hover {
    background: rgba(36, 112, 196, 0.08);
    color: inherit;
}

[data-theme="light"] .main-nav-bar a:hover {
    background: rgba(36, 112, 196, 0.1);
    color: var(--text-bright);
}

[data-theme="light"] .breadcrumb,
[data-theme="light"] .meta,
[data-theme="light"] .category-count,
[data-theme="light"] .topic-row-started,
[data-theme="light"] .forum-row-stats,
[data-theme="light"] .topic-row-lastpost {
    color: var(--text);
}

[data-theme="light"] .forum-row,
[data-theme="light"] .topic-row {
    border-bottom-color: var(--border);
}

[data-theme="light"] .pagination a,
[data-theme="light"] .pagination .ellipsis {
    background: var(--bg-panel-alt);
    color: var(--link);
    border-color: var(--border);
}

[data-theme="light"] .pagination .current {
    color: #fff;
}

[data-theme="light"] .quill-editor-wrap .ql-editor.ql-blank::before {
    color: #8a94a6;
}

/* Banner */
.site-banner {
    background: radial-gradient(ellipse at 50% -20%, #152840 0%, #080808 65%);
    padding: 1.5rem 0 1.25rem;
    border-bottom: 1px solid rgba(36, 112, 196, 0.25);
    margin-left: calc(-1 * var(--page-side-gutter));
    width: calc(100% + var(--page-side-gutter) + var(--page-scrollbar-size));
    box-sizing: border-box;
}

.banner-inner {
    display: flex;
    justify-content: center;
}

.banner-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.banner-brand:hover {
    color: inherit;
}

.site-logo-icon {
    flex-shrink: 0;
    border-radius: 10px;
    position: relative;
    top: 2px;
    background: transparent;
    box-shadow: none;
    border: none;
}

.banner-titles {
    text-align: left;
}

.site-logo {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-white);
}

.banner-brand:hover .site-logo {
    color: #fff;
}

.site-subtitle {
    margin: 0.25rem 0 0;
    color: #777;
    font-size: 12px;
}

/* Main nav (mobile drawer) */
.main-nav-bar {
    background: linear-gradient(to bottom, var(--nav-top), var(--nav-bottom));
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 90;
}

.main-nav-inner {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}

.main-nav-bar a {
    display: block;
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 500;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.main-nav-bar a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.main-nav-bar .nav-admin-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.main-nav-bar .nav-user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 500;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.main-nav-bar .nav-user-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.main-nav-bar .nav-user-avatar {
    display: inline-flex;
    flex-shrink: 0;
    line-height: 0;
}

.main-nav-bar .nav-user-menu {
    position: relative;
    display: flex;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.main-nav-bar .nav-submenu {
    position: relative;
    display: flex;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.main-nav-bar .nav-submenu-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 18px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.92);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}

.main-nav-bar .nav-submenu-trigger-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.nav-accordion-chevron {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0.72;
    transition: transform 0.2s ease;
}

.main-nav-bar .nav-submenu-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.main-nav-bar .nav-submenu-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 220px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 200;
    padding: 6px 0;
}

.main-nav-bar .nav-submenu:hover .nav-submenu-dropdown,
.main-nav-bar .nav-submenu:focus-within .nav-submenu-dropdown {
    display: block;
}

.main-nav-bar .nav-submenu-dropdown a,
.main-nav-bar .nav-submenu-dropdown .nav-submenu-item {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: inherit;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    box-shadow: none;
}

.main-nav-bar .nav-submenu-dropdown a:hover,
.main-nav-bar .nav-submenu-dropdown .nav-submenu-item:hover {
    background: rgba(36, 112, 196, 0.12);
    color: var(--link);
}

.main-nav-bar .nav-submenu-form {
    margin: 0;
    padding: 0;
    display: block;
}

.main-nav-bar .nav-user-menu-trigger {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
}

.main-nav-bar .nav-user-trigger-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.main-nav-bar .nav-user-menu-trigger:hover,
.main-nav-bar .nav-user-menu:focus-within .nav-user-menu-trigger {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.main-nav-bar .nav-user-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 180px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 400;
}

.main-nav-bar .nav-user-menu:hover .nav-user-dropdown,
.main-nav-bar .nav-user-menu:focus-within .nav-user-dropdown {
    display: block;
}

.main-nav-bar .nav-user-dropdown a,
.main-nav-bar .nav-user-dropdown .nav-logout-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 0;
    background: none;
    color: var(--text-bright);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.main-nav-bar .nav-user-dropdown a:hover,
.main-nav-bar .nav-user-dropdown .nav-logout-btn:hover {
    background: rgba(36, 112, 196, 0.12);
    color: var(--link);
}

.main-nav-bar .nav-user-dropdown .nav-logout-form {
    display: block;
    margin: 0;
    border: none;
}

.main-nav-bar .nav-logout-form {
    display: flex;
    align-items: center;
    margin: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.main-nav-bar .nav-logout-btn {
    display: block;
    padding: 10px 18px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.main-nav-bar .nav-logout-btn:hover,
.main-nav-bar .nav-logout-btn:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.main-content {
    flex: 1 0 auto;
    padding: 16px 0 32px;
}

.global-notice-banner {
    margin-bottom: 14px;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid rgba(36, 112, 196, 0.45);
    background: linear-gradient(135deg, rgba(36, 112, 196, 0.22), rgba(0, 174, 239, 0.12));
}

.global-notice-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.global-notice-label {
    flex-shrink: 0;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--nav-top);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.global-notice-text {
    color: var(--text-bright);
    font-size: 14px;
    line-height: 1.45;
    flex: 1;
    min-width: 0;
}

[data-theme="light"] .global-notice-banner {
    background: linear-gradient(135deg, rgba(36, 112, 196, 0.1), rgba(0, 174, 239, 0.06));
    border-color: rgba(36, 112, 196, 0.28);
}

/* Section titles */
.section-title {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    margin: 20px 0 12px;
    padding: 0 0 8px;
    text-align: left;
    min-width: 0;
    max-width: 100%;
}

.section-title h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: 0.01em;
}

.section-title h2::before,
.section-title h2::after {
    content: none;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.section-title-row > h2 {
    min-width: 0;
    flex: 1 1 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-title-trailing {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px 16px;
    min-width: 0;
    flex-shrink: 0;
}

.section-title-meta {
    font-size: 11px;
    color: #666;
    text-align: right;
    white-space: nowrap;
}

.section-title-aside {
    flex-shrink: 0;
}

.section-title-row .topic-list-legend {
    justify-content: flex-end;
    padding-top: 0;
    border-top: none;
    text-align: right;
}

/* Panels */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 14px;
}

.panel-flush {
    padding: 0;
    overflow: hidden;
}

.panel + .section-title {
    margin-top: 20px;
}

.hero.panel {
    background: linear-gradient(135deg, #121820 0%, #121212 100%);
}

.hero h2,
.panel h2,
.panel h3,
.panel h4 {
    color: var(--text-bright);
    margin-top: 0;
}

.hero h2 {
    font-size: 17px;
    color: var(--text-white);
}

.panel h3 {
    font-size: 14px;
}

.meta {
    color: #777;
    font-size: 11px;
}

.breadcrumb {
    color: #666;
    margin-bottom: 10px;
    font-size: 11px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Collapsible categories */
.category-block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: var(--bg-panel);
    overflow: hidden;
}

.category-summary {
    list-style: none;
    cursor: pointer;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 10px;
    row-gap: 2px;
    position: relative;
    padding: 12px 16px;
    background: linear-gradient(to right, #1a2430, #141414);
    user-select: none;
    transition: background 0.15s ease;
}

.category-summary::-webkit-details-marker {
    display: none;
}

.category-summary:hover {
    background: linear-gradient(to right, #1e2a38, #181818);
}

.category-chevron {
    grid-column: 1;
    grid-row: 1;
    width: 7px;
    height: 7px;
    margin-top: 4px;
    border-right: 2px solid var(--link);
    border-bottom: 2px solid var(--link);
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.category-block[open] .category-chevron {
    transform: rotate(45deg);
}

.category-heading {
    display: contents;
}

.category-title {
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
    font-weight: 600;
    color: var(--text-white);
    font-size: 13px;
    line-height: 1.25;
}

.category-count {
    grid-column: 4;
    grid-row: 1;
    color: #666;
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    margin-top: 1px;
}

.category-lead {
    grid-column: 3 / -1;
    grid-row: 2;
    margin: 0;
    font-size: 11px;
    line-height: 1.3;
    color: #8ea0b3;
}

[data-theme="light"] .category-lead {
    color: #5c6b7a;
}

/* Forum / topic lists */
.forum-list,
.forum-row,
.topic-row {
    display: grid;
    align-items: center;
    gap: 8px 12px;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: inherit;
    transition: background 0.12s ease;
}

.forum-row {
    grid-template-columns: 24px minmax(0, 1fr) 72px 72px minmax(130px, 200px);
    align-items: start;
}

.topic-row {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 44%);
    align-items: center;
    position: relative;
}

.topic-row-body {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.topic-row-sub {
    display: none;
}

.topic-row-stats {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
}

.topic-row-started-desktop {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #666;
    font-size: 11px;
    line-height: 1.35;
}

.topic-row-started-desktop .badge.pinned {
    flex-shrink: 0;
}

.topic-row-started-desktop .topic-row-started-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forum-list-head {
    display: none;
}

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

@media (min-width: 721px) {
    .forum-list-head,
    .forum-row {
        grid-template-columns: 24px minmax(0, 1fr) 72px 72px minmax(130px, 200px);
    }

    .forum-row {
        grid-template-rows: auto auto;
        row-gap: 3px;
        align-items: start;
    }

    .forum-row-main {
        display: contents;
    }

    .forum-row > .forum-row-icon {
        grid-column: 1;
        grid-row: 1;
    }

    .forum-row-name-row {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .forum-row-desc {
        grid-column: 2;
        grid-row: 2;
        min-width: 0;
    }

    .forum-list-head {
        display: grid;
        gap: 8px 12px;
        padding: 8px 16px 6px;
        font-size: 11px;
        font-weight: 600;
        color: #888;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        border-bottom: 1px solid var(--border);
        align-items: end;
    }

    .forum-list-head-stats-group,
    .forum-row-stats-group {
        grid-column: 3 / -1;
        display: grid;
        grid-template-columns: subgrid;
        min-width: 0;
    }

    .forum-list-head-stats-group {
        align-items: center;
    }

    .forum-row-stats-group {
        grid-row: 1 / -1;
        align-items: start;
        align-self: start;
    }

    .forum-list-head-col,
    .forum-row-topics,
    .forum-row-replies {
        justify-self: stretch;
        text-align: right;
        min-width: 0;
        font-variant-numeric: tabular-nums;
    }

    .forum-list-head-col {
        display: block;
        width: 100%;
        line-height: 1.2;
        font-size: 10px;
        letter-spacing: 0.02em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .forum-list-head-last,
    .forum-row-last {
        justify-self: stretch;
        text-align: right;
        min-width: 0;
        padding-inline-end: 12px;
        box-sizing: border-box;
    }

    .forum-list-head-name {
        text-align: left;
    }

    @supports not (grid-template-columns: subgrid) {
        .forum-list-head-stats-group,
        .forum-row-stats-group {
            grid-template-columns: 72px 72px minmax(130px, 200px);
            column-gap: 12px;
        }
    }

    .topic-list-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(360px, 44%);
        gap: 8px 12px;
        padding: 8px 16px 6px;
        font-size: 11px;
        font-weight: 600;
        color: #888;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        border-bottom: 1px solid var(--border);
        align-items: end;
    }

    .topic-list-head-stats {
        display: grid;
        grid-template-columns: minmax(88px, 1.15fr) 52px 56px minmax(120px, 1.5fr);
        gap: 8px 16px;
        justify-items: end;
        text-align: right;
    }

    .topic-list-head-author,
    .topic-list-head-last {
        text-align: right;
    }

    .topic-list-head-name {
        text-align: left;
    }
}

.forum-row {
    position: relative;
    align-items: start;
}

.forum-row-hit {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.forum-row-hit:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: -2px;
}

.forum-row > :not(.forum-row-hit) {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.forum-row .author {
    pointer-events: auto;
}

.forum-row-main {
    display: contents;
}

.forum-row-name-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    align-self: start;
}

.forum-row-name-row .forum-row-name {
    min-width: 0;
}

.forum-row-desc {
    color: #888;
    font-size: 11px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.forum-row-stats-group {
    min-width: 0;
}

.forum-row-topics,
.forum-row-replies {
    font-size: 12px;
    color: #888;
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 0;
}

.forum-row-last {
    text-align: right;
    font-size: 11px;
    line-height: 1.35;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.forum-row-last-author {
    min-width: 0;
    max-width: 100%;
}

.forum-row-last-author .author {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.forum-row-last-author .author.unknown {
    color: #888;
    font-weight: normal;
}

.forum-row-stats-mobile {
    display: none;
}

@media (min-width: 900px) {
    .topic-row-started-sep,
    .topic-row-started-author,
    .topic-row-lastpost--mobile,
    .topic-row-sub {
        display: none;
    }
}

.forum-row:last-child,
.topic-row:last-child {
    border-bottom: none;
}

.forum-row:hover,
.topic-row:hover {
    background: rgba(94, 184, 255, 0.06);
    color: inherit;
}

.forum-row-name {
    font-weight: 600;
    color: var(--link);
    font-size: 13px;
}

.forum-row-stats,
.topic-row-meta {
    color: #666;
    font-size: 11px;
    white-space: nowrap;
    text-align: right;
}

.forum-row-icon {
    width: 24px;
    text-align: center;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    align-self: start;
    margin-top: 1px;
}

.forum-row--new-topic::before,
.forum-row--new-reply::before,
.topic-row--new-topic::before,
.topic-row--new-reply::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    z-index: 2;
    pointer-events: none;
}

.forum-row--new-topic::before,
.topic-row--new-topic::before {
    background: var(--accent);
}

.forum-row--new-reply::before,
.topic-row--new-reply::before {
    background: #e8a020;
}

[data-theme="light"] .forum-row--new-topic::before,
[data-theme="light"] .topic-row--new-topic::before {
    background: #2470c4;
}

[data-theme="light"] .forum-row--new-reply::before,
[data-theme="light"] .topic-row--new-reply::before {
    background: #c48210;
}

.activity-dot {
    width: 24px;
    text-align: center;
    font-size: 10px;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-dot--new-topic {
    color: var(--accent);
}

.activity-dot--new-reply {
    color: #e8a020;
}

.activity-dot--empty {
    color: transparent;
}

.category-summary .activity-dot {
    grid-column: 2;
    grid-row: 1;
    margin-top: 2px;
    margin-right: 0;
}

.topic-row-unread .topic-row-title {
    font-weight: 700;
}

.topic-row-started {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    color: #666;
    font-size: 11px;
    line-height: 1.3;
}

.topic-row-started-line {
    display: inline-flex;
    align-items: baseline;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    order: 1;
    flex: 1 1 auto;
}

.topic-row-started-sep {
    flex-shrink: 0;
}

.topic-row-started-author {
    display: inline;
    min-width: 0;
    margin-left: 0.35em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-row-started-author .author {
    display: inline;
}

.topic-row-started .badge.pinned,
.topic-row-started .topic-row-pinned-badge {
    flex-shrink: 0;
    order: 2;
}

.topic-row-started-text {
    flex-shrink: 0;
}

.topic-row-lastpost--mobile {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    flex-shrink: 0;
    color: #666;
    font-size: 10px;
    line-height: 1.25;
    text-align: right;
}

.topic-row-lastpost--mobile .topic-row-lastpost-author .author {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 28vw;
}

.topic-row-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

a.topic-row-main {
    cursor: pointer;
}

a.topic-row-main:hover .topic-row-title-text {
    color: var(--link-hover);
}

.topic-row-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

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

.topic-row-replies-mobile {
    display: none;
}

.topic-row-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-weight: 600;
    color: var(--link);
    font-size: 13px;
    line-height: 1.35;
    min-width: 0;
}

.topic-row-title-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-row-stats {
    display: grid;
    grid-template-columns: minmax(88px, 1.15fr) 52px 56px minmax(120px, 1.5fr);
    gap: 8px 16px;
    align-items: center;
    justify-items: end;
    min-width: 0;
    color: #666;
    font-size: 11px;
    text-align: right;
}

.topic-row-author {
    font-size: 12px;
    line-height: 1.35;
    min-width: 0;
    max-width: 100%;
}

.topic-row-author .author {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-row-replies,
.topic-row-views {
    font-weight: 600;
    color: var(--text-bright);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.topic-row-lastpost {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    color: #666;
    line-height: 1.35;
    min-width: 0;
}

.topic-row-lastpost-date {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.topic-row-lastpost-author {
    min-width: 0;
    max-width: 100%;
}

.topic-row-lastpost-author .author {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.topic-list-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35em 0.85em;
    margin: 0;
    white-space: nowrap;
}

.topic-list-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
}

.topic-list-legend-bar {
    display: inline-block;
    width: 3px;
    height: 12px;
    border-radius: 0 2px 2px 0;
    flex-shrink: 0;
}

.topic-list-legend-bar--new-topic {
    background: var(--accent);
}

.topic-list-legend-bar--new-reply {
    background: #e8a020;
}

[data-theme="light"] .topic-list-legend-bar--new-topic {
    background: #2470c4;
}

[data-theme="light"] .topic-list-legend-bar--new-reply {
    background: #c48210;
}

.topic-list-legend-sep {
    color: #666;
}

.forum-list-footer {
    margin-top: 12px;
    text-align: center;
}

.topic-legend-unread {
    color: var(--accent);
    margin-right: 4px;
}

/* Legacy tables (search, admin) */
.forum-table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.forum-table thead th,
.data-table thead th {
    background: var(--bg-panel-alt);
    color: var(--text-bright);
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.forum-table tbody td,
.data-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: top;
}

.forum-table tbody tr:last-child td,
.data-table tbody tr:last-child td {
    border-bottom: none;
}

.forum-table tbody tr:hover,
.data-table tbody tr:hover {
    background: rgba(94, 184, 255, 0.04);
}

.forum-table .col-stats,
.data-table .col-stats {
    width: 70px;
    text-align: center;
    white-space: nowrap;
}

.forum-table .col-last,
.data-table .col-last {
    width: 180px;
    font-size: 11px;
}

.forum-name-cell a {
    font-weight: 600;
}

.forum-name-cell .forum-desc {
    display: block;
    color: #666;
    font-size: 10px;
    margin-top: 2px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.stat-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--bg-panel-alt);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--link);
}

.stat-label {
    color: #777;
    font-size: 11px;
}

/* Posts */
.posts-list {
    display: grid;
    gap: 10px;
}

.post-card {
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--bg-panel-alt);
}

.post-card.compact {
    padding: 10px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.post-meta {
    color: #777;
    font-size: 11px;
}

.post-content {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    color: var(--text-bright);
    font-size: 13px;
    line-height: 1.55;
    max-width: 100%;
}

.post-content img,
.post-content video {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.post-content pre {
    overflow-x: auto;
    max-width: 100%;
    background: var(--bg-panel-alt);
    padding: 10px;
    border-radius: var(--radius);
}

.post-content blockquote {
    margin: 0.5em 0;
    padding-left: 12px;
    border-left: 3px solid var(--nav-top);
    color: var(--text);
}

.post-content p {
    margin: 0;
}

.post-content p + p {
    margin-top: 0.5em;
}

/* Topic layout */
.topic-breadcrumb {
    margin-bottom: 8px;
}

.topic-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    justify-items: center;
    text-align: center;
}

.topic-toolbar-meta {
    color: var(--text);
    font-size: 12px;
    line-height: 1.45;
    min-width: 0;
    text-align: center;
}

.topic-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.topic-toolbar-actions-cluster {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.topic-forum-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    max-width: 100%;
}

.topic-jump-label {
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
}

.topic-jump-go {
    flex-shrink: 0;
    min-height: 32px;
    padding: 6px 12px;
}

.topic-jump-go:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.topic-pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 20px;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    text-align: center;
}

.topic-pagination-bar-leading {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    text-align: center;
}

.topic-posts-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.topic-pagination-bar-trailing {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 16px;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
}

.topic-pagination-bar + .posts-list,
.topic-posts-list + .topic-pagination-bar {
    margin-top: 12px;
}

.topic-view-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 16px;
}

@media (min-width: 900px) {
    .topic-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 16px;
        justify-items: stretch;
        text-align: left;
    }

    .topic-toolbar-meta {
        line-height: 32px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: left;
    }

    .topic-toolbar-actions {
        flex-wrap: nowrap;
        justify-content: flex-end;
        width: auto;
        justify-self: end;
    }

    .topic-toolbar-actions-cluster {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }

    .topic-pagination-bar {
        justify-content: space-between;
        text-align: left;
    }

    .topic-pagination-bar-leading {
        flex: 1 1 auto;
        width: auto;
        text-align: left;
    }

    .topic-pagination-bar-trailing {
        flex: 0 1 auto;
        width: auto;
        justify-content: flex-end;
        margin-left: auto;
    }

    .topic-view-controls {
        justify-content: flex-end;
    }
}

.topic-page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 0;
    font-size: 13px;
    flex-wrap: wrap;
}

.topic-view-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text);
}

.topic-view-label span {
    white-space: nowrap;
}

.post-body-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px 10px;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.45;
    container-type: inline-size;
}

[data-theme="light"] .post-body-header {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.post-body-header-meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35em 0.65em;
}

.post-body-header-votes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.post-body-header .badge,
.post-body-header .post-staff-mod-badge {
    white-space: nowrap;
    flex-shrink: 0;
}

.post-meta-icon {
    display: none;
    width: 14px;
    height: 14px;
}

.post-body-header-votes .post-vote-score {
    font-size: 11px;
    min-height: 24px;
    padding: 3px 8px;
}

.post-body-header-votes .post-vote-btn {
    width: 24px;
    height: 24px;
    padding: 0;
}

.post-body-header-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 6px;
    margin-left: auto;
}

.post-body-header-actions .post-mod-form,
.post-body-header-actions .post-owner-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.post-body-segment .post-body-header {
    margin-top: 0;
    padding-top: 0;
}

.post-body-segment .post-body-header:first-child {
    border-top: 0;
}

body.topic-view-standard .post-body-segment--meta-collapsible:not(.is-meta-expanded) .post-body-header {
    display: none;
}

.post-segment-content-row {
    --seg-chevron-col: 11px;
    --seg-chevron-gap: 6px;
    --seg-line-height: calc(13px * 1.55);
    display: grid;
    grid-template-columns: var(--seg-chevron-col) minmax(0, 1fr);
    column-gap: var(--seg-chevron-gap);
    align-items: start;
}

.post-duplicate-compact-row {
    --seg-line-height: calc(11px * 1.45);
    margin-top: 12px;
    align-items: center;
}

.post-segment-content {
    grid-column: 2;
    min-width: 0;
}

.post-duplicate-compact-label {
    grid-column: 2;
    min-width: 0;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-muted);
}

.post-segment-meta-toggle,
.post-duplicate-compact-toggle {
    grid-column: 1;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--seg-chevron-col);
    height: var(--seg-line-height);
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}

.post-segment-meta-toggle:hover,
.post-segment-meta-toggle:focus-visible,
.post-duplicate-compact-toggle:hover,
.post-duplicate-compact-toggle:focus-visible {
    color: var(--accent);
}

.post-segment-meta-chevron {
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid currentColor;
    transition: transform 0.15s ease;
}

.post-body-segment--meta-collapsible.is-meta-expanded .post-segment-meta-chevron,
.post-duplicate-compact-toggle.is-expanded .post-segment-meta-chevron {
    transform: rotate(90deg);
}

body.topic-view-standard .post-duplicate-toggle {
    display: none;
}

body.topic-view-extended .post-duplicate-compact-toggle {
    display: none;
}

body.topic-view-extended .post-segment-meta-toggle {
    display: none;
}

body.topic-view-standard .post-duplicate-cluster {
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
}

body.topic-view-standard .post-duplicate-cluster:not(.is-standard-expanded) {
    margin-top: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

body.topic-view-standard .post-duplicate-cluster:not(.is-standard-expanded) > .post-duplicate-hidden {
    display: none !important;
}

.post-group-summary {
    display: none;
}

body.topic-view-standard .post-body--grouped > .post-group-summary {
    display: grid;
    grid-template-columns: var(--seg-chevron-col, 11px) minmax(0, 1fr);
    column-gap: var(--seg-chevron-gap, 6px);
    align-items: center;
    margin-bottom: 0;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border);
}

.post-group-expand-toggle {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--seg-chevron-col, 11px);
    height: 1.45em;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: inherit;
    line-height: 1;
    cursor: pointer;
}

.post-group-expand-toggle:hover,
.post-group-expand-toggle:focus-visible {
    color: var(--accent);
}

.post-body--grouped.is-group-expanded > .post-group-summary .post-group-expand-toggle .post-segment-meta-chevron {
    transform: rotate(90deg);
}

.post-group-summary-inner {
    grid-column: 2;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

body.topic-view-standard .post-body--grouped .post-segment-meta-toggle {
    display: none;
}

body.topic-view-standard .post-body--grouped .post-body-segment .post-segment-content-row {
    grid-template-columns: minmax(0, 1fr);
}

body.topic-view-standard .post-body--grouped .post-body-segment .post-segment-content {
    grid-column: 1;
}

body.topic-view-standard .post-body--grouped:not(.is-group-expanded) .post-duplicate-compact-row {
    display: none;
}

body.topic-view-standard .post-body--grouped:not(.is-group-expanded) .post-edit-archives {
    display: none;
}

body.mod-topic-staff.topic-view-standard .post-body--grouped:not(.is-group-expanded) [data-post-deleted="1"] {
    display: none !important;
}

body.topic-view-standard .post-body--grouped > .post-body-segment--group-lead-first {
    margin-top: 10px;
    padding-top: 0;
    border-top: 0;
}

body.topic-view-extended .post-body--grouped > .post-body-segment--group-lead-first {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.post-group-range {
    font-weight: 600;
}

.post-group-pick-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    max-height: 320px;
    overflow: auto;
}

.post-group-pick-item {
    margin: 0 0 8px;
    padding: 0;
}

.post-group-pick-item label {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 2px;
    align-items: start;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

.post-group-pick-item input {
    margin-top: 3px;
}

.post-group-pick-label {
    font-weight: 600;
}

.post-group-pick-preview {
    grid-column: 2;
}

.post-group-pick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.topic-view-mode {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.topic-view-mode-btn.is-active {
    border-color: var(--accent);
    color: var(--accent);
}

.topic-nav-link {
    color: var(--link);
    font-weight: 600;
}

.topic-nav-link.is-disabled {
    color: var(--text);
    opacity: 0.45;
}

.topic-nav-pages {
    color: var(--text);
    font-size: 12px;
}

.topic-posts-list {
    gap: 0;
}

.post-author-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--bg-panel-alt);
}

[data-theme="light"] .post-author-group {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.post-author-group .post-row {
    border: 0;
    border-radius: 0;
    margin-bottom: 0;
    background: transparent;
}

.post-author-group .post-row--group-lead .post-userpanel {
    align-self: stretch;
}

.post-body--grouped {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.post-body--grouped .post-body-duplicate-tail {
    padding-top: 4px;
}

.post-body--grouped:has(.post-body-extensions) .post-body-duplicate-tail {
    margin-top: 0;
}

.post-body--grouped:not(:has(.post-body-extensions)) .post-body-duplicate-tail {
    margin-top: auto;
}

.post-body--grouped .post-signature {
    margin-top: 10px;
}

.post-body-extensions .post-duplicate-cluster {
    border-top: 0;
}

.post-body-segment,
.post-duplicate-segment {
    border-top: 1px dashed var(--border);
    padding-top: 12px;
    margin-top: 12px;
}

.post-body-toolbar--segment {
    margin-top: 0;
    margin-bottom: 8px;
    padding-bottom: 6px;
}

.post-body-segment.post-row--highlight,
.post-duplicate-segment.post-row--highlight {
    animation: post-highlight-pulse 2.5s ease-out;
    border-radius: 4px;
}

.post-duplicate-cluster {
    margin: 10px -14px 0;
    padding: 0;
    border-top: 1px dashed var(--border);
    background: var(--post-duplicate-bg, var(--bg-row-alt));
}

html:not([data-theme="light"]) .post-duplicate-cluster {
    --post-duplicate-bg: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .post-duplicate-cluster {
    --post-duplicate-bg: rgba(0, 174, 239, 0.07);
}

.post-duplicate-cluster .post-body-segment:first-child {
    margin-top: 0;
}

.post-duplicate-toggle {
    display: block;
    width: 100%;
    margin: 0;
    padding: 7px 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--link);
    text-align: left;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    line-height: 1.45;
    text-decoration: none;
    opacity: 0.95;
}

.post-duplicate-hidden {
    margin-top: 0;
    padding: 0 10px 8px;
}

.post-duplicate-hidden[hidden],
.post-duplicate-cluster[data-collapsed="1"] .post-duplicate-hidden {
    display: none !important;
}

.post-duplicate-toggle:hover,
.post-duplicate-toggle:focus-visible {
    background: rgba(0, 174, 239, 0.1);
    color: var(--link);
    opacity: 1;
    outline: none;
}

html:not([data-theme="light"]) .post-duplicate-toggle:hover,
html:not([data-theme="light"]) .post-duplicate-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.post-duplicate-cluster[data-collapsed="0"] .post-duplicate-toggle {
    margin-bottom: 0;
}

.post-duplicate-cluster .post-body-segment,
.post-duplicate-cluster .post-duplicate-segment {
    border-top: 1px dashed color-mix(in srgb, var(--border) 70%, transparent);
    margin-top: 0;
    padding-top: 10px;
}

.post-duplicate-hidden .post-body-segment:first-child,
.post-duplicate-hidden .post-duplicate-segment:first-child {
    margin-top: 0;
    padding-top: 10px;
}

.post-row--duplicate-hidden[hidden] {
    display: none !important;
}

.post-row--highlight {
    animation: post-highlight-pulse 2.5s ease-out;
}

@keyframes post-highlight-pulse {
    0% {
        box-shadow: inset 0 0 0 2px var(--accent);
        background: color-mix(in srgb, var(--accent) 12%, transparent);
    }
    100% {
        box-shadow: none;
        background: inherit;
    }
}

.post-modified-meta {
    display: inline;
}

.post-modified-by-author {
    color: var(--link);
    text-decoration: none;
}

.post-modified-by-author:hover,
.post-modified-by-author:focus-visible {
    text-decoration: underline;
}

.post-staff-mod-badge.badge {
    margin-left: 0;
    padding: 1px 7px;
    border-radius: 4px;
    cursor: pointer;
    background: rgba(0, 174, 239, 0.12);
    color: var(--accent, #00aeef);
    border-color: rgba(0, 174, 239, 0.45);
    text-transform: none;
    font-size: 9px;
    line-height: 1.35;
    vertical-align: baseline;
    text-decoration: none;
}

.post-staff-mod-badge.badge:hover,
.post-staff-mod-badge.badge:focus-visible {
    background: rgba(0, 174, 239, 0.22);
    border-color: rgba(0, 174, 239, 0.65);
    outline: none;
}

[data-theme="light"] .post-staff-mod-badge.badge {
    background: rgba(0, 120, 180, 0.1);
    color: #0078b4;
    border-color: rgba(0, 120, 180, 0.35);
}

.post-staff-mod-modal .lz-modal-message {
    white-space: pre-wrap;
    word-break: break-word;
}

.reply-staff-reason-group[hidden] {
    display: none !important;
}

.reply-staff-reason-group textarea {
    width: 100%;
    min-height: 56px;
    resize: vertical;
}

.post-edit-details {
    display: inline;
}

.post-edit-badge {
    display: inline;
    cursor: pointer;
    color: var(--link);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    list-style: none;
}

.post-edit-details summary::-webkit-details-marker {
    display: none;
}

.post-edit-popover {
    margin-top: 6px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
    font-size: 12px;
    max-width: 280px;
}

.post-edit-popover .meta {
    color: var(--text-muted);
}

.post-permalink {
    color: inherit;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.post-modified-meta {
    white-space: nowrap;
}

.post-duplicate-modal-panel {
    max-width: 520px;
}

.post-duplicate-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.post-duplicate-modal-panel .meta {
    margin-top: 8px;
}

.post-row {
    border: 1px solid var(--border);
    border-radius: 0;
    margin-bottom: -1px;
    background: var(--bg-panel-alt);
}

.post-row:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.post-row:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: 0;
}

.post-datebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 8px 12px;
    background: var(--bg-row-alt);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 11px;
}

.topic-pagination-bar--compact {
    border-bottom: none;
    margin-bottom: 0;
    padding-top: 12px;
    justify-content: center;
}

.post-datebar-left {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.post-datebar-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.post-datebar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.post-datebar-votes {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-datebar-meta {
    display: inline;
}

.post-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-panel-alt);
    color: var(--text-bright);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
}

.post-action-icon {
    display: none;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

@container (max-width: 620px) {
    .post-body-header-actions .post-action-label {
        display: none;
    }

    .post-body-header-actions .post-action-icon {
        display: block;
    }

    .post-body-header-actions .post-action-btn:not(.post-icon-btn) {
        width: 24px;
        height: 24px;
        min-width: 24px;
        padding: 0;
    }
}

.post-icon-btn {
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    flex-shrink: 0;
}

.post-icon-btn svg {
    width: 14px;
    height: 14px;
    display: block;
}

.post-report-btn {
    color: var(--text);
}

.post-report-btn:hover,
.post-report-btn:focus-visible {
    color: #c45c2a;
    border-color: rgba(196, 92, 42, 0.55);
    background: rgba(196, 92, 42, 0.08);
}

.post-action-btn:hover,
.post-action-btn:focus-visible {
    border-color: var(--link);
    color: var(--link);
}

.post-action-btn-danger {
    border-color: rgba(192, 48, 48, 0.45);
    color: #c03030;
}

.post-action-btn-danger:hover {
    border-color: #c03030;
    color: #fff;
    background: #c03030;
}

.post-action-btn--staff-mod {
    border-color: rgba(0, 174, 239, 0.55);
    color: #00aeef;
    background: rgba(0, 174, 239, 0.1);
}

.post-action-btn--staff-mod:hover,
.post-action-btn--staff-mod:focus-visible,
[data-theme="light"] .post-edit-toggle:hover,
[data-theme="light"] .post-edit-toggle:focus-visible {
    border-color: #00aeef;
    color: #fff;
    background: #00aeef;
}

[data-theme="light"] .post-edit-toggle:hover:not(.post-action-btn--staff-mod),
[data-theme="light"] .post-edit-toggle:focus-visible:not(.post-action-btn--staff-mod) {
    border-color: #2470c4;
    color: #fff;
    background: #2470c4;
}

.post-action-btn-danger--staff-mod {
    border-color: rgba(155, 89, 182, 0.55);
    color: #9b59b6;
    background: rgba(155, 89, 182, 0.1);
}

.post-action-btn-danger--staff-mod:hover,
.post-action-btn-danger--staff-mod:focus-visible {
    border-color: #9b59b6;
    color: #fff;
    background: #9b59b6;
}

.post-owner-form {
    display: inline;
}

.post-row-deleted .post-body .post-content {
    opacity: 0.65;
}

.post-edit-panel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.post-edit-archives {
    margin-top: 8px;
}

.post-edit-archives summary {
    display: grid;
    grid-template-columns: var(--seg-chevron-col, 11px) minmax(0, 1fr);
    column-gap: var(--seg-chevron-gap, 6px);
    align-items: center;
    list-style: none;
    cursor: pointer;
    line-height: 1.45;
}

.post-edit-archives summary::-webkit-details-marker {
    display: none;
}

.post-edit-archives summary::marker {
    content: none;
}

.post-edit-archives summary::before {
    content: '';
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid currentColor;
    transition: transform 0.15s ease;
}

.post-edit-archives[open] summary::before {
    transform: rotate(90deg);
}

.post-duplicate-compact-row,
.post-edit-archives summary {
    --seg-chevron-col: 11px;
    --seg-chevron-gap: 6px;
}

.post-archive-item {
    margin-top: 6px;
    padding: 6px 8px;
    background: var(--bg-panel-alt);
    border-radius: 4px;
}

.post-row-inner {
    display: grid;
    grid-template-columns: 200px 1fr;
    min-height: 120px;
}

.post-userpanel {
    padding: 0 12px 14px;
    border-right: 1px solid var(--border);
    background: var(--bg-panel);
    font-size: 12px;
    text-align: center;
}

.post-userpanel-name {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 -12px 10px;
    padding: 12px 12px 8px;
    min-height: 43px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--bg-panel-alt);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-bright);
    text-align: center;
    line-height: 1.45;
}

[data-theme="light"] .post-userpanel-name {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.post-userpanel-avatar {
    position: relative;
    display: flex;
    justify-content: center;
    margin-top: 4px;
    margin-bottom: 8px;
}

.post-userpanel-avatar .post-presence-dot {
    position: absolute;
    right: calc(50% - 40px);
    bottom: 2px;
}

.post-claim-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    color: #7a93a8;
    line-height: 0;
    opacity: 0.8;
}

.post-claim-mark svg {
    display: block;
}

[data-theme="light"] .post-claim-mark {
    color: #5a738a;
}

.post-userpanel-rank {
    margin: 0 0 10px;
}

.post-presence-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.post-presence-dot.is-online {
    background: #3dba6a;
    box-shadow: 0 0 0 1.5px rgba(61, 186, 106, 0.35);
}

.post-presence-dot.is-offline {
    background: #8a94a6;
    box-shadow: 0 0 0 1.5px rgba(138, 148, 166, 0.25);
}

.post-body-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.post-body-votes {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-body-toolbar .post-vote-score {
    font-size: 12px;
    min-height: 28px;
    padding: 5px 10px;
}

.post-userpanel-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.user-avatar-wrap,
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-wrap .user-avatar,
.user-avatar img.user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-initials {
    border-radius: 50%;
    background: hsl(var(--avatar-hue, 210) var(--avatar-sat, 55%) var(--avatar-light, 42%));
    color: #fff;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 0.02em;
    line-height: 1;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

.post-userpanel-name-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    max-width: 100%;
    min-width: 0;
}

.post-userpanel-name-row .author {
    min-width: 0;
}

.post-stat-badge-wrap {
    position: relative;
}

.post-stat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 28px;
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-panel-alt);
    color: var(--text-bright);
    font-size: 12px;
    font-weight: 700;
    font-style: normal;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.post-stat-badge--positive {
    color: #2fbd5c;
    border-color: rgba(47, 189, 92, 0.45);
    background: rgba(47, 189, 92, 0.12);
}

.post-stat-badge--negative {
    color: #e04a4a;
    border-color: rgba(224, 74, 74, 0.45);
    background: rgba(224, 74, 74, 0.12);
}

.post-stat-badge:hover,
.post-stat-badge:focus-visible {
    border-color: var(--link);
    color: var(--text-bright);
    background: rgba(36, 112, 196, 0.08);
}

.post-stat-badge--positive:hover,
.post-stat-badge--positive:focus-visible {
    color: #3dd66f;
    border-color: rgba(47, 189, 92, 0.65);
    background: rgba(47, 189, 92, 0.2);
}

.post-stat-badge--negative:hover,
.post-stat-badge--negative:focus-visible {
    color: #f05a5a;
    border-color: rgba(224, 74, 74, 0.65);
    background: rgba(224, 74, 74, 0.2);
}

[data-theme="light"] .post-stat-badge--positive {
    color: #1e7a3f;
    border-color: rgba(30, 122, 63, 0.45);
    background: rgba(30, 122, 63, 0.1);
}

[data-theme="light"] .post-stat-badge--negative {
    color: #a82828;
    border-color: rgba(168, 40, 40, 0.45);
    background: rgba(168, 40, 40, 0.1);
}

[data-theme="light"] .post-stat-badge--positive:hover,
[data-theme="light"] .post-stat-badge--positive:focus-visible {
    color: #1e7a3f;
    border-color: rgba(30, 122, 63, 0.65);
    background: rgba(30, 122, 63, 0.16);
}

[data-theme="light"] .post-stat-badge--negative:hover,
[data-theme="light"] .post-stat-badge--negative:focus-visible {
    color: #a82828;
    border-color: rgba(168, 40, 40, 0.65);
    background: rgba(168, 40, 40, 0.16);
}

.post-stat-badge-wrap .tooltip-popover.post-stat-tooltip {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    min-width: 180px;
    max-width: 220px;
    text-align: center;
}

.tooltip-popover.post-stat-tooltip.is-fixed {
    z-index: 520;
}

.post-userpanel-rank .group-badge {
    font-size: 10px;
}

.post-body {
    padding: 12px 14px;
    min-width: 0;
}

.post-body .post-content {
    margin: 0;
}

.post-mod-form {
    margin-top: 10px;
}

.post-mod-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.post-mod-actions .post-spam-meta {
    margin: 0;
    min-width: 0;
    line-height: 1.3;
}

@media (min-width: 721px) {
    .post-mod-actions {
        flex-wrap: nowrap;
    }

    .post-mod-actions .post-spam-meta {
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.post-mod-actions .post-mod-form {
    display: flex;
    margin: 0;
}

.post-mod-actions .button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.5rem;
    min-height: 28px;
    padding: 4px 12px;
    font-size: 11px;
}

.post-vote-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.post-vote-score {
    min-width: 28px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-bright);
}

.post-vote-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    min-height: 20px;
    padding: 1px 6px;
    margin-left: 2px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-panel-alt);
    color: var(--text-bright);
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    vertical-align: middle;
}

.post-vote-badge--positive {
    color: #2a9d52;
    border-color: rgba(42, 157, 82, 0.45);
}

.post-vote-badge--negative {
    color: #d64545;
    border-color: rgba(214, 69, 69, 0.45);
}

[data-theme="light"] .post-vote-badge--positive {
    color: #1f7a3f;
}

[data-theme="light"] .post-vote-badge--negative {
    color: #b83232;
}

.post-vote-form {
    display: inline-flex;
    margin: 0;
}

.post-vote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-panel-alt);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

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

.post-vote-btn:hover {
    background: var(--bg-panel);
    color: var(--text-bright);
    border-color: var(--link);
}

.post-vote-btn--up:hover {
    color: #2f9d58;
    border-color: rgba(47, 157, 88, 0.5);
}

.post-vote-btn--down:hover {
    color: #c03030;
    border-color: rgba(192, 48, 48, 0.5);
}

.post-vote-btn.is-active {
    color: #fff;
}

.post-vote-btn--up.is-active {
    background: #3dba6a;
    border-color: #3dba6a;
}

.post-vote-btn--down.is-active {
    background: #c03030;
    border-color: #c03030;
}

.topic-share-wrap {
    display: inline-flex;
}

.topic-share-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel-alt);
    color: var(--text-bright);
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.topic-share-trigger svg {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
}

.topic-share-trigger:hover,
.topic-share-trigger:focus-visible {
    border-color: var(--link);
    color: var(--link);
    background: var(--bg-panel);
}

.topic-share-modal-dialog {
    width: min(100%, 560px);
    max-width: min(560px, calc(100vw - 32px));
}

.topic-share-modal-lead {
    margin: -4px 0 16px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.45;
}

.topic-share-modal-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.topic-share-modal-item,
.topic-share-modal-extra-item {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-panel-alt);
    color: var(--text-bright);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.topic-share-modal-item {
    flex-direction: column;
    gap: 8px;
    min-height: 92px;
    width: 100%;
    min-width: 0;
    padding: 12px 8px;
    text-align: center;
}

.topic-share-modal-item:hover,
.topic-share-modal-item:focus-visible,
.topic-share-modal-extra-item:hover,
.topic-share-modal-extra-item:focus-visible {
    background: var(--bg-panel);
    color: var(--link);
    border-color: var(--link);
}

.topic-share-modal-item--facebook:hover,
.topic-share-modal-item--facebook:focus-visible {
    color: #1877f2;
    border-color: #1877f2;
}

.topic-share-modal-item--messenger:hover,
.topic-share-modal-item--messenger:focus-visible {
    color: #0084ff;
    border-color: #0084ff;
}

.topic-share-modal-item--x:hover,
.topic-share-modal-item--x:focus-visible {
    color: var(--text-bright);
    border-color: var(--text-bright);
}

.topic-share-modal-item--whatsapp:hover,
.topic-share-modal-item--whatsapp:focus-visible {
    color: #25d366;
    border-color: #25d366;
}

.topic-share-modal-item--telegram:hover,
.topic-share-modal-item--telegram:focus-visible {
    color: #26a5e4;
    border-color: #26a5e4;
}

.topic-share-modal-item--instagram:hover,
.topic-share-modal-item--instagram:focus-visible {
    color: #e4405f;
    border-color: #e4405f;
}

.topic-share-modal-item--tiktok:hover,
.topic-share-modal-item--tiktok:focus-visible {
    color: #ee1d52;
    border-color: #ee1d52;
}

.topic-share-modal-item--linkedin:hover,
.topic-share-modal-item--linkedin:focus-visible {
    color: #0a66c2;
    border-color: #0a66c2;
}

.topic-share-modal-item--snapchat:hover,
.topic-share-modal-item--snapchat:focus-visible {
    color: #c4b800;
    border-color: #c4b800;
}

.topic-share-modal-item--teams:hover,
.topic-share-modal-item--teams:focus-visible {
    color: #6264a7;
    border-color: #6264a7;
}

.topic-share-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.topic-share-modal-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.topic-share-modal-label {
    display: block;
    width: 100%;
    min-width: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.topic-share-modal-extra {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.topic-share-modal-extra-item {
    flex-direction: row;
    gap: 10px;
    min-height: 44px;
    padding: 10px 14px;
    width: 100%;
}

.topic-share-modal-extra-item .topic-share-modal-label {
    width: auto;
    font-size: 12px;
}

@media (max-width: 520px) {
    .topic-share-modal-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .topic-share-modal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topic-share-modal-extra {
        grid-template-columns: 1fr;
    }
}

.topic-share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.topic-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel-alt);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.topic-share-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.topic-share-btn:hover,
.topic-share-btn:focus-visible {
    background: var(--bg-panel);
    color: var(--link);
    border-color: var(--link);
}

.topic-share-btn--facebook:hover,
.topic-share-btn--facebook:focus-visible {
    color: #1877f2;
    border-color: #1877f2;
}

.topic-share-btn--messenger:hover,
.topic-share-btn--messenger:focus-visible {
    color: #0084ff;
    border-color: #0084ff;
}

.topic-share-btn--x:hover,
.topic-share-btn--x:focus-visible {
    color: var(--text-bright);
    border-color: var(--text-bright);
}

.topic-share-btn--whatsapp:hover,
.topic-share-btn--whatsapp:focus-visible {
    color: #25d366;
    border-color: #25d366;
}

.topic-share-btn--telegram:hover,
.topic-share-btn--telegram:focus-visible {
    color: #26a5e4;
    border-color: #26a5e4;
}

.topic-share-btn--instagram:hover,
.topic-share-btn--instagram:focus-visible {
    color: #e4405f;
    border-color: #e4405f;
}

.topic-share-btn--tiktok:hover,
.topic-share-btn--tiktok:focus-visible {
    color: #ee1d52;
    border-color: #ee1d52;
}

.topic-share-btn--linkedin:hover,
.topic-share-btn--linkedin:focus-visible {
    color: #0a66c2;
    border-color: #0a66c2;
}

.topic-share-btn--snapchat:hover,
.topic-share-btn--snapchat:focus-visible {
    color: #fffc00;
    border-color: #d4c500;
}

.topic-share-btn--teams:hover,
.topic-share-btn--teams:focus-visible {
    color: #6264a7;
    border-color: #6264a7;
}

.topic-subscribe-form {
    display: inline-flex;
    margin: 0;
}

.topic-subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel-alt);
    color: var(--text-bright);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.topic-subscribe-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.topic-subscribe-btn:hover {
    border-color: var(--link);
    color: var(--link);
}

.topic-subscribe-btn.is-active {
    background: var(--link);
    border-color: var(--link);
    color: #fff;
}

.topic-bump-form {
    display: inline-flex;
    margin: 0;
}

.topic-bump-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel-alt);
    color: var(--text-bright);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.topic-bump-btn:hover:not(:disabled) {
    border-color: var(--link);
    color: var(--link);
}

.topic-bump-btn.is-cooldown,
.topic-bump-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.topic-bump-hint {
    font-size: 11px;
    margin-left: 4px;
}

.topic-posts-reply-divider {
    height: 0;
    margin: 18px 0 20px;
    border: 0;
    border-top: 1px solid var(--border);
}

.author {
    color: var(--link);
    font-weight: 600;
}

.author.unknown {
    color: #666;
}

/* Badges */
.badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #1a3050;
    color: var(--link);
    font-size: 9px;
    vertical-align: middle;
    border: 1px solid #2a5080;
    font-weight: 600;
    text-transform: uppercase;
}

[data-theme="light"] .badge {
    background: #e8f1fb;
    color: #1a4f8b;
    border-color: #9bb8d4;
}

.badge.badge-pending {
    background: #3a3000;
    color: #ffd45a;
    border-color: #665500;
}

[data-theme="light"] .badge.badge-pending {
    background: #fff4d6;
    color: #7a5600;
    border-color: #e0b84a;
}

.badge.pinned {
    margin-left: 0;
    padding: 1px 6px;
    border-radius: 4px;
    line-height: 1.2;
    background: #0a2840;
    color: #66ccff;
    border-color: #1a5080;
}

[data-theme="light"] .badge.pinned {
    background: #fff4d6;
    color: #9a6b00;
    border-color: #e3c56a;
}

.badge.disabled {
    background: #222;
    color: #666;
    border-color: #333;
}

.badge.status-pending { background: #3a3000; color: #ffcc00; border-color: #665500; }
.badge.status-approved { background: #0a3020; color: #66cc99; border-color: #1a5040; }
.badge.status-cancelled { background: #222; color: #aaa; border-color: #333; }
.badge.status-revoked { background: #3a1515; color: #e08080; border-color: #662222; }
.badge.status-claimed { background: #0a2040; color: #66b3ff; border-color: #1a4080; }
.badge.status-open { background: #3a3000; color: #ffcc00; border-color: #665500; }
.badge.status-answered { background: #0a2040; color: #66b3ff; border-color: #1a4080; }
.badge.status-closed { background: #222; color: #aaa; border-color: #333; }

.account-status-badge {
    margin-left: 0;
    text-transform: none;
    letter-spacing: 0;
}

.badge.status-active {
    background: #0a3020;
    color: #6ecf9a;
    border-color: #1a5040;
}

.badge.status-suspended {
    background: #3a1414;
    color: #ff8a8a;
    border-color: #6a2424;
}

.badge.status-unknown {
    background: #222;
    color: #aaa;
    border-color: #333;
}

[data-theme="light"] .badge.status-active {
    background: #e8f5ee;
    color: #1a5c3a;
    border-color: #a8d4bc;
}

[data-theme="light"] .badge.status-suspended {
    background: #fdecec;
    color: #9b1c1c;
    border-color: #f0b4b4;
}

[data-theme="light"] .badge.status-open {
    background: #fff4d6;
    color: #8a6d00;
    border-color: #e3c56a;
}

[data-theme="light"] .badge.status-answered {
    background: #e8f1fb;
    color: #1a5fad;
    border-color: #9bb8d4;
}

[data-theme="light"] .badge.status-closed {
    background: #eef1f4;
    color: #5a6570;
    border-color: #c5ced8;
}

/* Buttons */
.button,
.search-form button,
.auth-form button[type="submit"],
.shoutbox-form .shoutbox-send-btn {
    display: inline-block;
    padding: 7px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: linear-gradient(to bottom, var(--nav-top), var(--nav-bottom));
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.button.secondary {
    background: linear-gradient(to bottom, #333, #222);
    border-color: #444;
    color: #e8e8e8;
}

[data-theme="light"] .button.secondary {
    background: linear-gradient(to bottom, #eef2f6, #d8dee6);
    border-color: var(--border);
    color: var(--text-bright);
}

[data-theme="light"] .button:not(.secondary),
[data-theme="light"] .search-form button,
[data-theme="light"] .auth-form button[type="submit"],
[data-theme="light"] .shoutbox-form .shoutbox-send-btn,
[data-theme="light"] a.button:not(.secondary) {
    color: #fff;
}

.button:hover,
.search-form button:hover,
.auth-form button[type="submit"]:hover,
.shoutbox-form .shoutbox-send-btn:hover {
    filter: brightness(1.12);
    color: #fff;
}

[data-theme="light"] .button.secondary:hover {
    color: var(--text-bright);
    filter: brightness(1.03);
}

[data-theme="light"] .button:not(.secondary):hover,
[data-theme="light"] .search-form button:hover,
[data-theme="light"] .auth-form button[type="submit"]:hover,
[data-theme="light"] .shoutbox-form .shoutbox-send-btn:hover,
[data-theme="light"] a.button:not(.secondary):hover {
    color: #fff;
}

.button.small {
    padding: 4px 10px;
    font-size: 11px;
}

.button-link {
    background: none;
    border: none;
    color: var(--text-bright);
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-decoration: none;
}

.button-link:hover {
    color: var(--link);
}

/* Forms */
.search-form {
    display: flex;
    gap: 6px;
}

.search-form.large {
    max-width: 100%;
}

.search-form input[type="search"],
.search-form input[type="text"],
.form-group input[type="search"],
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group input[type="time"],
.form-group textarea,
.staff-user-mod-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.staff-user-mod-field textarea,
.shoutbox-form input[type="text"] {
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel-alt);
    color: var(--text-bright);
    font: inherit;
    font-size: 13px;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* Native number spinners don't match the themed UI; type or use keyboard arrows. */
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group input[type="time"] {
    min-height: 38px;
    color-scheme: dark;
}

[data-theme="light"] .form-group input[type="date"],
[data-theme="light"] .form-group input[type="datetime-local"],
[data-theme="light"] .form-group input[type="time"] {
    color-scheme: light;
}

.form-group input[type="date"]::-webkit-datetime-edit,
.form-group input[type="datetime-local"]::-webkit-datetime-edit,
.form-group input[type="time"]::-webkit-datetime-edit {
    padding: 0;
    color: inherit;
    font: inherit;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.form-group input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.72;
    margin-left: 6px;
}

html:not([data-theme="light"]) .form-group input[type="date"]::-webkit-calendar-picker-indicator,
html:not([data-theme="light"]) .form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html:not([data-theme="light"]) .form-group input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
}

.form-group select,
.form-select,
.search-form select,
.admin-form select,
.admin-user-form-row select,
.staff-user-mod-field select,
.topic-view-select,
.topic-jump-select {
    width: 100%;
    max-width: 100%;
    padding: 8px 34px 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--bg-panel-alt);
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    color: var(--text-bright);
    font: inherit;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-group select:hover:not(:disabled),
.form-select:hover:not(:disabled),
.search-form select:hover:not(:disabled),
.admin-form select:hover:not(:disabled),
.admin-user-form-row select:hover:not(:disabled),
.staff-user-mod-field select:hover:not(:disabled),
.topic-view-select:hover:not(:disabled),
.topic-jump-select:hover:not(:disabled) {
    border-color: var(--border-light);
}

.form-group select:focus-visible,
.form-select:focus-visible,
.search-form select:focus-visible,
.admin-form select:focus-visible,
.admin-user-form-row select:focus-visible,
.staff-user-mod-field select:focus-visible,
.topic-view-select:focus-visible,
.topic-jump-select:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(61, 143, 217, 0.22);
}

[data-theme="light"] .form-group select:focus-visible,
[data-theme="light"] .form-select:focus-visible,
[data-theme="light"] .search-form select:focus-visible,
[data-theme="light"] .admin-form select:focus-visible,
[data-theme="light"] .admin-user-form-row select:focus-visible,
[data-theme="light"] .staff-user-mod-field select:focus-visible,
[data-theme="light"] .topic-view-select:focus-visible,
[data-theme="light"] .topic-jump-select:focus-visible {
    box-shadow: 0 0 0 2px rgba(36, 112, 196, 0.18);
}

.form-group select:disabled,
.form-select:disabled,
.search-form select:disabled,
.admin-form select:disabled,
.admin-user-form-row select:disabled,
.topic-view-select:disabled,
.topic-jump-select:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.form-group select option,
.form-select option,
.search-form select option,
.admin-form select option,
.admin-user-form-row select option,
.staff-user-mod-field select option,
.topic-view-select option,
.topic-jump-select option {
    background: var(--bg-panel);
    color: var(--text-bright);
}

.topic-view-select {
    width: auto;
    min-width: 72px;
    padding: 6px 30px 6px 8px;
    font-size: 12px;
}

.topic-jump-select {
    width: auto;
    margin-left: 0;
    min-width: 180px;
    max-width: min(100%, 320px);
}

.topic-toolbar .topic-jump-select {
    width: 136px;
    min-width: 0;
    max-width: 136px;
}

.admin-form .form-row select {
    width: 100%;
    min-width: 0;
}

.search-form select {
    width: auto;
    min-width: 120px;
    flex: 0 1 auto;
}

.search-form input,
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group textarea,
.staff-user-mod-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.staff-user-mod-field textarea,
.staff-user-mod-field select {
    width: 100%;
    max-width: 100%;
}

.form-group input[type="search"]::-webkit-search-decoration,
.form-group input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.form-group textarea {
    min-height: 110px;
    resize: vertical;
}

.staff-user-mod-field input:hover:not(:disabled):not(:read-only),
.staff-user-mod-field textarea:hover:not(:disabled):not(:read-only) {
    border-color: var(--border-light);
}

.staff-user-mod-field input:focus-visible,
.staff-user-mod-field textarea:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(61, 143, 217, 0.22);
}

[data-theme="light"] .staff-user-mod-field input:focus-visible,
[data-theme="light"] .staff-user-mod-field textarea:focus-visible {
    box-shadow: 0 0 0 2px rgba(36, 112, 196, 0.18);
}

.staff-user-mod-field input::placeholder,
.staff-user-mod-field textarea::placeholder {
    color: #7788aa;
    opacity: 1;
}

[data-theme="light"] .staff-user-mod-field input::placeholder,
[data-theme="light"] .staff-user-mod-field textarea::placeholder {
    color: #8b97a8;
}

.auth-form {
    display: grid;
    gap: 12px;
    margin-top: 10px;
}

.auth-form .form-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 10px;
}

.auth-form .form-actions .button {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    box-sizing: border-box;
}

@media (max-width: 720px) {
    .auth-form .form-actions {
        flex-direction: column-reverse;
    }
}

.form-group {
    display: grid;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-bright);
    font-size: 12px;
}

.form-hint {
    color: #666;
    font-size: 11px;
}

.auth-panel {
    max-width: 420px;
    margin: 0 auto;
}

.auth-links {
    margin-top: 12px;
    color: #777;
}

.auth-links--center {
    text-align: center;
}

.oauth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 10px;
    color: #666;
    font-size: 11px;
    text-transform: lowercase;
}

.oauth-divider::before,
.oauth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .oauth-divider::before,
[data-theme="light"] .oauth-divider::after {
    background: rgba(0, 0, 0, 0.08);
}

.oauth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #1f1f1f;
    color: var(--text-bright);
    padding: 10px 14px;
    border-radius: var(--radius);
    transition: background 0.12s ease, border-color 0.12s ease;
    cursor: pointer;
    font-family: inherit;
}

.oauth-button:hover {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-bright);
}

[data-theme="light"] .oauth-button {
    background: #fff;
    color: #1f1f1f;
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .oauth-button:hover {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.2);
}

.oauth-google-icon {
    flex-shrink: 0;
}

.form-error-list {
    margin: 0;
    padding-left: 16px;
}

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 12px;
}

.alert-success {
    background: #0a2018;
    border: 1px solid #1a5040;
    color: var(--success);
}

.alert-error {
    background: #200a0a;
    border: 1px solid #501a1a;
    color: var(--error);
}

.alert-info {
    background: rgba(102, 204, 255, 0.08);
    border: 1px solid rgba(102, 204, 255, 0.35);
    color: var(--text-bright, var(--text));
}

/* Pagination */
.pagination ul {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination a,
.pagination .current,
.pagination .ellipsis {
    display: inline-block;
    min-width: 28px;
    text-align: center;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel-alt);
    color: var(--link);
    font-size: 12px;
}

.pagination .current {
    background: linear-gradient(to bottom, var(--nav-top), var(--nav-bottom));
    color: #fff;
    border-color: transparent;
}

.pagination .ellipsis {
    color: #666;
    border: none;
    background: none;
}

/* Profile */
.profile-panel {
    padding: 16px 18px;
    container-type: inline-size;
    container-name: profile-panel;
}

.profile-identity {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px 24px;
    min-width: 0;
}

.profile-identity-lead {
    display: flex;
    align-items: stretch;
    gap: 12px 14px;
    flex: 0 0 auto;
    min-width: 0;
    max-width: min(280px, 36%);
}

.profile-identity-avatar-col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    flex: 0 0 auto;
    width: 88px;
}

.profile-identity-avatar {
    flex-shrink: 0;
}

.profile-identity-avatar .user-avatar-wrap,
.profile-identity-avatar .user-avatar {
    width: 88px;
    height: 88px;
}

.profile-identity-avatar .user-avatar-initials {
    font-size: 26px;
}

.profile-identity-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.profile-identity-action {
    display: flex;
    width: 100%;
}

.profile-identity-action--claim {
    margin-top: auto;
}

.profile-identity-action .button,
.profile-identity-action .profile-claim-btn,
.profile-panel .profile-report-btn,
.profile-panel .profile-header-actions .button,
.profile-panel .profile-social-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 5px;
    box-sizing: border-box;
    white-space: nowrap;
}

.profile-identity-action .button,
.profile-identity-action .profile-claim-btn {
    width: 100%;
}

.profile-panel .profile-header-actions .button,
.profile-panel .profile-social-actions .button,
.profile-panel .profile-identity-actions .profile-report-btn,
.profile-panel .profile-identity-actions .profile-claim-btn {
    width: auto;
    flex: 0 0 auto;
}

.profile-identity-heading {
    min-width: 0;
    flex: 1 1 auto;
}

.profile-identity-heading h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-identity-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.profile-legacy-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-panel-alt);
    color: var(--text);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.profile-reputation-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-panel-alt);
    color: var(--text-bright);
    text-decoration: none;
    line-height: 1.2;
    width: fit-content;
    max-width: 100%;
}

a.profile-reputation-chip:hover,
a.profile-reputation-chip:focus-visible {
    border-color: var(--link);
    color: var(--text-bright);
}

.profile-reputation-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

.profile-reputation-value {
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.profile-reputation-chip--positive {
    border-color: rgba(47, 189, 92, 0.45);
    background: rgba(47, 189, 92, 0.12);
}

.profile-reputation-chip--positive .profile-reputation-value {
    color: #2fbd5c;
}

.profile-reputation-chip--positive .profile-reputation-label {
    color: rgba(47, 189, 92, 0.85);
}

.profile-reputation-chip--negative {
    border-color: rgba(224, 74, 74, 0.45);
    background: rgba(224, 74, 74, 0.12);
}

.profile-reputation-chip--negative .profile-reputation-value {
    color: #e04a4a;
}

.profile-reputation-chip--negative .profile-reputation-label {
    color: rgba(224, 74, 74, 0.85);
}

a.profile-reputation-chip--positive:hover,
a.profile-reputation-chip--positive:focus-visible {
    border-color: rgba(47, 189, 92, 0.7);
    background: rgba(47, 189, 92, 0.2);
}

a.profile-reputation-chip--negative:hover,
a.profile-reputation-chip--negative:focus-visible {
    border-color: rgba(224, 74, 74, 0.7);
    background: rgba(224, 74, 74, 0.2);
}

[data-theme="light"] .profile-reputation-chip--positive {
    border-color: rgba(30, 122, 63, 0.45);
    background: rgba(30, 122, 63, 0.1);
}

[data-theme="light"] .profile-reputation-chip--positive .profile-reputation-value {
    color: #1e7a3f;
}

[data-theme="light"] .profile-reputation-chip--positive .profile-reputation-label {
    color: rgba(30, 122, 63, 0.9);
}

[data-theme="light"] .profile-reputation-chip--negative {
    border-color: rgba(168, 40, 40, 0.45);
    background: rgba(168, 40, 40, 0.1);
}

[data-theme="light"] .profile-reputation-chip--negative .profile-reputation-value {
    color: #a82828;
}

[data-theme="light"] .profile-reputation-chip--negative .profile-reputation-label {
    color: rgba(168, 40, 40, 0.9);
}

.profile-detail-badges {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 8px;
    margin: 0;
    flex: 1 1 0;
    min-width: 0;
    align-content: start;
}

.profile-detail-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel-alt);
}

.profile-detail-badge dt {
    margin: 0;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #777;
    white-space: nowrap;
}

.profile-detail-badge dd {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-bright);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.profile-detail-badge dd a {
    color: inherit;
    text-decoration: none;
}

.profile-detail-badge dd a:hover,
.profile-detail-badge dd a:focus-visible {
    color: var(--link);
}

@container profile-panel (max-width: 760px) {
    .profile-identity {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .profile-identity-lead {
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }

    .profile-identity-avatar-col {
        flex: 0 0 88px;
        width: 88px;
        max-width: 88px;
    }

    .profile-identity-main {
        flex: 1 1 0;
        min-width: 0;
        overflow: hidden;
    }

    .profile-detail-badges {
        flex: 1 1 auto;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr;
    gap: 4px 12px;
}

.profile-grid dt {
    color: #777;
    font-weight: 600;
}

.profile-grid dd {
    margin: 0;
    color: var(--text-bright);
}

.profile-claim-note {
    margin: 0;
}

.profile-panel .claim-cta {
    margin: 14px 0 0;
}

.profile-header-row + .alert {
    margin-top: 28px;
}

.profile-header-row h2 {
    margin: 0;
}

.profile-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}

.profile-identity-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    flex: 1 0 100%;
    width: 100%;
    margin: 0;
}

/* Flatten nested social wrapper so Segnala + social buttons share one row. */
.profile-identity-actions .profile-social-actions {
    display: contents;
}

.profile-pm-notice {
    margin: 8px 0 0;
}

.profile-social-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.profile-social-form {
    display: inline-flex;
    margin: 0;
}

.profile-social-form.inline {
    display: inline;
}

.profile-privacy-form {
    max-width: 420px;
}

.profile-notifications-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 14px;
    align-items: stretch;
}

.profile-notifications-layout > .panel {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.profile-notify-actions {
    margin: auto 0 0;
}

.profile-notify-rows {
    display: grid;
    gap: 10px;
    margin: 0 0 12px;
}

.profile-notify-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 16px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel-alt);
}

.profile-notify-label {
    color: #777;
    font-weight: 600;
    font-size: 12px;
}

.profile-notify-pm-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 12px;
    max-width: 560px;
    margin-top: 10px;
}

.profile-notify-pm-form .form-group {
    flex: 1 1 260px;
    margin: 0;
    min-width: 0;
}

.profile-notify-pm-form .button {
    flex: 0 0 auto;
    width: auto;
}

.profile-notify-pm-form select {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 720px) {
    .profile-notifications-layout {
        grid-template-columns: 1fr;
    }

    .profile-notify-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .profile-notify-pm-form {
        max-width: none;
    }

    .profile-notify-pm-form .button {
        width: 100%;
    }
}

.profile-pm-panel .profile-privacy-form {
    max-width: none;
}

.profile-pm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.profile-pm-header h3 {
    margin: 0;
}

.profile-pm-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.profile-pm-form-row {
    display: flex;
    align-items: flex-end;
    gap: 10px 12px;
    flex-wrap: wrap;
}

.profile-pm-field {
    flex: 1 1 220px;
    min-width: 0;
    margin: 0;
}

.profile-pm-field select {
    width: 100%;
    max-width: 360px;
}

.profile-pm-save {
    flex: 0 0 auto;
    white-space: nowrap;
}

.profile-pm-note {
    margin: 10px 0 0;
}

.button.danger-outline {
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
}

.button.danger-outline:hover {
    background: rgba(200, 50, 50, 0.12);
    color: var(--error);
}

[data-theme="light"] .button.danger-outline {
    border-color: #c53030;
    color: #c53030;
}

[data-theme="light"] .button.danger-outline:hover {
    background: rgba(197, 48, 48, 0.1);
}

.button.warning-outline {
    background: transparent;
    border: 1px solid #d4a017;
    color: #e0b33a;
}

.button.warning-outline:hover {
    background: rgba(212, 160, 23, 0.14);
    color: #f0c14b;
}

[data-theme="light"] .button.warning-outline {
    border-color: #b8860b;
    color: #9a7209;
}

[data-theme="light"] .button.warning-outline:hover {
    background: rgba(184, 134, 11, 0.12);
    color: #8a6608;
}

.button.success-outline {
    background: transparent;
    border: 1px solid #2fbd5c;
    color: #3dcf6c;
}

.button.success-outline:hover {
    background: rgba(47, 189, 92, 0.14);
    color: #4fda7a;
}

[data-theme="light"] .button.success-outline {
    border-color: #1e7a3f;
    color: #1a6b37;
}

[data-theme="light"] .button.success-outline:hover {
    background: rgba(30, 122, 63, 0.12);
    color: #165a2e;
}

a.post-stat-badge {
    text-decoration: none;
}

/* Tabs */
.tab-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tab-nav a {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel-alt);
    color: var(--link);
    font-size: 12px;
}

.tab-nav a.active {
    background: linear-gradient(to bottom, var(--nav-top), var(--nav-bottom));
    border-color: transparent;
    color: #fff;
}

/* Search results */
.search-page-intro {
    margin-bottom: 14px;
}

.search-page-intro h2 {
    margin: 0 0 4px;
}

.search-page-lead {
    margin: 0;
    color: #888;
    font-size: 12px;
    line-height: 1.45;
}

.search-page-form {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 4px;
}

.search-page-form .search-form-row {
    display: flex;
    flex-flow: row nowrap;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.search-page-form .search-form-row input[type="search"] {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    max-width: none;
}

.search-page-form .search-form-row button {
    flex-shrink: 0;
    align-self: stretch;
}

.search-form-hint {
    margin: 0;
}

.search-results-summary {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text);
}

.search-results-summary strong {
    color: var(--text-bright);
    font-variant-numeric: tabular-nums;
}

.search-tips-panel {
    margin-top: 12px;
}

.search-tips-title {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-bright);
}

.search-tips-list {
    margin: 0;
    padding-left: 18px;
    color: #888;
    font-size: 12px;
    line-height: 1.55;
}

.search-tips-list li + li {
    margin-top: 4px;
}

.search-empty {
    padding: 8px 0 4px;
}

.search-empty-title {
    margin: 0 0 6px;
    font-weight: 600;
    color: var(--text-bright);
}

.search-results {
    display: grid;
    gap: 10px;
}

.search-result {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--bg-panel-alt);
}

.search-result-header {
    margin-bottom: 8px;
}

.search-result-topic {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.35;
}

.search-result-topic a {
    color: var(--link);
    font-weight: 600;
    text-decoration: none;
}

.search-result-topic a:hover {
    color: var(--link-hover);
}

.search-result-meta {
    color: #777;
    font-size: 11px;
    line-height: 1.45;
}

.search-result-forum a {
    color: var(--link);
    font-weight: 500;
}

.search-result-excerpt {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.55;
}

.search-result-excerpt .search-hit {
    padding: 0 2px;
    border-radius: 2px;
    background: rgba(94, 184, 255, 0.22);
    color: var(--text-bright);
    font-weight: 600;
}

[data-theme="light"] .search-result-excerpt .search-hit {
    background: rgba(36, 112, 196, 0.16);
    color: var(--text-bright);
}

.search-result-action {
    margin: 12px 0 0;
    text-align: right;
}

@media (min-width: 721px) {
    .search-result {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title action"
            "meta meta"
            "excerpt excerpt";
        column-gap: 12px;
        row-gap: 4px;
    }

    .search-result-header {
        display: contents;
        margin: 0;
    }

    .search-result-topic {
        grid-area: title;
        margin: 0;
        align-self: center;
    }

    .search-result-meta {
        grid-area: meta;
        margin-bottom: 4px;
    }

    .search-result-excerpt {
        grid-area: excerpt;
        margin: 0;
    }

    .search-result-action {
        grid-area: action;
        margin: 0;
        align-self: center;
        white-space: nowrap;
    }
}

.search-result header {
    margin-bottom: 6px;
    color: #777;
    font-size: 11px;
}

.excerpt {
    margin: 0;
    color: var(--text);
    font-size: 12px;
}

/* Claim / admin */
.claim-review-card {
    margin-bottom: 12px;
}

.claim-review-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.claim-proof {
    margin: 10px 0;
    padding: 10px;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.claim-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.claim-actions textarea {
    width: 100%;
    max-width: 100%;
    resize: vertical;
}

.claim-actions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
    justify-content: flex-end;
}

.claim-actions-buttons .button {
    box-sizing: border-box;
    min-width: 8rem;
    padding-left: 16px;
    padding-right: 16px;
    text-align: center;
}

.claim-review-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.claim-review-auto {
    border-color: #335577;
}

[data-theme="light"] .claim-review-auto {
    border-color: rgba(36, 112, 196, 0.22);
}

.claim-auto-hint {
    margin: 0 0 10px;
}

.claim-method-auto_signature {
    background: #1a3344;
    color: #8ec8ff;
    border-color: #4477aa;
}

.claim-method-manual_request {
    background: #332a1a;
    color: #e0b46a;
    border-color: #886622;
}

.claim-method-user_request {
    background: #1a2a3a;
    color: #9ec4e8;
    border-color: #3a5a7a;
}

.claim-code-inline {
    font-size: 13px;
    padding: 2px 6px;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-bright, #eef4ff);
}

[data-theme="light"] .claim-method-auto_signature {
    background: rgba(36, 112, 196, 0.12);
    color: #1a5fad;
    border-color: rgba(36, 112, 196, 0.4);
}

[data-theme="light"] .claim-method-manual_request {
    background: rgba(180, 120, 20, 0.14);
    color: #8a5a00;
    border-color: rgba(160, 110, 20, 0.4);
}

[data-theme="light"] .claim-method-user_request {
    background: rgba(70, 100, 140, 0.14);
    color: #2f4a6a;
    border-color: rgba(70, 100, 140, 0.4);
}

[data-theme="light"] .claim-code-inline {
    background: var(--bg-panel-alt, #eef2f6);
    border-color: var(--border);
    color: var(--text-bright);
}

.claim-path-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.claim-path-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #0a0a0a;
}

.claim-path-card h4 {
    margin: 0 0 8px;
}

.claim-verify-panel {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #335577;
    border-radius: var(--radius);
    background: #0d1520;
}

.claim-consequences {
    margin-top: 16px;
}

.claim-consequences h4 {
    margin: 0 0 10px;
    font-size: 15px;
}

.claim-consequences-lead {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(61, 143, 217, 0.16);
    border: 1px solid rgba(61, 143, 217, 0.55);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.45;
    color: var(--text-bright, var(--text));
}

.claim-consequences-from,
.claim-consequences-to {
    font-weight: 800;
}

.claim-consequences-to {
    color: var(--accent-glow, var(--accent));
}

[data-theme="light"] .claim-consequences-lead {
    background: rgba(36, 112, 196, 0.1);
    border-color: rgba(36, 112, 196, 0.4);
}

.claim-consequences ul {
    margin: 0;
    padding-left: 1.2rem;
}

.claim-consequences li + li {
    margin-top: 6px;
}

.claim-ack-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.45;
}

.claim-ack-row input {
    margin-top: 3px;
    flex-shrink: 0;
}

.claim-code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 8px 0 12px;
    padding: 10px 12px;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.claim-code-box:hover,
.claim-code-box:focus-visible {
    border-color: var(--accent, #00aeef);
}

.claim-code-box:focus-visible {
    outline: 2px solid var(--accent, #00aeef);
    outline-offset: 2px;
}

.claim-code-box code {
    display: block;
    font-size: 18px;
    padding: 0;
    background: none;
    border: 0;
    letter-spacing: 0.06em;
    color: inherit;
}

.claim-code-copy-aside {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    color: var(--text-muted, #8a96a8);
    font-size: 12px;
}

.claim-code-copy-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.claim-code-copy-done {
    display: none;
}

.claim-code-box.is-copied .claim-code-copy-idle {
    display: none;
}

.claim-code-box.is-copied .claim-code-copy-done {
    display: inline;
}

.claim-code-box.is-copied .claim-code-copy-aside {
    color: #6dca8a;
}

[data-theme="light"] .claim-code-box {
    background: var(--bg-panel-alt, #eef2f6);
}

[data-theme="light"] .claim-code-box.is-copied .claim-code-copy-aside {
    color: #1a7a3a;
}

.claim-steps {
    margin: 8px 0 12px;
    padding-left: 1.25rem;
    color: var(--text, #c8d0dc);
    font-size: 13px;
    line-height: 1.5;
}

.claim-steps li + li {
    margin-top: 4px;
}

.claim-pending-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}

.claim-pending-actions form {
    margin: 0;
}

.claim-pending-links {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    margin-left: 8px;
    white-space: nowrap;
}

.claim-cancel-link-form {
    display: inline;
    margin: 0;
}

.claim-cancel-link {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    color: var(--error, #ff7070);
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.claim-cancel-link:hover,
.claim-cancel-link:focus-visible {
    color: var(--error, #ff7070);
    text-decoration: underline;
}

.inline-form {
    flex: 1;
    min-width: 260px;
}

.admin-panel {
    border-color: #665500;
    background: #1a1800;
}

.panel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.panel-header-row--actions {
    justify-content: flex-end;
    align-items: center;
}

.panel-header-row h2 {
    margin-top: 0;
}

.claim-cta {
    margin-top: 10px;
}

.reply-panel-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 12px;
}

.reply-panel-header h3 {
    margin: 0;
}

.reply-panel-header .reply-form-hint {
    margin: 0 0 0 auto;
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.reply-panel h3 {
    margin-top: 0;
}

.hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.logout-form {
    display: inline;
    margin: 0;
}

.error-panel h2 {
    margin-top: 0;
}

body.maintenance-screen {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: auto;
    background: var(--bg);
    color: var(--text);
}

.maintenance-card {
    flex: 1 1 auto;
    width: min(100%, 480px);
    margin: 0 auto;
    padding: 48px 22px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.maintenance-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.maintenance-brand img {
    display: block;
    width: 88px;
    height: 88px;
}

.maintenance-forum {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-bright);
}

.maintenance-card h1 {
    margin: 0 0 16px;
    font-size: 32px;
    color: var(--text-bright);
}

.maintenance-card p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
}

.maintenance-card .maintenance-retry {
    margin-top: 8px;
}

.maintenance-card .maintenance-contact {
    margin-top: 22px;
    font-size: 13px;
}

.maintenance-card .maintenance-contact a {
    color: var(--link);
    word-break: break-all;
}

.maintenance-footer {
    flex: 0 0 auto;
    width: 100%;
    padding: 16px 18px calc(16px + var(--safe-bottom));
    border-top: 1px solid var(--border);
    text-align: center;
    background: var(--bg);
}

.maintenance-footer .maintenance-copy {
    margin: 0;
    font-size: 11px;
    color: #666;
}

.notice.error {
    color: var(--error);
}

/* PM thread messages */
.pm-messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.pm-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.pm-message-avatar {
    flex-shrink: 0;
    line-height: 0;
}

.pm-message-body {
    flex: 1;
    min-width: 0;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
}

.pm-message-actions {
    margin-left: auto;
}

.pm-message-actions .pm-report-btn {
    font-size: 11px;
    opacity: 0.75;
}

.pm-message-actions .pm-report-btn:hover,
.pm-message-actions .pm-report-btn:focus-visible {
    opacity: 1;
}

.pm-message-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.pm-message-content {
    color: var(--text-bright);
    line-height: 1.45;
}

.pm-compose-existing {
    margin-bottom: 16px;
}

.pm-compose-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 340px);
    gap: 20px;
    align-items: start;
}

.pm-compose-main {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    background: var(--panel-alt, rgba(255, 255, 255, 0.02));
}

.pm-compose-form {
    margin: 0;
}

.pm-compose-hint {
    margin-top: 6px;
}

.pm-compose-send-note {
    margin: 8px 0 0;
}

.pm-compose-recipients {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    background: var(--panel-alt, rgba(255, 255, 255, 0.02));
    max-height: calc(100vh - 220px);
    overflow: auto;
    position: sticky;
    top: calc(var(--desktop-header-h, 72px) + 16px);
}

.pm-compose-recipients-head {
    margin-bottom: 14px;
}

.pm-compose-recipients-heading {
    margin: 0 0 4px;
    font-size: 16px;
}

.pm-compose-recipients-lead {
    margin: 0;
}

.pm-compose-recipients-block + .pm-compose-recipients-block,
.pm-compose-recipients-empty + .pm-compose-recipients-block {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.pm-compose-recipients-title {
    margin: 0 0 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #888);
}

.pm-compose-recipients-hint,
.pm-compose-recipients-empty {
    margin: 0 0 10px;
}

.pm-recipient-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pm-recipient-btn {
    appearance: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg, transparent);
    color: var(--text);
    padding: 6px 12px;
    font: inherit;
    cursor: pointer;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.pm-recipient-btn:hover,
.pm-recipient-btn.is-selected {
    border-color: var(--accent, #6cf);
    color: var(--text-bright, var(--text));
    background: rgba(102, 204, 255, 0.08);
}

.pm-recipient-btn--staff {
    border-radius: 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 120px;
}

.pm-recipient-btn-name {
    font-weight: 600;
}

.pm-recipient-disabled {
    color: var(--text-muted, #888);
    font-size: 13px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 6px 10px;
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0.75;
}

.friends-page-intro {
    margin-top: 0;
}

.friends-table .col-actions {
    width: 260px;
    white-space: nowrap;
}

.friends-presence-cell .presence-detail {
    display: inline;
}

.friends-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pm-inbox-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pm-inbox-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pm-inbox-filters {
    margin: 0;
}

.pm-inbox-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.pm-inbox-filter-row .form-group {
    margin-bottom: 0;
    flex: 1 1 180px;
}

.pm-inbox-clear {
    align-self: center;
}

.pm-inbox-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pm-inbox-tab {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
}

.pm-inbox-tab.is-active,
.pm-inbox-tab:hover {
    border-color: var(--accent, #6cf);
    color: var(--text-bright, var(--text));
}

.pm-inbox-filter-note {
    margin: 0;
}

.pm-inbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pm-inbox-row {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    background: var(--panel-alt, rgba(255, 255, 255, 0.02));
}

.pm-inbox-row--unread-received {
    border-color: rgba(102, 204, 255, 0.45);
    background: rgba(102, 204, 255, 0.08);
}

.pm-inbox-row--unread .pm-inbox-subject {
    font-weight: 700;
}

.pm-inbox-row-link {
    display: block;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
}

.pm-inbox-row-link:hover {
    background: rgba(255, 255, 255, 0.03);
}

.pm-inbox-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.pm-inbox-direction {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.pm-inbox-direction--received {
    background: rgba(102, 204, 255, 0.18);
    color: var(--accent, #6cf);
}

.pm-inbox-direction--sent {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted, #888);
}

.pm-inbox-partner {
    font-weight: 700;
    color: var(--text-bright, var(--text));
}

.pm-inbox-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent, #6cf);
    color: #000;
    font-size: 11px;
    font-weight: 700;
}

.pm-inbox-dates {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    text-align: right;
}

/* Leave room for absolute "Segna letto" so dates don't overlap it on desktop */
.pm-inbox-row:has(.pm-inbox-mark-read) .pm-inbox-dates {
    margin-right: 5.75rem;
}

.pm-inbox-date-line {
    color: var(--text-muted, #888);
    font-size: 11px;
    line-height: 1.3;
    white-space: nowrap;
}

.pm-inbox-date-line--last {
    color: var(--text-bright, var(--text));
    font-size: 12px;
}

.pm-inbox-date-label {
    display: inline-block;
    min-width: 42px;
    margin-right: 4px;
    opacity: 0.85;
}

.pm-inbox-subject {
    display: block;
    color: var(--text-bright, var(--text));
    margin-bottom: 4px;
}

.pm-inbox-preview {
    display: block;
    color: var(--text-muted, #888);
    font-size: 13px;
    line-height: 1.4;
}

.pm-inbox-mark-read {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 1;
    margin: 0;
}

.pm-inbox-mark-read .button-link {
    font-size: 12px;
    white-space: nowrap;
}

.pm-thread-meta {
    margin-top: 0;
}

.pm-thread-delete-form {
    margin-top: 10px;
}

.pm-message--mine .pm-message-body {
    border-left: 3px solid rgba(255, 255, 255, 0.12);
}

.pm-message--theirs .pm-message-body {
    border-left: 3px solid rgba(102, 204, 255, 0.35);
}

@media (max-width: 860px) {
    .pm-compose-layout {
        grid-template-columns: 1fr;
    }

    .pm-compose-recipients {
        position: static;
        max-height: none;
        order: -1;
    }

    .pm-inbox-dates {
        margin-left: 0;
        width: 100%;
        align-items: flex-start;
        text-align: left;
    }

    .pm-inbox-row:has(.pm-inbox-mark-read) .pm-inbox-dates {
        margin-right: 0;
    }

    .pm-inbox-mark-read {
        position: static;
        padding: 0 14px 10px;
    }

    .friends-table .col-actions {
        width: auto;
        white-space: normal;
    }
}

/* Post signature */
.post-signature {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 12px;
    color: var(--text-muted, #888);
    line-height: 1.4;
}

.post-signature-opt {
    margin: 0;
}

.post-signature-opt .checkbox-label {
    margin-bottom: 0;
    font-weight: 500;
    font-size: 13px;
    color: var(--text);
    line-height: 1.35;
}

.post-signature-opt input[type="checkbox"] {
    width: auto;
    flex-shrink: 0;
    margin: 0;
}

.reply-panel #topic-reply-form .reply-editor-group {
    margin-bottom: 0;
}

.reply-panel #topic-reply-form .reply-form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 2px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.reply-panel #topic-reply-form .reply-form-footer .post-signature-opt {
    flex: 1 1 220px;
    margin: 0;
    min-width: 0;
}

.reply-panel #topic-reply-form .reply-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.reply-panel #topic-reply-form .reply-form-footer .reply-submit-btn {
    min-width: 140px;
}

.reply-panel .reply-edit-cancel-btn {
    display: none;
}

.reply-panel.reply-panel--edit-mode .reply-edit-cancel-btn {
    display: inline-block;
}

.reply-panel--edit-required,
.reply-panel--edit-mode {
    border-left: 3px solid var(--accent, #00aeef);
}

@media (max-width: 720px) {
    .reply-panel {
        padding: 10px 12px;
    }

    .reply-panel .auth-form {
        gap: 8px;
        margin-top: 0;
    }

    .reply-panel-header {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin-bottom: 8px;
    }

    .reply-panel-header h3 {
        font-size: 15px;
        line-height: 1.25;
    }

    .reply-panel-header .reply-form-hint {
        margin: 0;
        text-align: left;
        white-space: normal;
        font-size: 11px;
        line-height: 1.3;
    }

    .reply-panel .quill-editor-wrap .ql-toolbar.ql-snow {
        padding: 2px 4px;
    }

    .reply-panel .quill-editor-wrap .ql-toolbar.ql-snow .ql-formats {
        margin-right: 4px;
    }

    .reply-panel .quill-editor-wrap .ql-snow.ql-toolbar button,
    .reply-panel .quill-editor-wrap .ql-snow .ql-toolbar button {
        width: 22px;
        height: 22px;
        padding: 1px;
    }

    .reply-panel .quill-editor-wrap .ql-snow .ql-picker-label {
        height: 22px;
        padding: 0 4px;
    }

    .reply-panel .ql-toolbar .ql-formats:has(> .ql-header),
    .reply-panel .ql-toolbar .ql-formats:has(> .ql-color),
    .reply-panel .ql-toolbar .ql-formats:has(> .ql-clean) {
        display: none;
    }

    .reply-panel .ql-toolbar .ql-strike,
    .reply-panel .ql-toolbar .ql-blockquote,
    .reply-panel .ql-toolbar .ql-code-block,
    .reply-panel .ql-toolbar .ql-table,
    .reply-panel .ql-toolbar button.ql-list[value="ordered"] {
        display: none;
    }

    .reply-panel .quill-editor-wrap .ql-container.ql-snow,
    .reply-panel .quill-editor-wrap .ql-editor {
        min-height: 88px;
    }

    .reply-panel .quill-editor-wrap .ql-editor {
        padding: 8px 10px;
    }

    .reply-staff-reason-group label .meta {
        display: none;
    }

    .reply-staff-reason-group textarea {
        min-height: 40px;
    }

    .reply-panel #topic-reply-form .reply-form-footer {
        gap: 8px;
        margin-top: 0;
        padding-top: 8px;
    }

    .reply-panel #topic-reply-form .reply-form-actions {
        width: 100%;
        margin-left: 0;
        gap: 6px;
    }

    .reply-panel #topic-reply-form .reply-form-actions .button {
        flex: 1 1 auto;
        min-width: 0;
        padding: 6px 8px;
        font-size: 11px;
        line-height: 1.15;
        white-space: nowrap;
    }

    .reply-panel #topic-reply-form .reply-form-footer .reply-submit-btn {
        min-width: 0;
    }
}

.post-edit-toggle.is-active {
    color: var(--accent, #00aeef);
    font-weight: 600;
}

.reply-edit-required-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.post-row--highlight {
    animation: post-row-highlight 2.4s ease-out;
}

@keyframes post-row-highlight {
    0% { background-color: rgba(0, 174, 239, 0.18); }
    100% { background-color: transparent; }
}

.profile-edit-form .panel h3,
.profile-edit-extra h3 {
    margin-bottom: 12px;
}

.profile-edit-intro {
    margin: 0 0 14px;
    max-width: 720px;
}

.profile-edit-layout {
    display: grid;
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
    gap: 20px 28px;
    align-items: stretch;
}

.profile-edit-avatar-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-panel-alt);
}

.profile-edit-avatar-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.profile-edit-card-label {
    font-weight: 600;
    color: var(--text-bright);
    font-size: 12px;
}

.profile-edit-avatar-card .profile-avatar-preview {
    margin: 0;
}

.profile-edit-avatar-card .user-avatar-wrap,
.profile-edit-avatar-card .user-avatar {
    width: 88px;
    height: 88px;
}

.profile-edit-avatar-card .user-avatar-initials {
    font-size: 26px;
}

.profile-edit-file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    width: 100%;
    position: relative;
}

.profile-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-file-label {
    margin: 0;
    cursor: pointer;
}

.profile-file-name {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-edit-form .checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    color: var(--text);
}

.profile-edit-form .checkbox-row input {
    width: auto;
    margin: 0;
}

.profile-edit-fields {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.profile-edit-fields .meta,
.profile-edit-intro {
    max-width: 62ch;
}

.profile-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px 20px;
}

.profile-edit-signature {
    min-width: 0;
}

.profile-edit-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.profile-edit-extra .oauth-button {
    width: auto;
    max-width: 280px;
    margin-top: 10px;
}

.profile-edit-2fa-form {
    display: grid;
    gap: 12px;
    max-width: 320px;
    margin-top: 12px;
}

.profile-edit-2fa-cancel {
    margin-top: 10px;
}

@media (max-width: 720px) {
    .profile-edit-form .panel h3,
    .profile-edit-extra h3 {
        margin-bottom: 10px;
    }

    .profile-edit-layout,
    .profile-edit-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .profile-edit-avatar-card {
        display: grid;
        grid-template-columns: 80px minmax(0, 1fr);
        grid-template-rows: auto;
        align-items: center;
        column-gap: 14px;
        row-gap: 0;
        width: 100%;
        padding: 0 0 14px;
        border: 0;
        border-radius: 0;
        background: transparent;
        border-bottom: 1px solid var(--border);
    }

    .profile-edit-card-label {
        display: none;
    }

    .profile-edit-avatar-card .profile-avatar-preview {
        grid-column: 1;
        grid-row: 1;
        padding-top: 0;
    }

    .profile-edit-avatar-card .user-avatar-wrap,
    .profile-edit-avatar-card .user-avatar {
        width: 80px;
        height: 80px;
    }

    .profile-edit-avatar-card .user-avatar-initials {
        font-size: 24px;
    }

    .profile-edit-avatar-meta {
        grid-column: 2;
        grid-row: 1;
        gap: 8px;
    }

    .profile-edit-file {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .profile-file-label {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 14px;
    }

    .profile-edit-fields .meta,
    .profile-edit-intro,
    .profile-edit-form .panel > .meta {
        max-width: none;
        font-size: 11px;
        line-height: 1.45;
    }

    .profile-edit-intro {
        margin-bottom: 12px;
    }

    .profile-edit-signature .toggle-row {
        padding: 8px 0;
        gap: 10px;
        align-items: flex-start;
    }

    .profile-edit-footer {
        margin-top: 14px;
        padding-top: 12px;
    }

    .profile-edit-footer .button {
        width: 100%;
        min-height: 40px;
    }

    .profile-edit-extra .oauth-button,
    .profile-edit-2fa-form {
        width: 100%;
        max-width: none;
    }
}

/* Google Translate (widget off-screen; banner nascosta) */
.google-translate-host {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover,
.goog-text-highlight,
.skiptranslate,
iframe.goog-te-banner-frame,
.goog-te-gadget-icon {
    display: none !important;
}

html.translated-ltr body,
html.translated-rtl body {
    top: 0 !important;
}

html.translated-ltr,
html.translated-rtl {
    height: auto !important;
}

/* Toggle UGC acceso: il resto della pagina resta visibile; i testi da tradurre compaiono quando Google ha finito. */
html[data-ugc-translate="on"]:not([data-gt-ready]) [translate="yes"] {
    opacity: 0;
    pointer-events: none;
}

html[data-ugc-translate="on"][data-gt-ready] [translate="yes"] {
    animation: lz-gt-in 0.18s ease;
}

@keyframes lz-gt-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lz-gt-pending [translate="yes"] {
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    html[data-ugc-translate="on"][data-gt-ready] [translate="yes"] {
        animation: none;
    }
}

.profile-lang-form {
    max-width: 420px;
    margin-top: 12px;
}

.profile-privacy-form select,
.profile-lang-form select {
    max-width: 100%;
}

/* Shoutbox */
.shoutbox-panel {
    margin-bottom: 14px;
}

.shoutbox-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.shoutbox-section-heading {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
    flex-shrink: 0;
}

.shoutbox-section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 1 1 auto;
    flex-wrap: wrap;
    min-width: 0;
    margin-left: auto;
}

.shoutbox-section-hint {
    line-height: 1.45;
    font-size: 11px;
    color: #666;
    text-align: right;
}

.shoutbox-section-hint-short {
    display: none;
}

.shoutbox-panel[data-shoutbox-collapsed="1"] .shoutbox-body {
    display: none;
}

.shoutbox-collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--link);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.shoutbox-collapse-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.15s ease;
}

.shoutbox-panel[data-shoutbox-collapsed="1"] .shoutbox-collapse-toggle svg {
    transform: rotate(180deg);
}

.shoutbox-collapse-toggle:hover,
.shoutbox-collapse-toggle:focus-visible {
    color: var(--accent);
    background: rgba(0, 174, 239, 0.12);
    outline: none;
}

.shoutbox-messages {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-row-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 0;
    margin-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.2s ease;
}

.shoutbox-messages.is-scrolling {
    scrollbar-color: var(--nav-top) transparent;
}

.shoutbox-messages::-webkit-scrollbar {
    width: var(--page-scrollbar-size);
}

.shoutbox-messages::-webkit-scrollbar-track {
    background: transparent;
}

.shoutbox-messages::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 5px;
    transition: background 0.2s ease;
}

.shoutbox-messages.is-scrolling::-webkit-scrollbar-thumb {
    background: var(--nav-top);
}

.shoutbox-messages.is-scrolling::-webkit-scrollbar-thumb:hover,
.shoutbox-messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.shoutbox-messages > .meta {
    padding: 6px 12px;
    margin: 0;
}

.shoutbox-entry {
    padding: 3px 12px;
    line-height: 1.35;
    font-size: 12px;
    overflow-wrap: break-word;
    word-break: normal;
}

.profile-theme-btn.active,
.profile-translate-btn.active {
    background: rgba(94, 184, 255, 0.18);
    border-color: var(--accent);
    color: var(--link);
}

.profile-settings-theme {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.profile-edit-subtitle {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
}

.profile-password-section {
    scroll-margin-top: 80px;
}

.shoutbox-entry-alt {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .shoutbox-entry-alt {
    background: rgba(36, 112, 196, 0.06);
}

.shoutbox-entry + .shoutbox-entry {
    border-top: none;
    margin-top: 0;
    padding-top: 3px;
}

.shoutbox-time {
    display: inline-block;
    color: #555;
    font-size: 10px;
    line-height: 1.35;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    margin-right: 8px;
    vertical-align: baseline;
}

.shoutbox-time-short {
    display: none;
}

.shoutbox-line {
    overflow-wrap: break-word;
    word-break: normal;
}

.shoutbox-entry-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    vertical-align: baseline;
}

.shoutbox-hide-form {
    display: inline;
    margin: 0;
}

.shoutbox-hide-btn {
    border: 0;
    background: transparent;
    color: var(--muted, #8aa0b8);
    font-size: 11px;
    line-height: 1.2;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

.shoutbox-hide-btn:hover,
.shoutbox-hide-btn:focus-visible {
    color: var(--text-bright, #fff);
}

.shoutbox-entry.is-hidden {
    background: rgba(196, 140, 60, 0.08);
}

.shoutbox-hidden-meta {
    display: block;
    margin: 2px 0 4px 0;
    color: #c48c3c;
    font-size: 11px;
    line-height: 1.35;
}

.shoutbox-hidden-toggle {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: transparent;
    color: var(--text, #d5dee8);
    border-radius: 6px;
    font-size: 11px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
    white-space: nowrap;
}

.shoutbox-hidden-toggle[aria-pressed="true"] {
    border-color: rgba(196, 140, 60, 0.7);
    color: #f0c27a;
}

.shoutbox-author {
    color: var(--link);
    font-weight: 600;
    text-decoration: none;
}

.shoutbox-author:hover {
    color: var(--accent);
}

.shoutbox-report-menu {
    position: static;
}

.shoutbox-report-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #f5c842;
    cursor: pointer;
    opacity: 1;
    transition: color 0.15s ease, background 0.15s ease;
}

.shoutbox-report-toggle:hover,
.shoutbox-report-toggle:focus-visible {
    color: #ffe566;
    background: rgba(245, 200, 66, 0.14);
    outline: none;
}

[data-theme="light"] .shoutbox-report-toggle {
    color: #c48a00;
}

[data-theme="light"] .shoutbox-report-toggle:hover,
[data-theme="light"] .shoutbox-report-toggle:focus-visible {
    color: #9a6b00;
    background: rgba(196, 138, 0, 0.12);
}

.shoutbox-report-toggle svg {
    width: 15px;
    height: 15px;
}

.shoutbox-report-pick-dialog {
    width: min(100%, 480px);
    max-height: min(88vh, 560px);
    display: flex;
    flex-direction: column;
}

.shoutbox-report-pick-list {
    flex: 1 1 auto;
    min-height: 120px;
    max-height: min(52vh, 400px);
    margin-bottom: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel-alt);
}

.shoutbox-report-pick-empty {
    margin: 0 0 14px;
}

.shoutbox-report-pick-item {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text-bright);
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    overflow: hidden;
}

.shoutbox-report-pick-item:last-child {
    border-bottom: 0;
}

.shoutbox-report-pick-item:hover,
.shoutbox-report-pick-item:focus-visible {
    background: rgba(255, 255, 255, 0.04);
    outline: none;
}

.shoutbox-report-pick-meta {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    color: #777;
    line-height: 1.35;
}

.shoutbox-report-pick-author {
    color: var(--link);
    font-weight: 600;
}

.shoutbox-report-pick-text {
    display: block;
    max-width: 100%;
    font-size: 12px;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
}

.shoutbox-text {
    color: var(--text-bright);
}

.shoutbox-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.shoutbox-compose {
    display: flex;
    gap: 8px;
    align-items: center;
}

.shoutbox-compose-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.shoutbox-send-btn,
.shoutbox-emoji-open {
    flex-shrink: 0;
}

.shoutbox-emoji-open {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel-alt);
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-sizing: border-box;
    filter: none;
}

.shoutbox-emoji-open:hover {
    border-color: var(--nav-top);
    background: rgba(36, 112, 196, 0.12);
    filter: none;
}

.shoutbox-emoji-modal-dialog {
    width: min(100%, 360px);
}

.shoutbox-emoji-modal .lz-modal-actions {
    justify-content: center;
}

.shoutbox-emoji-modal .shoutbox-emoji-picker {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
    max-height: 220px;
    overflow-y: auto;
}

.shoutbox-emoji-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel-alt);
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-sizing: border-box;
    filter: none;
}

.shoutbox-emoji-btn:hover {
    border-color: var(--nav-top);
    background: rgba(36, 112, 196, 0.12);
    filter: none;
}

.shoutbox-hint {
    margin: 0;
    font-size: 11px;
}

.shoutbox-form input[type="text"] {
    flex: 1;
    min-width: 0;
}

.shoutbox-login {
    margin: 0;
    padding-top: 4px;
}

/*
 * Footer lives under the scroll region. Hidden with height:0 (no fade):
 * the spacer already occupies its place in the scroll, so docking feels native.
 */
.site-footer {
    flex: 0 0 auto;
    box-sizing: border-box;
    height: 0;
    margin: 0;
    padding: 0 var(--page-side-gutter);
    overflow: hidden;
    border-top: 0 solid var(--border);
    color: #666;
    font-size: 11px;
    text-align: center;
    background: var(--bg);
    pointer-events: none;
    visibility: hidden;
}

.page-frame.is-footer-reached .site-footer {
    height: var(--site-footer-height);
    padding: 14px var(--page-side-gutter) calc(12px + var(--safe-bottom));
    border-top-width: 1px;
    pointer-events: auto;
    visibility: visible;
}

.footer-links a {
    color: #777;
}

.footer-copy {
    margin: 10px 0 0;
    color: #666;
    font-size: 11px;
}

/* Back to top */
.back-to-top {
    position: fixed;
    right: 16px;
    bottom: calc(16px + var(--safe-bottom));
    z-index: 200;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(to bottom, var(--nav-top), var(--nav-bottom));
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.9);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    pointer-events: none;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.back-to-top:hover {
    filter: brightness(1.1);
}

/* Dashboard stats */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-panel h3 {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--text-white);
}

.dashboard-stat-line {
    margin: 0 0 8px;
    color: var(--text-bright);
    line-height: 1.55;
}

.dashboard-online-detail {
    margin-bottom: 10px;
}

.group-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.group-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-panel-alt);
    color: var(--text-bright);
}

.group-admin { background: #3a1010; border-color: #804040; color: #ff9999; }
.group-moderator { background: #102838; border-color: #305060; color: #88bbdd; }
.group-member { background: #1a1a1a; border-color: #333; color: #aaa; }
.group-legacy { background: #1a1a1a; border-color: #333; color: #aaa; }

[data-theme="light"] .group-admin {
    background: #fde8e8;
    border-color: #e8b4b4;
    color: #b42318;
}

[data-theme="light"] .group-moderator {
    background: #e8f1f8;
    border-color: #b7cfe3;
    color: #175a8c;
}

[data-theme="light"] .group-member {
    background: #eef1f5;
    border-color: #cfd6de;
    color: #4a5568;
}

[data-theme="light"] .group-legacy {
    background: #eef1f5;
    border-color: #cfd6de;
    color: #4a5568;
}

.forum-stats-unified {
    margin-bottom: 14px;
}

.forum-stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 14px;
}

.forum-stats-block .dashboard-stat-line {
    margin-bottom: 6px;
}

.forum-stats-cards {
    margin-bottom: 14px;
}

.forum-stats-chart-title {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--text-white);
    font-weight: 600;
}

.stats-bar-chart {
    display: grid;
    gap: 8px;
}

.stats-bar-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 7.5ch;
    gap: 10px;
    align-items: center;
}

.stats-bar-label {
    font-size: 11px;
    color: #888;
}

.stats-bar-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    overflow: hidden;
}

.stats-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--link), var(--accent));
    min-width: 2px;
}

.stats-bar-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-bright);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.forum-row.online-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    column-gap: 16px;
    cursor: default;
}

.forum-row.online-row:hover {
    background: transparent;
}

.forum-row.online-row > .forum-row-name {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--text-bright);
    font-weight: 600;
}

.forum-row.online-row > .forum-row-name a.author {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--link);
}

.forum-row.online-row > .forum-row-stats {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
}

/* Cookie banner GDPR — compact card near footer */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 400;
    padding: 0 10px calc(12px + var(--safe-bottom));
    background: transparent;
    border: none;
    pointer-events: none;
}

.cookie-banner[hidden],
.cookie-banner:not(.is-open) {
    display: none !important;
}

.cookie-banner.is-open {
    display: block;
}

.cookie-banner-shell {
    pointer-events: none;
    max-width: 880px;
    margin: 0 auto;
}

.cookie-banner-card {
    pointer-events: auto;
    background: var(--bg-panel);
    border: 1px solid rgba(0, 174, 239, 0.28);
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.42);
    padding: 12px 14px 10px;
    backdrop-filter: blur(12px);
    max-height: min(70vh, 420px);
    overflow: auto;
}

.cookie-banner-header {
    margin-bottom: 8px;
}

.cookie-banner-title {
    margin: 0 0 3px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: 0.01em;
}

.cookie-banner-text {
    margin: 0;
    color: var(--text);
    font-size: 11.5px;
    line-height: 1.4;
}

.cookie-banner-cats {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    display: grid;
    gap: 6px;
}

.cookie-banner-cat {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-panel-alt);
}

.cookie-banner-cat-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 7px 9px;
    cursor: pointer;
}

.cookie-banner-cat-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
}

.cookie-banner-cat-label input[disabled] {
    cursor: not-allowed;
    opacity: 0.85;
}

.cookie-banner-cat-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.cookie-banner-cat-body strong {
    color: var(--text-bright);
    font-size: 12px;
    line-height: 1.25;
}

.cookie-banner-cat-desc {
    color: var(--text);
    font-size: 11px;
    line-height: 1.35;
}

.cookie-banner-actions {
    display: flex;
    align-items: stretch;
    gap: 6px;
    flex-wrap: nowrap;
}

.cookie-banner-actions .cookie-btn-equal {
    flex: 1 1 0;
    min-height: 32px;
    padding: 6px 8px;
    font-size: 12px;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.cookie-banner-actions .cookie-btn-accept {
    font-weight: 700;
}

.cookie-banner-links {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: var(--text);
}

.cookie-banner-links a {
    color: var(--link);
    text-decoration: none;
}

.cookie-banner-links a:hover {
    text-decoration: none;
    color: var(--link-hover);
}

.cookie-banner-note {
    opacity: 0.8;
}

/* Desktop: 3 categorie in riga */
@media (min-width: 720px) {
    .cookie-banner-cats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 10px;
    }

    .cookie-banner-cat-label {
        min-height: 100%;
        padding: 8px 10px;
    }

    .cookie-banner-note {
        margin-left: 4px;
    }
}

/* Mobile: stack + bottoni a capo */
@media (max-width: 719px) {
    .cookie-banner {
        padding: 0 8px calc(10px + var(--safe-bottom));
    }

    .cookie-banner-card {
        padding: 10px 11px 9px;
        border-radius: 10px;
        max-height: min(78vh, 520px);
    }

    .cookie-banner-title {
        font-size: 13px;
    }

    .cookie-banner-actions {
        flex-wrap: wrap;
    }

    .cookie-banner-actions .cookie-btn-equal {
        flex: 1 1 calc(50% - 4px);
        white-space: normal;
        line-height: 1.25;
        min-height: 34px;
    }

    .cookie-banner-actions .cookie-btn-equal:last-child {
        flex: 1 1 100%;
    }

    .cookie-banner-links {
        justify-content: center;
        text-align: center;
    }

    .cookie-banner-note {
        flex: 1 1 100%;
        text-align: center;
    }
}

.legal-panel {
    padding: 18px 20px 16px;
}

.legal-doc-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border);
}

.legal-doc-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-panel-alt);
    color: var(--text);
    font-size: 12px;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.legal-doc-nav-link:hover {
    color: var(--text-bright);
    border-color: rgba(0, 174, 239, 0.4);
}

.legal-doc-nav-link.is-active {
    background: linear-gradient(to bottom, var(--nav-top), var(--nav-bottom));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

[data-theme="light"] .legal-doc-nav-link.is-active {
    color: #fff;
}

.legal-panel .legal-prose {
    color: var(--text);
    line-height: 1.65;
    font-size: 13.5px;
    width: 100%;
    max-width: none;
}

.legal-prose > p {
    margin: 0 0 12px;
}

.legal-updated {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text);
}

.legal-updated span {
    font-weight: 700;
    color: var(--text-bright);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10px;
}

.legal-updated--footer {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    margin-top: 22px;
    padding: 14px 0 0;
    border-radius: 0;
    background: transparent;
    border: none;
    border-top: 1px solid var(--border);
}

.legal-section-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 22px 0 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1.35;
}

.legal-prose > .legal-section-title:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.legal-section-num {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6em;
    height: 1.6em;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(0, 174, 239, 0.14);
    color: var(--link);
    font-size: 12px;
    font-weight: 700;
}

[data-theme="light"] .legal-section-num {
    background: rgba(36, 112, 196, 0.12);
}

.legal-section-label {
    min-width: 0;
}

.legal-subtitle {
    margin: 14px 0 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-bright);
}

.legal-list {
    margin: 0 0 14px;
    padding: 0 0 0 1.15rem;
}

.legal-list li {
    margin: 0 0 6px;
    padding-left: 2px;
}

.legal-list li::marker {
    color: var(--link);
}

.legal-table-wrap {
    margin: 0 0 16px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-panel-alt);
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.legal-table th,
.legal-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.legal-table tr:last-child th,
.legal-table tr:last-child td {
    border-bottom: none;
}

.legal-table th {
    background: rgba(0, 174, 239, 0.08);
    color: var(--text-bright);
    font-weight: 700;
}

[data-theme="light"] .legal-table th {
    background: rgba(36, 112, 196, 0.08);
}

.legal-table td {
    color: var(--text);
}

@media (max-width: 719px) {
    .legal-panel {
        padding: 14px 12px 12px;
    }

    .legal-doc-nav {
        gap: 5px;
        margin-bottom: 14px;
    }

    .legal-doc-nav-link {
        flex: 1 1 auto;
        justify-content: center;
        padding: 7px 10px;
        font-size: 11.5px;
    }

    .legal-panel .legal-prose {
        font-size: 13px;
    }

    .legal-section-title {
        font-size: 14px;
        gap: 8px;
    }
}

.mod-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #1a1800;
    border: 1px solid #665500;
    border-radius: var(--radius);
}

.mod-bar > .meta {
    display: inline-flex;
    align-items: center;
    margin: 0;
    line-height: 1.2;
}

.mod-bar form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.topic-rename-modal .topic-rename-title-input {
    width: 100%;
}

.topic-rename-modal .form-group {
    margin-bottom: 12px;
}

.post-archive-item-editor {
    white-space: nowrap;
}

.mod-bar-sep {
    width: 1px;
    height: 1.4em;
    background: #665500;
    margin: 0 4px;
}

.mod-bar-view-label {
    margin-right: 2px;
}

.mod-view-toggle.is-active {
    border-color: var(--accent);
    color: var(--accent);
}

.staff-user-mod-panel {
    border-left: 3px solid #665500;
}

.staff-user-mod-title {
    margin: 0 0 6px;
}

.staff-user-mod-intro {
    margin: 0 0 14px;
}

.staff-user-mod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.staff-user-mod-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel-alt);
}

.staff-user-mod-card h4,
.staff-user-mod-active h4 {
    margin: 0;
    font-size: 13px;
}

.staff-user-mod-card--role {
    margin-bottom: 14px;
}

.staff-user-mod-card--danger {
    margin-bottom: 14px;
    border-color: rgba(192, 48, 48, 0.45);
    background: rgba(48, 10, 10, 0.22);
}

.staff-user-mod-danger-note {
    margin: 0;
    color: #ff9a9a;
}

[data-theme="light"] .staff-user-mod-card--danger {
    border-color: rgba(155, 28, 28, 0.35);
    background: #fff5f5;
}

[data-theme="light"] .staff-user-mod-danger-note {
    color: #9b1c1c;
}

.staff-user-mod-field {
    display: grid;
    gap: 4px;
    font-size: 12px;
    color: var(--text);
}

.staff-user-mod-field > span {
    font-weight: 600;
    color: var(--text-bright);
    font-size: 11px;
}

.staff-user-mod-field select,
.staff-user-mod-field input,
.staff-user-mod-field textarea {
    width: 100%;
}

.staff-user-mod-field textarea {
    min-height: 72px;
    resize: vertical;
}

.staff-user-mod-card .button {
    justify-self: start;
    margin-top: 2px;
}

.staff-user-mod-card--actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.staff-user-mod-card--actions > form {
    margin: 0;
}

.staff-user-mod-list {
    list-style: none;
    margin: 8px 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.staff-user-mod-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
}

.staff-user-mod-inline-form {
    display: inline;
    margin: 0;
}

.staff-user-mod-rep-form {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    display: grid;
    gap: 8px;
}

body.mod-topic-staff:not(.mod-show-deleted) [data-post-deleted="1"] {
    display: none !important;
}

body.mod-topic-staff:not(.mod-show-deleted) .post-row[data-post-deleted="1"] .post-body-extensions [data-post-deleted="1"],
body.mod-topic-staff:not(.mod-show-deleted) .post-row[data-post-deleted="1"] .post-body-extensions {
    display: none !important;
}

body.mod-topic-staff:not(.mod-show-archives) .post-edit-archives {
    display: none !important;
}

.post-modified-date {
    color: var(--muted);
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #c03030;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
}

.unread-badge.nav {
    margin-left: 6px;
    vertical-align: middle;
}

.pm-thread-unread {
    font-weight: 700;
}

/* Desktop unified top header */
@media (min-width: 721px) {
    .desktop-top-header {
        flex-shrink: 0;
        position: relative;
        z-index: 300;
        transition: transform 0.28s ease, opacity 0.2s ease;
    }

    .desktop-top-header.is-hidden {
        transform: translateY(-100%);
        margin-bottom: calc(-1 * var(--desktop-header-h));
        opacity: 0;
        pointer-events: none;
    }

    .desktop-top-header .topbar {
        padding: 0;
        min-height: var(--desktop-header-h);
        display: flex;
        align-items: center;
        background: linear-gradient(to bottom, var(--nav-top), var(--nav-bottom));
        border-bottom: 1px solid rgba(0, 0, 0, 0.35);
    }

    .desktop-top-header .topbar-inner {
        flex-wrap: nowrap;
        gap: 0.75rem;
        width: 100%;
        max-width: min(var(--layout-max-width), calc(100% - 2.5rem));
        padding-left: 4px;
        padding-right: 12px;
    }

    .desktop-top-header .topbar-tools {
        gap: 10px;
        padding-right: 2px;
    }

    .desktop-top-header .topbar-search {
        flex: 0 1 260px;
        max-width: 260px;
    }

    .topbar-nav a {
        color: rgba(255, 255, 255, 0.92);
        padding: 8px 14px;
        border-radius: 3px;
    }

    .topbar-nav a:hover,
    .topbar-nav a:focus-visible {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .topbar-nav .nav-user-link {
        color: rgba(255, 255, 255, 0.92);
        padding: 8px 14px;
        border-radius: 3px;
    }

    .topbar-nav .nav-user-link:hover,
    .topbar-nav .nav-user-link:focus-visible,
    .topbar-nav .nav-user-menu-trigger:hover,
    .topbar-nav .nav-user-menu:focus-within .nav-user-menu-trigger {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .desktop-top-header .theme-toggle,
    .desktop-top-header .lang-pref-toggle {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
        color: #fff;
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 13px;
    }

    html[data-ugc-translate="on"] .desktop-top-header .lang-pref-toggle,
    .desktop-top-header .lang-pref-toggle[aria-pressed="true"] {
        width: auto;
        gap: 5px;
        padding: 0 6px;
    }

    .desktop-top-header .search-form input[type="search"] {
        background: rgba(0, 0, 0, 0.25);
        border-color: rgba(255, 255, 255, 0.15);
        color: #fff;
        min-height: 30px;
        padding: 5px 8px;
        font-size: 12px;
    }

    .desktop-top-header .search-form .search-submit-icon {
        background: rgba(0, 0, 0, 0.25);
        border-color: rgba(255, 255, 255, 0.15);
        color: #fff;
        width: 30px;
        min-width: 30px;
        height: 30px;
        padding: 0;
    }

    .desktop-top-header .search-form .search-submit-icon:hover {
        filter: none;
        background: rgba(0, 0, 0, 0.4);
        color: #fff;
    }

    [data-theme="light"] .desktop-top-header .topbar {
        background: linear-gradient(to bottom, #e8eef5, #dce4ec);
        border-bottom-color: var(--border);
    }

    [data-theme="light"] .topbar-nav a {
        color: var(--text-bright);
    }

    [data-theme="light"] .topbar-nav .nav-user-link {
        color: var(--text-bright);
    }

    [data-theme="light"] .topbar-nav a:hover,
    [data-theme="light"] .topbar-nav a:focus-visible {
        background: rgba(36, 112, 196, 0.1);
        color: var(--link);
    }

    [data-theme="light"] .topbar-nav .nav-user-link:hover,
    [data-theme="light"] .topbar-nav .nav-user-link:focus-visible {
        background: rgba(36, 112, 196, 0.1);
        color: var(--link);
    }

    [data-theme="light"] .topbar-nav .nav-user-menu-trigger:hover,
    [data-theme="light"] .topbar-nav .nav-user-menu:focus-within .nav-user-menu-trigger {
        background: rgba(36, 112, 196, 0.1);
        color: var(--link);
    }

    [data-theme="light"] .topbar-nav .nav-submenu-trigger {
        color: var(--text-bright);
    }

    [data-theme="light"] .topbar-nav .nav-submenu-trigger:hover,
    [data-theme="light"] .topbar-nav .nav-submenu:focus-within .nav-submenu-trigger {
        background: rgba(36, 112, 196, 0.1);
        color: var(--link);
    }

    [data-theme="light"] .desktop-top-header .search-form input[type="search"] {
        background: #d5dee8;
        border: 1px solid rgba(70, 96, 128, 0.28);
        color: #1a2332;
        box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.04);
        min-height: 30px;
        padding: 5px 8px;
        font-size: 12px;
    }

    [data-theme="light"] .desktop-top-header .search-form input[type="search"]::placeholder {
        color: #6b7785;
    }

    [data-theme="light"] .desktop-top-header .search-form .search-submit-icon {
        background: #d5dee8;
        border: 1px solid rgba(70, 96, 128, 0.28);
        color: #2c3d52;
        box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.04);
        width: 30px;
        min-width: 30px;
        height: 30px;
        padding: 0;
    }

    [data-theme="light"] .desktop-top-header .search-form .search-submit-icon:hover {
        filter: none;
        background: #bccad9;
        color: #1a2332;
    }

    [data-theme="light"] .desktop-top-header .theme-toggle,
    [data-theme="light"] .desktop-top-header .lang-pref-toggle {
        background: #fff;
        border: 1px solid #a8b8cc;
        color: #6b7785;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    }

    [data-theme="light"] .desktop-top-header .theme-toggle:hover,
    [data-theme="light"] .desktop-top-header .lang-pref-toggle:hover {
        border-color: #2470c4;
        color: #2470c4;
        background: #f4f8fc;
    }

    .main-nav-bar {
        display: none;
    }
}

/* Mobile */
@media (max-width: 720px) {
    body {
        font-size: 14px;
    }

    .mobile-sticky-header {
        flex-shrink: 0;
    }

    html.nav-open,
    body.nav-open {
        overflow: hidden;
        height: 100%;
        max-height: 100%;
        overscroll-behavior: none;
    }

    html.nav-open .page-shell,
    body.nav-open .page-shell {
        overflow: hidden;
    }

    html.nav-open .main-nav-bar.is-open,
    body.nav-open .main-nav-bar.is-open,
    html.nav-open .main-nav-bar.is-open .main-nav-inner,
    body.nav-open .main-nav-bar.is-open .main-nav-inner {
        touch-action: pan-y;
    }

    .mobile-sticky-header {
        display: flex;
        align-items: center;
        gap: 10px;
        position: relative;
        z-index: 300;
        flex-shrink: 0;
        height: var(--mobile-header-h);
        padding: 0 12px;
        padding-top: env(safe-area-inset-top, 0px);
        box-sizing: content-box;
        background: rgba(8, 12, 18, 0.94);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(36, 112, 196, 0.35);
        transition: transform 0.28s ease, opacity 0.2s ease;
    }

    .mobile-sticky-header.is-hidden {
        transform: translateY(calc(-100% - env(safe-area-inset-top, 0px)));
        margin-bottom: calc(-1 * (var(--mobile-header-h) + env(safe-area-inset-top, 0px)));
        opacity: 0;
        pointer-events: none;
    }

    .mobile-sticky-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
        color: var(--text-white);
        font-weight: 600;
        font-size: 15px;
    }

    .mobile-sticky-brand img {
        flex-shrink: 0;
        background: transparent;
        box-shadow: none;
    }

    .mobile-sticky-brand span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-sticky-actions {
        flex-shrink: 0;
    }

    .mobile-sticky-header .theme-toggle,
    .mobile-sticky-header .lang-pref-toggle {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: #fff;
        box-shadow: none;
    }

    .mobile-action {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.08);
        color: var(--text-white);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .mobile-action-icon {
        padding: 0;
        min-width: 36px;
    }

    .mobile-action-icon .search-icon {
        width: 18px;
        height: 18px;
        display: block;
    }

    .mobile-action-avatar {
        padding: 0;
        min-width: 36px;
        overflow: hidden;
    }

    .mobile-action-avatar .user-avatar,
    .mobile-action-avatar .user-avatar-wrap .user-avatar {
        width: 24px;
        height: 24px;
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 36px;
        height: 36px;
        padding: 7px;
        border: none;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.08);
        cursor: pointer;
        flex-shrink: 0;
        overflow: hidden;
    }

    .nav-toggle span {
        display: block;
        height: 2px;
        background: #fff;
        border-radius: 1px;
        transform-origin: center;
        transition: transform 0.2s ease;
    }

    /* Hide the middle bar immediately so its rounded caps cannot peek
       left/right of the X while the outer bars rotate. */
    .nav-toggle span:nth-child(2) {
        transition: transform 0.08s ease, opacity 0.08s linear, background-color 0.08s linear;
        transition-delay: 0.12s;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
        background-color: transparent;
        border-radius: 0;
        transform: scaleX(0);
        transition-delay: 0s;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .topbar {
        display: none;
    }

    .desktop-top-header {
        display: none;
    }

    .site-banner {
        display: none;
    }

    .main-nav-bar {
        position: fixed;
        top: calc(var(--mobile-header-h) + env(safe-area-inset-top, 0px));
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 250;
        max-height: 0;
        height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .main-nav-bar.is-open {
        height: calc(100vh - var(--mobile-header-h) - env(safe-area-inset-top, 0px));
        max-height: calc(100vh - var(--mobile-header-h) - env(safe-area-inset-top, 0px));
        overflow: hidden;
        opacity: 1;
        visibility: visible;
    }

    @supports (height: 100dvh) {
        .main-nav-bar.is-open {
            height: calc(100dvh - var(--mobile-header-h) - env(safe-area-inset-top, 0px));
            max-height: calc(100dvh - var(--mobile-header-h) - env(safe-area-inset-top, 0px));
        }
    }

    .main-nav-bar.is-open .main-nav-inner {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        max-width: none;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    [data-theme="light"] .mobile-sticky-header {
        background: rgba(248, 250, 252, 0.94);
        border-bottom-color: rgba(0, 120, 200, 0.2);
    }

    [data-theme="light"] .mobile-sticky-header .theme-toggle,
    [data-theme="light"] .mobile-sticky-header .lang-pref-toggle {
        background: #fff;
        border: 1px solid #a8b8cc;
        color: #6b7785;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    }

    [data-theme="light"] .nav-toggle span {
        background: #333;
    }

    .poll-result-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .poll-result-pct {
        text-align: left;
    }

    .main-nav-inner {
        flex-direction: column;
        padding: 8px 0;
    }

    .main-nav-bar a {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding: 14px 20px;
        font-size: 15px;
    }

    .main-nav-bar a:last-child {
        border-bottom: none;
    }

    .main-nav-bar .nav-submenu,
    .main-nav-bar .nav-user-menu {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        flex-direction: column;
        width: 100%;
        flex-shrink: 0;
    }

    .main-nav-bar .nav-submenu-trigger,
    .main-nav-bar .nav-user-menu-trigger {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }

    .main-nav-bar .nav-submenu:hover .nav-submenu-dropdown,
    .main-nav-bar .nav-submenu:focus-within .nav-submenu-dropdown,
    .main-nav-bar .nav-user-menu:hover .nav-user-dropdown,
    .main-nav-bar .nav-user-menu:focus-within .nav-user-dropdown {
        display: none;
    }

    .main-nav-bar .nav-submenu.is-open .nav-submenu-dropdown,
    .main-nav-bar .nav-user-menu.is-open .nav-user-dropdown {
        display: block;
    }

    .main-nav-bar .nav-submenu.is-open .nav-accordion-chevron,
    .main-nav-bar .nav-user-menu.is-open .nav-accordion-chevron {
        transform: rotate(45deg);
    }

    .main-nav-bar .nav-submenu.is-open > .nav-submenu-trigger,
    .main-nav-bar .nav-user-menu.is-open > .nav-user-menu-trigger {
        background: rgba(255, 255, 255, 0.08);
    }

    .main-nav-bar .nav-submenu-dropdown,
    .main-nav-bar .nav-user-dropdown {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        background: rgba(0, 0, 0, 0.15);
        width: 100%;
        border-radius: 0;
        padding: 0;
        flex-shrink: 0;
    }

    .main-nav-bar .nav-submenu-dropdown a,
    .main-nav-bar .nav-submenu-dropdown .nav-submenu-item,
    .main-nav-bar .nav-user-dropdown a,
    .main-nav-bar .nav-user-dropdown .nav-logout-btn {
        color: rgba(255, 255, 255, 0.92);
        padding: 12px 20px 12px 28px;
        font-size: 14px;
        font-weight: 500;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    .main-nav-bar .nav-submenu-dropdown a:last-child,
    .main-nav-bar .nav-submenu-dropdown .nav-submenu-form:last-child .nav-submenu-item,
    .main-nav-bar .nav-user-dropdown a:last-child {
        border-bottom: none;
    }

    .main-nav-bar .nav-logout-form {
        border-right: none;
        border-bottom: none;
    }

    .main-nav-bar .nav-logout-btn {
        width: 100%;
        padding: 12px 20px 12px 28px;
        font-size: 14px;
        text-align: left;
    }

    [data-theme="light"] .main-nav-bar {
        background: #ffffff;
        border-bottom-color: var(--border);
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    }

    [data-theme="light"] .main-nav-bar a,
    [data-theme="light"] .main-nav-bar .nav-submenu-trigger,
    [data-theme="light"] .main-nav-bar .nav-user-menu-trigger {
        color: var(--text-bright);
        border-bottom-color: rgba(0, 0, 0, 0.08);
    }

    [data-theme="light"] .main-nav-bar a:hover,
    [data-theme="light"] .main-nav-bar .nav-submenu-trigger:hover,
    [data-theme="light"] .main-nav-bar .nav-user-menu-trigger:hover {
        background: rgba(36, 112, 196, 0.08);
        color: var(--link);
    }

    [data-theme="light"] .main-nav-bar .nav-submenu,
    [data-theme="light"] .main-nav-bar .nav-user-menu {
        border-bottom-color: rgba(0, 0, 0, 0.08);
    }

    [data-theme="light"] .main-nav-bar .nav-submenu.is-open > .nav-submenu-trigger,
    [data-theme="light"] .main-nav-bar .nav-user-menu.is-open > .nav-user-menu-trigger {
        background: rgba(36, 112, 196, 0.08);
        color: var(--link);
    }

    [data-theme="light"] .main-nav-bar .nav-accordion-chevron {
        opacity: 0.65;
    }

    [data-theme="light"] .main-nav-bar .nav-submenu-dropdown,
    [data-theme="light"] .main-nav-bar .nav-user-dropdown {
        background: var(--bg-panel-alt);
        border-top-color: rgba(0, 0, 0, 0.08);
    }

    [data-theme="light"] .main-nav-bar .nav-submenu-dropdown a,
    [data-theme="light"] .main-nav-bar .nav-submenu-dropdown .nav-submenu-item,
    [data-theme="light"] .main-nav-bar .nav-user-dropdown a,
    [data-theme="light"] .main-nav-bar .nav-user-dropdown .nav-logout-btn {
        color: var(--text-bright);
        border-bottom-color: rgba(0, 0, 0, 0.06);
    }

    [data-theme="light"] .main-nav-bar .nav-submenu-dropdown a:hover,
    [data-theme="light"] .main-nav-bar .nav-submenu-dropdown .nav-submenu-item:hover,
    [data-theme="light"] .main-nav-bar .nav-user-dropdown a:hover,
    [data-theme="light"] .main-nav-bar .nav-user-dropdown .nav-logout-btn:hover {
        background: rgba(36, 112, 196, 0.1);
        color: var(--link);
    }

    [data-theme="light"] .main-nav-bar .nav-logout-btn {
        color: var(--text-bright);
    }

    .container {
        width: calc(100% - 1rem);
    }

    .main-content {
        padding: 12px 0 24px;
    }

    .panel {
        padding: 12px 14px;
        border-radius: 10px;
    }

    .forum-row,
    .topic-row {
        align-items: flex-start;
        gap: 4px 10px;
        padding: 9px 12px;
    }

    .forum-row {
        grid-template-columns: 22px minmax(0, 1fr);
        grid-template-rows: auto auto;
    }

    .forum-row > .forum-row-icon {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        margin-top: 1px;
        width: 22px;
        font-size: 16px;
    }

    .forum-row-main {
        display: contents;
    }

    .forum-row-name-row {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .forum-row-desc {
        grid-column: 2;
        grid-row: 2;
        min-width: 0;
    }

    .topic-row {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: flex-start;
    }

    .topic-row-body {
        display: contents;
    }

    .topic-row-started-desktop {
        display: none;
    }

    .topic-row-main {
        grid-column: 1;
        grid-row: 1;
    }

    .topic-row-sub {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 6px;
        margin-top: 0;
    }

    .topic-row-started {
        flex-direction: column;
        align-items: flex-start;
        font-size: 10px;
        line-height: 1.25;
        gap: 3px;
    }

    .topic-row-started-line {
        order: 2;
        flex: none;
        max-width: 100%;
    }

    .topic-row-started .badge.pinned,
    .topic-row-started .topic-row-pinned-badge {
        order: 1;
        font-size: 8px;
        padding: 1px 5px;
        margin-left: 0;
    }

    .topic-row-lastpost--mobile {
        display: flex;
    }

    .topic-row-stats {
        display: none;
    }

    .topic-row-replies-mobile {
        display: block;
        flex-shrink: 0;
        font-size: 10px;
        line-height: 1.25;
        white-space: nowrap;
        text-align: right;
        color: #888;
        font-variant-numeric: tabular-nums;
    }

    .forum-list-head {
        display: none;
    }

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

    .forum-row-topics,
    .forum-row-replies,
    .forum-row-last,
    .forum-row-stats-group {
        display: none;
    }

    .forum-row-stats-mobile {
        display: block;
        flex-shrink: 0;
        font-size: 10px;
        line-height: 1.25;
        white-space: nowrap;
        text-align: right;
        color: #888;
    }

    .post-row-inner {
        grid-template-columns: 1fr;
    }

    .post-userpanel {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .post-author-group {
        margin-bottom: 10px;
    }

    .post-body-header {
        font-size: 10px;
        gap: 6px 8px;
    }

    .post-body-header-actions {
        gap: 4px;
    }

    .post-body-header .badge-pending .post-meta-label,
    .post-body-header .post-staff-mod-badge .post-meta-label {
        display: none;
    }

    .post-body-header .badge-pending .post-meta-icon,
    .post-body-header .post-staff-mod-badge .post-meta-icon {
        display: block;
    }

    .post-body-header .badge-pending,
    .post-body-header .post-staff-mod-badge {
        width: 22px;
        height: 22px;
        min-width: 22px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .post-duplicate-cluster {
        margin-left: -10px;
        margin-right: -10px;
    }

    .post-duplicate-toggle {
        padding: 8px 10px;
        font-size: 11px;
    }

    .post-body-segment,
    .post-duplicate-segment {
        padding-top: 10px;
        margin-top: 10px;
    }

    .post-duplicate-modal-actions {
        flex-direction: column;
    }

    .post-duplicate-modal-actions .button {
        width: 100%;
    }

    .topic-jump-select {
        min-width: 140px;
    }

    .category-summary {
        padding: 14px;
    }

    .category-count {
        font-size: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid.forum-stats-cards > :last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .profile-panel {
        padding: 14px 12px;
    }

    .profile-pm-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .profile-pm-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
        width: 100%;
        gap: 6px;
    }

    .profile-pm-actions .profile-pm-action--compose {
        order: -1;
        flex: 1 0 100%;
        width: 100%;
        text-align: center;
    }

    .profile-pm-actions .profile-pm-action--friends,
    .profile-pm-actions .profile-pm-action--blacklist {
        flex: 1 1 calc(50% - 3px);
        width: auto;
        min-width: 0;
        justify-content: center;
        text-align: center;
    }

    .profile-pm-form-row {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-end;
        gap: 8px;
    }

    .profile-pm-field {
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
    }

    .profile-pm-field select {
        width: 100%;
        max-width: none;
    }

    .profile-pm-save {
        flex: 0 0 auto;
        width: auto;
        white-space: nowrap;
    }

    .profile-identity {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 12px;
    }

    .profile-identity-lead {
        display: flex;
        flex: 0 0 auto;
        align-items: flex-start;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 10px 12px;
    }

    .profile-identity-avatar-col {
        flex: 0 0 88px;
        width: 88px;
        max-width: 88px;
    }

    .profile-identity-main {
        flex: 1 1 0;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-align: left;
    }

    .profile-identity-heading {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-identity-heading h2 {
        font-size: 16px;
        width: 100%;
        text-align: left;
    }

    .profile-identity-badges {
        justify-content: flex-start;
    }

    .profile-reputation-chip {
        margin-top: 6px;
    }

    .profile-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .profile-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .profile-identity-actions {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        width: 100%;
    }

    .profile-identity-actions .profile-social-actions {
        display: contents;
    }

    .profile-identity-actions .profile-social-form,
    .profile-identity-actions .button,
    .profile-identity-actions .profile-report-btn {
        flex: 0 0 auto;
        width: 100%;
    }

    .profile-detail-badges {
        flex: 0 0 auto;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px 6px;
    }

    .profile-detail-badge {
        padding: 4px 8px;
    }

    .profile-detail-badge dd {
        font-size: 11.5px;
    }

    .profile-grid {
        grid-template-columns: minmax(110px, 42%) minmax(0, 1fr);
        gap: 5px 10px;
    }

    .panel-header-row {
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .panel-header-row .meta {
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
    }

    .panel-header-row .button,
    .panel-header-row form {
        flex-shrink: 0;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .button {
        text-align: center;
    }

    .shoutbox-compose {
        flex-direction: column;
        align-items: stretch;
    }

    .shoutbox-section-header {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .shoutbox-section-actions {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
    }

    .shoutbox-section-hint-full {
        display: none;
    }

    .shoutbox-section-hint-short {
        display: inline;
    }

    .shoutbox-section-hint {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .shoutbox-time-full {
        display: none;
    }

    .shoutbox-time-short {
        display: inline;
    }

    .forum-stats-summary-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stats-bar-row {
        grid-template-columns: 52px minmax(0, 1fr) 7.5ch;
        gap: 8px;
    }

    .shoutbox-compose-actions {
        width: 100%;
    }

    .shoutbox-send-btn {
        flex: 1;
        min-width: 0;
    }

    .shoutbox-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form:not(.search-page-form) {
        flex-wrap: wrap;
    }

    .search-page-form .search-form-row {
        flex-wrap: nowrap;
    }

    .back-to-top {
        right: 12px;
        bottom: calc(12px + var(--safe-bottom));
    }

    .forum-table,
    .data-table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .forum-table thead,
    .data-table thead {
        display: none;
    }

    .forum-table tbody,
    .data-table tbody {
        display: block;
        width: 100%;
    }

    .forum-table tbody tr,
    .data-table tbody tr {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-bottom: 10px;
        padding: 10px;
        background: var(--bg-panel-alt);
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }

    .forum-table tbody td,
    .data-table tbody td {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        border: none;
        padding: 4px 0;
    }

    .data-table--claim tbody td.claim-history-name {
        font-size: 14px;
        font-weight: 600;
        padding-bottom: 2px;
    }

    .data-table--claim tbody td.claim-history-method {
        color: #888;
        font-size: 12px;
        padding-top: 0;
        padding-bottom: 8px;
    }

    .data-table--claim tbody td.claim-history-status {
        padding: 0 0 10px;
    }

    .data-table--claim tbody td.claim-history-status .claim-pending-links {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 12px;
        margin-top: 8px;
    }

    .data-table--claim tbody td.claim-history-date {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0 0;
        margin-top: 6px;
        border-top: 1px solid var(--border);
        font-size: 12px;
        font-variant-numeric: tabular-nums;
    }

    .data-table--claim tbody td.claim-history-date::before {
        content: attr(data-label);
        flex: 0 1 auto;
        font-size: 11px;
        font-weight: 600;
        color: #888;
    }

    .data-table--profile-topics tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 2px 10px;
    }

    .data-table--profile-topics tbody td {
        padding: 2px 0;
    }

    .data-table--profile-topics tbody td:nth-child(1),
    .data-table--profile-topics tbody td:nth-child(2) {
        flex: 1 1 100%;
    }

    .data-table--profile-topics tbody td.profile-topic-posts,
    .data-table--profile-topics tbody td.profile-topic-date {
        display: inline-flex;
        flex: 0 1 auto;
        align-items: baseline;
        gap: 0;
        color: var(--text);
        font-size: 11px;
    }

    .data-table--profile-topics tbody td.profile-topic-posts::after {
        content: '·';
        margin-left: 10px;
        color: #666;
    }

    .data-table--profile-topics tbody td.profile-topic-date {
        margin-left: 0;
    }
}

/* Quill editor dark theme */
.quill-editor-wrap {
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.quill-editor-wrap .ql-toolbar.ql-snow {
    background: var(--section-top);
    border: none;
    border-bottom: 1px solid var(--border);
}

.quill-editor-wrap .ql-container.ql-snow {
    border: none;
    font-family: var(--font-main);
    font-size: 13px;
    min-height: 160px;
}

.quill-editor-wrap .ql-editor {
    color: var(--text-bright);
    min-height: 160px;
}

.quill-editor-wrap .ql-snow .ql-stroke {
    stroke: var(--text-bright);
}

.quill-editor-wrap .ql-snow .ql-fill {
    fill: var(--text-bright);
}

.quill-editor-wrap .ql-snow .ql-picker {
    color: var(--text-bright);
}

.quill-editor-wrap .ql-editor.ql-blank::before {
    color: #7a8494;
    font-style: normal;
    opacity: 1;
}

.quill-editor-wrap .ql-snow .ql-toolbar button.ql-table::before {
    content: '▦';
    font-size: 15px;
    line-height: 1;
}

.quill-editor-wrap .ql-snow .ql-picker.ql-header .ql-picker-label::before,
.quill-editor-wrap .ql-snow .ql-picker.ql-header .ql-picker-item::before {
    color: var(--text-bright);
}

.post-body table.post-table,
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 12px;
}

.post-body table td,
.post-body table th {
    border: 1px solid var(--border);
    padding: 6px 8px;
    vertical-align: top;
}

.post-body table th {
    background: var(--bg-panel-alt);
    color: var(--text-bright);
    font-weight: 600;
}

/* Poll widget */
.poll-widget {
    margin-bottom: 12px;
}

.poll-question {
    margin: 0 0 10px;
}

.poll-vote-form {
    display: grid;
    gap: 8px;
}

.poll-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.poll-results {
    display: grid;
    gap: 8px;
}

.poll-result-row {
    display: grid;
    grid-template-columns: 1fr 120px 70px;
    gap: 8px;
    align-items: center;
}

.poll-result-bar {
    height: 8px;
    background: var(--bg-panel-alt);
    border-radius: 4px;
    overflow: hidden;
}

.poll-result-bar span {
    display: block;
    height: 100%;
    background: var(--nav-top);
}

.poll-result-row.is-voted .poll-result-label {
    color: var(--link);
}

.poll-fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin: 12px 0;
}

.pinned-topics-list {
    margin: 0;
    padding-left: 18px;
}

.pinned-topics-list li {
    margin-bottom: 6px;
}

/* Notifications */
.notification-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notification-item {
    border-bottom: 1px solid var(--border);
}

.notification-item a {
    display: block;
    padding: 10px 4px;
    color: inherit;
}

.notification-item.is-unread a {
    background: rgba(36, 112, 196, 0.08);
}

.notification-body {
    display: block;
    color: var(--text);
    margin-top: 2px;
}

.unread-badge.mobile {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 9px;
    padding: 1px 4px;
}

.mobile-sticky-actions .mobile-action {
    position: relative;
}

/* Support / contact */
.hp-field {
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
}

.support-message,
.support-reply {
    padding: 10px;
    margin: 8px 0;
    background: var(--bg-panel-alt);
    border-radius: var(--radius);
}

.support-reply.is-staff {
    border-left: 3px solid var(--nav-top);
}

.cookie-prefs-btn {
    background: none;
    border: none;
    color: var(--link);
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.cookie-prefs-btn:hover {
    color: var(--link-hover);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* Shared toggles + tooltips (also in admin) */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-bright);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-input {
    -webkit-appearance: none;
    appearance: none;
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.toggle-track {
    position: absolute;
    inset: 0;
    background: #333;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-track::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.toggle-input:checked + .toggle-track {
    background: var(--nav-top);
}

.toggle-input:checked + .toggle-track::after {
    transform: translateX(20px);
}

.tooltip-wrap {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.tooltip-trigger {
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-panel-alt);
    color: var(--link);
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    cursor: pointer;
    line-height: 1;
}

.post-stat-badge-wrap .post-stat-badge.tooltip-trigger {
    width: auto;
    min-width: 52px;
    height: auto;
    min-height: 28px;
    padding: 5px 14px;
    border-radius: 3px;
    font-style: normal;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.2;
}

.post-stat-badge-wrap .post-stat-badge.post-stat-badge--positive {
    color: #2fbd5c;
    border-color: rgba(47, 189, 92, 0.45);
    background: rgba(47, 189, 92, 0.12);
}

.post-stat-badge-wrap .post-stat-badge.post-stat-badge--negative {
    color: #e04a4a;
    border-color: rgba(224, 74, 74, 0.45);
    background: rgba(224, 74, 74, 0.12);
}

.post-stat-badge-wrap .post-stat-badge.post-stat-badge--positive:hover,
.post-stat-badge-wrap .post-stat-badge.post-stat-badge--positive:focus-visible {
    color: #3dd66f;
    border-color: rgba(47, 189, 92, 0.65);
    background: rgba(47, 189, 92, 0.2);
}

.post-stat-badge-wrap .post-stat-badge.post-stat-badge--negative:hover,
.post-stat-badge-wrap .post-stat-badge.post-stat-badge--negative:focus-visible {
    color: #f05a5a;
    border-color: rgba(224, 74, 74, 0.65);
    background: rgba(224, 74, 74, 0.2);
}

[data-theme="light"] .post-stat-badge-wrap .post-stat-badge.post-stat-badge--positive {
    color: #1e7a3f;
    border-color: rgba(30, 122, 63, 0.45);
    background: rgba(30, 122, 63, 0.1);
}

[data-theme="light"] .post-stat-badge-wrap .post-stat-badge.post-stat-badge--negative {
    color: #a82828;
    border-color: rgba(168, 40, 40, 0.45);
    background: rgba(168, 40, 40, 0.1);
}

[data-theme="light"] .post-stat-badge-wrap .post-stat-badge.post-stat-badge--positive:hover,
[data-theme="light"] .post-stat-badge-wrap .post-stat-badge.post-stat-badge--positive:focus-visible {
    color: #1e7a3f;
    border-color: rgba(30, 122, 63, 0.65);
    background: rgba(30, 122, 63, 0.16);
}

[data-theme="light"] .post-stat-badge-wrap .post-stat-badge.post-stat-badge--negative:hover,
[data-theme="light"] .post-stat-badge-wrap .post-stat-badge.post-stat-badge--negative:focus-visible {
    color: #a82828;
    border-color: rgba(168, 40, 40, 0.65);
    background: rgba(168, 40, 40, 0.16);
}

.tooltip-popover {
    position: absolute;
    z-index: 500;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    min-width: 200px;
    max-width: 280px;
    padding: 10px 12px;
    background: #1a2430;
    border: 1px solid #2a4560;
    border-radius: 8px;
    color: #ddeeff;
    font-size: 11px;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.tooltip-popover[hidden] {
    display: none !important;
}

/* Confirm modal */
body.lz-modal-open {
    overflow: hidden;
}

.lz-modal[hidden] {
    display: none !important;
}

.lz-modal {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lz-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 14, 0.72);
    backdrop-filter: blur(4px);
}

.lz-modal-dialog,
.lz-modal-panel {
    position: relative;
    width: min(100%, 420px);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px 18px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    z-index: 1;
}

.lz-modal-panel h2 {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--text-bright);
}

.lz-modal-panel p {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
}

.lz-modal-title {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--text-bright);
}

.lz-modal-message {
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}

.lz-modal-notice {
    margin: -8px 0 16px;
    padding: 10px 12px;
    border: 1px solid rgba(196, 140, 60, 0.45);
    border-radius: 8px;
    background: rgba(196, 140, 60, 0.1);
    color: var(--text-bright, #eef4ff);
    font-size: 12px;
    line-height: 1.45;
}

.lz-modal-notice[hidden] {
    display: none;
}

.lz-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.lz-lang-modal .lz-modal-dialog {
    width: min(100%, 460px);
}

.lz-lang-form select {
    width: 100%;
    max-width: none;
}

.lz-lang-form .toggle-row {
    margin-top: 14px;
}

.lz-report-form .form-group {
    margin-bottom: 0;
}

.lz-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6000;
    max-width: min(420px, calc(100vw - 32px));
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lz-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.lz-toast--success {
    background: #1a4a2e;
    color: #8fdfb0;
    border: 1px solid rgba(66, 180, 110, 0.45);
}

.lz-toast--error {
    background: #4a1a1a;
    color: #f0a0a0;
    border: 1px solid rgba(200, 80, 80, 0.45);
}

[data-theme="light"] .lz-toast--success {
    background: #e8f5ec;
    color: #1a5c32;
    border-color: rgba(42, 157, 82, 0.35);
}

[data-theme="light"] .lz-toast--error {
    background: #fdeaea;
    color: #8b2020;
    border-color: rgba(196, 60, 60, 0.35);
}

.lz-toast--info {
    background: #1a3550;
    color: #9ec8f0;
    border: 1px solid rgba(80, 140, 200, 0.45);
}

[data-theme="light"] .lz-toast--info {
    background: #e8f2fb;
    color: #1a4a72;
    border-color: rgba(42, 120, 196, 0.35);
}

.lz-modal.is-danger .lz-modal-confirm {
    background: linear-gradient(to bottom, #c03030, #8b1a1a);
    border-color: #8b1a1a;
}

.lz-modal.is-danger .lz-modal-confirm:hover {
    filter: brightness(1.08);
}

[data-theme="light"] .lz-modal-backdrop {
    background: rgba(15, 23, 42, 0.45);
}

@media print {
    .site-header,
    .site-footer,
    .mobile-sticky-header,
    .desktop-top-header,
    .back-to-top,
    .cookie-banner,
    .topic-toolbar-actions,
    .topic-page-nav,
    .pagination,
    .reply-panel,
    .post-vote-bar,
    .post-mod-form,
    .post-mod-actions,
    .poll-widget,
    .mod-bar,
    .lz-modal {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .panel,
    .post-row {
        border-color: #ccc;
        box-shadow: none;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}
