:root {
    color-scheme: light;
    --navy: #102d4a;
    --navy-deep: #0b233b;
    --blue: #246496;
    --blue-soft: #edf5fc;
    --accent: #79c9df;
    --bg: #f2f5f8;
    --surface: #fff;
    --surface-alt: #f8fafc;
    --text: #27384c;
    --muted: #7a899a;
    --border: #e0e7ef;
    --shadow: 0 3px 14px #122d4a06;
    --danger: #b43e42;
    --success: #28785b;
    --radius: 9px;
    --focus: #419ac5;
    --on-primary: #fff;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --navy: #101e31;
    --navy-deep: #0b1727;
    --blue: #7ec3ef;
    --blue-soft: #20384c;
    --accent: #79c9df;
    --bg: #101a28;
    --surface: #172536;
    --surface-alt: #1b2c3f;
    --text: #d7e3ef;
    --muted: #93a6bb;
    --border: #2a3e53;
    --shadow: 0 3px 14px #0001;
    --danger: #ee8589;
    --success: #70c5a3;
    --on-primary: #102d4a;
}

html[data-theme="amber"] {
    color-scheme: light;
    --navy: #352e29;
    --navy-deep: #28221f;
    --blue: #956128;
    --blue-soft: #fbf2df;
    --accent: #e8bc78;
    --bg: #f5f1e9;
    --surface: #fffcf6;
    --surface-alt: #faf5eb;
    --text: #493e31;
    --muted: #948572;
    --border: #e6ddcc;
    --focus: #bd873a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
textarea,
select {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: 0.6;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

button svg,
a svg {
    vertical-align: middle;
}

svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1 {
    font-size: 29px;
    letter-spacing: -0.8px;
    line-height: 1.25;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 700;
}

h2 {
    font-size: 20px;
    letter-spacing: -0.3px;
}

h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

small,
.small {
    font-size: 12px;
}

.muted {
    color: var(--muted);
}

.nowrap {
    white-space: nowrap;
}

.container {
    max-width: 1240px;
    width: calc(100% - 64px);
    margin: 0 auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] {
    display: none !important;
}

.skip-link {
    position: fixed;
    left: 20px;
    top: -100px;
    background: var(--surface);
    padding: 10px 20px;
    z-index: 100;
}

.skip-link:focus {
    top: 10px;
}

.site-header {
    background: var(--navy);
    color: #fff;
    box-shadow: 0 2px 5px #102d4a15;
}

.header-inner {
    max-width: 1240px;
    width: calc(100% - 64px);
    min-height: 124px;
    margin: auto;
    display: flex;
    gap: 35px;
    align-items: center;
}

.brand {
    display: flex;
    gap: 13px;
    align-items: center;
    color: #fff;
    flex-shrink: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text > span {
    font-size: 34px;
    font-weight: 750;
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.brand-dot {
    color: var(--accent);
}

.brand small {
    font-size: 11px;
    color: #a8c2d7;
    letter-spacing: 0.4px;
    margin-top: 7px;
}

.header-search {
    display: flex;
    align-items: center;
    background: #ffffff0b;
    border: 1px solid #ffffff17;
    border-radius: 7px;
    height: 40px;
    width: 290px;
    margin-left: auto;
    color: #a8bfd1;
}

.header-search > svg {
    margin-left: 13px;
    width: 17px;
}

.header-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    color: #fff;
    background: none;
    outline: 0;
    padding: 10px;
    font-size: 12px;
}

.header-search input::placeholder {
    color: #a8bfd1;
}

.header-search button {
    color: #a8bfd1;
    padding: 0 12px;
    border: 0;
    background: none;
}

.user-tools {
    display: flex;
    gap: 9px;
    align-items: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    line-height: 1.4;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    transition:
        background 0.15s,
        transform 0.15s;
}

.button:hover {
    background: var(--surface-alt);
    text-decoration: none;
}

.button-primary {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--on-primary, #fff);
}

.button-primary:hover {
    filter: brightness(0.94);
    background: var(--blue);
}

.button-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #102d4a;
}

.button-accent:hover {
    background: var(--accent);
    filter: brightness(1.05);
}

.button-danger {
    color: var(--danger);
    border-color: var(--danger);
}

.button-small {
    padding: 5px 11px;
    min-height: 30px;
    font-size: 11px;
}

.button-quiet {
    background: none;
    color: var(--blue);
    border-color: transparent;
}

.header-login {
    color: #e0eaf2;
    background: #ffffff08;
    border-color: #ffffff24;
}

.header-login:hover {
    background: #ffffff14;
}

.navigation-wrap {
    background: var(--navy-deep);
    border-top: 1px solid #ffffff07;
}

.main-nav {
    display: flex;
    gap: 2px;
    align-items: stretch;
    min-height: 54px;
}

.main-nav > a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 19px;
    color: #a9bed1;
    font-size: 12px;
    position: relative;
    font-weight: 550;
    white-space: nowrap;
}

.main-nav > a:first-child {
    padding-left: 15px;
}

.main-nav > a:hover,
.main-nav > a.active {
    color: #fff;
    text-decoration: none;
    background: #ffffff05;
}

.main-nav > a.active:after {
    position: absolute;
    height: 3px;
    background: var(--accent);
    content: "";
    bottom: 0;
    left: 15px;
    right: 15px;
    border-radius: 3px 3px 0 0;
}

.nav-icon {
    font-size: 19px;
    opacity: 0.85;
}

.nav-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #72c6b0;
    margin-left: 1px;
}

.nav-spacer {
    flex: 1;
}

.theme-toggle {
    display: flex;
    gap: 8px;
    align-items: center;
    border: 0;
    color: #a9bed1;
    background: none;
    padding: 0 8px 0 18px;
    font-size: 20px;
}

.theme-toggle span {
    font-size: 11px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    font-size: 12px;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 14px;
    font-weight: 700;
    border: 1px solid var(--border);
}

.header-user .avatar {
    border: 1px solid #ffffff1c;
    background: #ffffff12;
    color: var(--accent);
}

.avatar-large {
    width: 70px;
    height: 70px;
    font-size: 26px;
    border-radius: 16px;
}

.page-wrap {
    min-height: calc(100vh - 295px);
    padding-bottom: 35px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 22px 0 21px;
    font-size: 11px;
    color: var(--muted);
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--muted);
}

.breadcrumbs span:last-child {
    color: var(--text);
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 25px;
}

.page-heading p {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 0;
}

.eyebrow {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.7px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 8px;
}

.page-heading .heading-actions {
    display: flex;
    gap: 9px;
    align-items: center;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 278px;
    gap: 24px;
    align-items: start;
}

.welcome-banner {
    display: flex;
    align-items: center;
    gap: 17px;
    border: 1px solid #b5d5e8;
    border-radius: var(--radius);
    padding: 20px 23px;
    background: var(--blue-soft);
    margin-bottom: 24px;
}

.welcome-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--surface);
    color: var(--blue);
}

.welcome-icon svg {
    width: 25px;
    height: 25px;
}

.welcome-banner h2 {
    font-size: 15px;
    margin-bottom: 4px;
}

.welcome-banner p {
    font-size: 12px;
    margin: 0;
    color: var(--muted);
}

.welcome-banner .button {
    margin-left: auto;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 22px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
    gap: 15px;
}

.panel-header h2,
.panel-header h3 {
    font-size: 13px;
    margin: 0;
    font-weight: 700;
}

.panel-header .count {
    color: var(--muted);
    font-size: 11px;
}

.panel-body {
    padding: 22px;
}

.category-header {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--blue);
    color: #fff;
    padding: 14px 19px;
}

.category-header svg {
    width: 17px;
}

.category-header h2 {
    font-size: 12px;
    letter-spacing: 0.1px;
    margin: 0;
    font-weight: 650;
}

.category-header small {
    font-size: 10px;
    opacity: 0.7;
    margin-left: auto;
}

html[data-theme="dark"] .category-header {
    background: #234761;
}

.category-description {
    padding: 9px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 11px;
    color: var(--muted);
}

.board-row {
    display: grid;
    grid-template-columns: 45px minmax(0, 1fr) 95px 178px;
    gap: 16px;
    align-items: center;
    padding: 22px 19px;
    border-bottom: 1px solid var(--border);
}

.board-row:last-child {
    border-bottom: 0;
}

.board-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    background: var(--blue-soft);
    color: var(--blue);
    border-radius: 11px;
}

.board-icon svg {
    width: 23px;
    height: 23px;
}

.board-title {
    font-size: 14px;
    font-weight: 650;
    margin-bottom: 4px;
    display: inline-block;
}

.board-info p {
    font-size: 11px;
    color: var(--muted);
    margin: 0;
    line-height: 1.55;
}

.board-counts {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    text-align: center;
}

.board-counts strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.board-counts span {
    display: block;
    color: var(--muted);
    font-size: 9px;
    margin-top: 5px;
}

.board-latest {
    display: flex;
    gap: 10px;
    min-width: 0;
    align-items: center;
    border-left: 1px solid var(--border);
    padding-left: 17px;
}

.board-latest .avatar {
    height: 29px;
    width: 29px;
    border-radius: 8px;
    font-size: 11px;
}

.board-latest > div {
    min-width: 0;
}

.board-latest a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
}

.board-latest small {
    display: block;
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .panel-header {
    padding: 16px 18px;
}

.sidebar .panel-body {
    padding: 17px 18px;
}

.sidebar-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 12px;
}

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

.sidebar p {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.8;
}

.sidebar .button {
    width: 100%;
    margin-top: 5px;
}

.recent-item {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.recent-item:last-child {
    border-bottom: 0;
}

.recent-item .avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 11px;
    margin-top: 2px;
}

.recent-item a {
    font-size: 11px;
    font-weight: 650;
    line-height: 1.55;
    display: block;
}

.recent-item small {
    font-size: 10px;
    color: var(--muted);
    display: block;
    margin-top: 4px;
}

.stats-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.stats-list div {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}

.stats-list dt {
    color: var(--muted);
}

.stats-list dd {
    font-weight: 650;
    margin: 0;
}

.online-heading {
    display: flex;
    gap: 7px;
    align-items: center;
}

.status-dot {
    height: 6px;
    width: 6px;
    border-radius: 50%;
    display: inline-block;
    background: #54ad8a;
}

.online-list {
    font-size: 11px;
    line-height: 1.9;
}

.online-list a {
    margin-right: 7px;
}

.sidebar-note {
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    margin: 20px 0;
}

.section-label {
    display: flex;
    justify-content: space-between;
    margin: 4px 0 12px;
    font-size: 10px;
    font-weight: 650;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.3px;
}

.section-label span:last-child {
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.community-strip {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 21px;
    margin-top: 3px;
}

.community-strip svg {
    color: var(--muted);
}

.community-strip p {
    font-size: 11px;
    margin: 0;
    color: var(--muted);
}

.community-strip strong {
    font-size: 11px;
    color: var(--text);
    font-weight: 600;
}

.community-strip a {
    margin-left: auto;
    font-size: 11px;
    white-space: nowrap;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--border);
    padding: 27px 0 30px;
    color: var(--muted);
    font-size: 10px;
}

.site-footer > div:first-child {
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-brand {
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.6px;
    color: var(--text);
}

.footer-brand span {
    color: var(--blue);
}

.footer-links {
    display: flex;
    gap: 22px;
    align-items: center;
}

.footer-links a {
    color: var(--muted);
}

.loading-state,
.empty-state {
    text-align: center;
    padding: 60px 25px;
    color: var(--muted);
}

.loading-state p,
.empty-state p {
    margin: 12px auto 20px;
    max-width: 400px;
    font-size: 13px;
}

.empty-state h2 {
    font-size: 19px;
    color: var(--text);
    margin: 12px 0 0;
}

.empty-state > svg {
    height: 34px;
    width: 34px;
    color: var(--blue);
}

.spinner {
    display: inline-block;
    width: 23px;
    height: 23px;
    border: 2px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.alert {
    padding: 14px 17px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 12px;
    margin-bottom: 18px;
}

.alert-error {
    border-color: #cf747b75;
    background: #cf747b0b;
    color: var(--danger);
}

.alert-success {
    color: var(--success);
    border-color: #54ad8a65;
    background: #54ad8a0a;
}

.alert a {
    font-weight: 650;
}

.setup-panel {
    max-width: 760px;
    margin: 25px auto 70px;
}

.setup-panel .panel-body {
    padding: 35px;
}

.setup-panel pre {
    padding: 17px;
    background: var(--navy-deep);
    color: #d5e4f2;
    border-radius: 7px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.9;
}

.setup-panel h1 {
    font-size: 24px;
}

.setup-panel p {
    color: var(--muted);
    font-size: 13px;
}

.form-stack {
    display: grid;
    gap: 18px;
}

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

.form-group label {
    font-size: 12px;
    font-weight: 650;
}

.form-group input,
.form-group textarea,
.form-group select,
.input {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 6px;
    padding: 10px 12px;
    min-height: 40px;
    font-size: 13px;
}

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

.form-group small {
    font-size: 11px;
    color: var(--muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-actions .muted {
    font-size: 11px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.checkbox-label input {
    accent-color: var(--blue);
    width: 16px;
    height: 16px;
}

.hp-field {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.modal {
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 450px;
    max-width: calc(100% - 30px);
    padding: 35px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 90px #0004;
}

.modal::backdrop {
    background: #071b32a8;
    backdrop-filter: blur(3px);
}

.modal h2 {
    font-size: 24px;
    margin-bottom: 7px;
}

.modal .modal-intro {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 24px;
}

.modal-close {
    position: absolute;
    right: 13px;
    top: 10px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 24px;
    border: 0;
    background: none;
    color: var(--muted);
    border-radius: 5px;
}

.icon-button:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.modal .button-primary {
    width: 100%;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    margin-top: 22px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

.link-button {
    border: 0;
    padding: 0;
    background: none;
    color: var(--blue);
    font-size: inherit;
}

.link-button:hover {
    text-decoration: underline;
}

.form-message:empty {
    display: none;
}

.form-message {
    margin-bottom: 15px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    border: 1px solid var(--border);
    border-radius: 6px 6px 0 0;
    background: var(--surface-alt);
    padding: 7px;
}

.toolbar button {
    min-width: 31px;
    height: 29px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.toolbar button:hover {
    background: var(--surface);
    border-color: var(--border);
}

.toolbar .toolbar-divider {
    height: 19px;
    width: 1px;
    background: var(--border);
    margin: 0 4px;
}

.toolbar .preview-button {
    margin-left: auto;
    font-size: 11px;
    min-width: 65px;
    color: var(--blue);
}

.composer textarea {
    display: block;
    width: 100%;
    min-height: 200px;
    resize: vertical;
    padding: 16px;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 6px 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    line-height: 1.75;
}

.composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.composer-footer small {
    color: var(--muted);
    font-size: 10px;
}

.preview-box {
    border: 1px dashed var(--border);
    border-radius: 7px;
    padding: 18px;
    margin-top: 15px;
    min-height: 70px;
    overflow-wrap: anywhere;
}

.preview-box:before {
    display: block;
    content: "PREVIEW";
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 10px;
}

.preview-box:empty {
    display: none;
}

.topic-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 11px;
    margin-top: 12px;
}

.topic-meta a {
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 9px;
    line-height: 1.5;
    font-weight: 650;
    background: var(--blue-soft);
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-admin {
    color: #ad6b29;
    background: #dba65c1a;
}

.badge-moderator {
    color: var(--success);
    background: #54ad8a15;
}

.thread-list-header {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-alt);
    padding: 11px 19px;
    font-size: 10px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

.thread-row {
    display: grid;
    grid-template-columns: 39px minmax(0, 1fr) 95px 136px;
    align-items: center;
    gap: 16px;
    padding: 19px;
    border-bottom: 1px solid var(--border);
}

.thread-row:last-child {
    border-bottom: 0;
}

.thread-row.pinned {
    background: var(--blue-soft);
}

.thread-row .thread-title {
    font-size: 13px;
    font-weight: 650;
}

.thread-row .topic-meta {
    margin-top: 5px;
    font-size: 10px;
    gap: 6px;
}

.thread-row .avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
}

.thread-replies {
    text-align: center;
    font-size: 12px;
}

.thread-replies span {
    display: block;
    font-size: 9px;
    color: var(--muted);
    margin-top: 3px;
}

.thread-latest {
    font-size: 10px;
    color: var(--muted);
    border-left: 1px solid var(--border);
    padding-left: 16px;
}

.thread-latest strong {
    color: var(--text);
    display: block;
    font-size: 10px;
    font-weight: 500;
}

.pagination {
    display: flex;
    gap: 5px;
    align-items: center;
    margin: 20px 0 25px;
}

.pagination a,
.pagination span {
    display: grid;
    place-items: center;
    min-width: 31px;
    height: 31px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 11px;
    padding: 0 10px;
}

.pagination span.active {
    background: var(--blue);
    color: var(--surface);
    border-color: var(--blue);
}

.pagination span.ellipsis {
    border-color: transparent;
    background: none;
}

.pagination .page-count {
    margin-left: auto;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 10px;
}

.post {
    display: grid;
    grid-template-columns: 166px minmax(0, 1fr);
    overflow: visible;
}

.post-author {
    background: var(--surface-alt);
    border-right: 1px solid var(--border);
    padding: 23px 18px;
    text-align: center;
    border-radius: 9px 0 0 9px;
}

.post-author .avatar {
    width: 55px;
    height: 55px;
    font-size: 21px;
    margin-bottom: 11px;
    border-radius: 13px;
}

.post-author .author-name {
    display: block;
    font-weight: 650;
    font-size: 12px;
}

.post-author .badge {
    margin-top: 7px;
}

.author-stats {
    font-size: 10px;
    color: var(--muted);
    margin-top: 13px;
    line-height: 1.9;
}

.author-bio {
    font-size: 10px;
    color: var(--muted);
    margin-top: 15px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    word-break: break-word;
}

.post-content {
    padding: 18px 24px;
    min-width: 0;
}

.post-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 10px;
    color: var(--muted);
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.post-body {
    padding: 20px 0 23px;
    min-height: 100px;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.85;
}

.post-body img,
.preview-box img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.post-body pre,
.preview-box pre {
    padding: 14px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: auto;
    font-size: 12px;
    white-space: pre-wrap;
}

.post-body code,
.preview-box code {
    background: var(--surface-alt);
    padding: 2px 5px;
    border-radius: 3px;
}

.post-body blockquote,
.preview-box blockquote {
    border-left: 3px solid var(--blue);
    margin: 12px 0;
    padding: 13px 17px;
    background: var(--blue-soft);
    border-radius: 0 6px 6px 0;
    color: var(--text);
}

.post-bottom {
    border-top: 1px solid var(--border);
    padding-top: 11px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.post-bottom button {
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 10px;
    padding: 2px 0;
}

.post-bottom button:hover {
    color: var(--blue);
}

.moderation-bar {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
    padding: 13px 17px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-alt);
    font-size: 11px;
}

.moderation-bar strong {
    margin-right: auto;
    font-size: 11px;
}

.member-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

.member-toolbar input {
    max-width: 330px;
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.member-card {
    padding: 24px;
    text-align: center;
    margin-bottom: 0;
}

.member-card .avatar {
    margin-bottom: 12px;
    width: 50px;
    height: 50px;
    font-size: 20px;
}

.member-card h3 {
    font-size: 13px;
    margin-bottom: 7px;
}

.member-card p {
    font-size: 10px;
    color: var(--muted);
    margin: 12px 0 0;
}

.profile-header {
    padding: 28px;
    display: flex;
    gap: 22px;
    align-items: center;
}

.profile-header h1 {
    font-size: 25px;
}

.profile-header p {
    font-size: 12px;
    color: var(--muted);
    margin: 8px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.profile-details {
    display: flex;
    gap: 20px;
    margin-top: 14px;
    font-size: 11px;
    color: var(--muted);
}

.profile-details strong {
    color: var(--text);
}

.profile-header .button {
    margin-left: auto;
}

.account-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 24px;
}

.account-grid .panel-body {
    padding: 25px;
}

.chat-panel {
    margin-bottom: 0;
}

.chat-messages {
    height: 440px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 21px;
}

.chat-message {
    display: flex;
    gap: 11px;
    align-items: flex-start;
}

.chat-message .avatar {
    width: 31px;
    height: 31px;
    font-size: 11px;
    border-radius: 8px;
}

.chat-message > div {
    max-width: 80%;
    min-width: 0;
}

.chat-message .chat-message-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 11px;
}

.chat-message time {
    color: var(--muted);
    font-size: 9px;
}

.chat-message p {
    margin: 6px 0 0;
    padding: 10px 14px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 0 10px 10px 10px;
    font-size: 12px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.chat-message.own p {
    background: var(--blue-soft);
}

.chat-compose {
    padding: 17px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

.chat-compose input {
    flex: 1;
    min-width: 0;
}

.chat-status {
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
}

.table-scroll {
    overflow: auto;
}

.data-table {
    border-collapse: collapse;
    text-align: left;
    width: 100%;
    font-size: 11px;
}

.data-table th {
    font-size: 9px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface-alt);
    font-weight: 600;
}

.data-table td,
.data-table th {
    padding: 13px 17px;
    border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table select {
    font-size: 11px;
    min-width: 95px;
    padding: 6px 8px;
    min-height: 30px;
}

.data-table .table-actions {
    display: flex;
    gap: 7px;
    align-items: center;
}

.report-item {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.report-item:last-child {
    border-bottom: 0;
}

.report-item h3 {
    font-size: 12px;
}

.report-item p {
    font-size: 12px;
    color: var(--muted);
    white-space: pre-wrap;
}

.report-item .form-actions {
    margin-top: 13px;
}

.rules-content {
    max-width: 800px;
    margin: auto;
}

.rules-content .panel-body {
    padding: 30px 35px;
}

.rules-content h2 {
    font-size: 17px;
    margin-top: 25px;
}

.rules-content h2:first-child {
    margin-top: 0;
}

.rules-content p,
.rules-content li {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.9;
}

.rules-content ol {
    padding-left: 20px;
}

.rules-content li {
    margin-bottom: 10px;
}

.toast-region {
    position: fixed;
    right: 25px;
    bottom: 25px;
    display: grid;
    gap: 10px;
    z-index: 1100;
    max-width: calc(100% - 40px);
}

.toast {
    padding: 13px 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    box-shadow: 0 8px 35px #0002;
    font-size: 12px;
    animation: appear 0.15s;
}

.toast.error {
    border-color: var(--danger);
    color: var(--danger);
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.noscript {
    position: fixed;
    bottom: 0;
    background: #fee5ac;
    color: #492e00;
    width: 100%;
    text-align: center;
    padding: 20px;
}

.search-query {
    color: var(--blue);
}

.narrow {
    max-width: 600px;
    margin: auto;
}

.mobile-only {
    display: none;
}

@media (min-width: 1450px) {
    .container,
    .header-inner {
        max-width: 1280px;
    }

    .content-grid {
        grid-template-columns: minmax(0, 1fr) 286px;
        gap: 26px;
    }

    .board-row {
        grid-template-columns: 45px minmax(0, 1fr) 110px 190px;
        padding-top: 24px;
        padding-bottom: 24px;
    }
}

@media (max-width: 1100px) {
    .container,
    .header-inner {
        width: calc(100% - 40px);
    }

    .header-inner {
        gap: 20px;
    }

    .header-search {
        width: 230px;
    }

    .brand-text > span {
        font-size: 29px;
    }

    .brand img {
        width: 46px;
        height: 46px;
    }

    .content-grid {
        grid-template-columns: minmax(0, 1fr) 248px;
        gap: 19px;
    }

    .board-row {
        grid-template-columns: 39px minmax(0, 1fr) 80px;
        gap: 13px;
        padding: 19px 16px;
    }

    .board-latest {
        grid-column: 2/4;
        border-left: 0;
        padding-left: 0;
        margin-top: -5px;
    }

    .board-latest .avatar {
        display: none;
    }

    .board-latest > div {
        display: flex;
        gap: 7px;
        align-items: center;
        min-width: 0;
    }

    .board-latest a {
        max-width: 220px;
        font-size: 10px;
    }

    .board-latest small {
        font-size: 9px;
    }

    .board-icon {
        width: 39px;
        height: 39px;
    }

    .main-nav > a {
        padding: 0 14px;
    }

    .member-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .thread-row {
        grid-template-columns: 36px minmax(0, 1fr) 70px;
        gap: 12px;
    }

    .thread-latest {
        display: none;
    }
}

@media (max-width: 800px) {
    .header-inner {
        min-height: 105px;
        gap: 15px;
        flex-wrap: wrap;
        padding: 21px 0;
    }

    .header-search {
        display: none;
    }

    .user-tools {
        margin-left: auto;
    }

    .brand-text > span {
        font-size: 28px;
    }

    .brand small {
        font-size: 10px;
    }

    .header-user .user-name {
        display: none;
    }

    .main-nav {
        min-height: 49px;
        gap: 0;
    }

    .main-nav > a {
        font-size: 11px;
        padding: 0 12px;
    }

    .main-nav .nav-icon {
        display: none;
    }

    .main-nav > a:first-child {
        padding-left: 10px;
    }

    .theme-toggle span {
        display: none;
    }

    .theme-toggle {
        padding: 0 8px;
    }

    .content-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }

    .sidebar .panel {
        margin-bottom: 0;
    }

    .sidebar .sidebar-note {
        display: none;
    }

    .sidebar .sidebar-welcome {
        display: none;
    }

    .sidebar .recent-panel {
        grid-row: span 2;
    }

    .board-row {
        grid-template-columns: 42px minmax(0, 1fr) 90px 180px;
        padding: 21px 17px;
    }

    .board-latest {
        grid-column: auto;
        border-left: 1px solid var(--border);
        padding-left: 15px;
        margin: 0;
    }

    .board-latest > div {
        display: block;
    }

    .board-latest a {
        max-width: 140px;
        font-size: 10px;
    }

    .board-latest small {
        font-size: 9px;
        margin-top: 3px;
    }

    .page-heading {
        margin-bottom: 22px;
    }

    h1 {
        font-size: 26px;
    }

    .account-grid {
        grid-template-columns: 1fr;
    }

    .post {
        grid-template-columns: 135px minmax(0, 1fr);
    }

    .post-author {
        padding: 20px 12px;
    }

    .post-content {
        padding: 17px 20px;
    }

    .site-footer {
        align-items: flex-start;
    }

    .footer-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .footer-links span {
        width: 100%;
        text-align: right;
    }

    .page-wrap {
        padding-bottom: 30px;
    }

    .member-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .community-strip {
        margin-bottom: 22px;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 13px;
    }

    .container,
    .header-inner {
        width: calc(100% - 28px);
    }

    .header-inner {
        min-height: 95px;
        padding: 21px 0;
        gap: 12px;
    }

    .brand img {
        width: 39px;
        height: 39px;
    }

    .brand {
        gap: 9px;
    }

    .brand-text > span {
        font-size: 25px;
    }

    .brand small {
        font-size: 9px;
        letter-spacing: 0;
        margin-top: 5px;
    }

    .user-tools {
        gap: 6px;
    }

    .user-tools .button {
        padding: 7px 10px;
        font-size: 10px;
        min-height: 33px;
    }

    .user-tools > .button-accent {
        max-width: 92px;
        white-space: normal;
        line-height: 1.3;
    }

    .header-user .avatar {
        width: 31px;
        height: 31px;
        font-size: 12px;
    }

    .header-user {
        gap: 5px;
    }

    .user-tools .logout-button {
        width: 29px;
        padding: 0;
        overflow: hidden;
        min-width: 29px;
    }

    .main-nav {
        width: 100%;
        padding: 0 10px;
        overflow-x: auto;
        min-height: 48px;
    }

    .main-nav > a {
        font-size: 10px;
        padding: 0 11px;
        gap: 6px;
    }

    .main-nav > a:first-child {
        padding-left: 9px;
    }

    .nav-dot {
        width: 4px;
        height: 4px;
    }

    .main-nav > a.active:after {
        left: 9px;
        right: 9px;
    }

    .nav-spacer {
        min-width: 5px;
    }

    .theme-toggle {
        flex-shrink: 0;
        font-size: 18px;
        padding: 0 10px;
    }

    .breadcrumbs {
        font-size: 10px;
        padding: 18px 0;
        gap: 8px;
    }

    .page-heading {
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 23px;
        letter-spacing: -0.5px;
    }

    .page-heading p {
        font-size: 11px;
    }

    .page-heading .heading-actions {
        flex-shrink: 0;
    }

    .page-heading .button {
        font-size: 10px;
        padding: 8px 10px;
        min-height: 35px;
    }

    .eyebrow {
        font-size: 9px;
        letter-spacing: 1.4px;
    }

    .welcome-banner {
        padding: 15px;
        gap: 11px;
        margin-bottom: 20px;
    }

    .welcome-banner h2 {
        font-size: 13px;
    }

    .welcome-banner p {
        font-size: 10px;
        line-height: 1.7;
    }

    .welcome-icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .welcome-icon svg {
        width: 20px;
        height: 20px;
    }

    .welcome-banner .button {
        display: none;
    }

    .category-header {
        padding: 13px 15px;
    }

    .category-header h2 {
        font-size: 11px;
    }

    .category-header small {
        display: none;
    }

    .category-description {
        font-size: 10px;
        padding: 8px 15px;
    }

    .board-row {
        grid-template-columns: 34px minmax(0, 1fr) 60px;
        gap: 11px;
        padding: 18px 14px;
    }

    .board-icon {
        width: 34px;
        height: 36px;
        border-radius: 9px;
    }

    .board-icon svg {
        width: 20px;
        height: 20px;
    }

    .board-title {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .board-info p {
        font-size: 10px;
    }

    .board-counts {
        gap: 8px;
    }

    .board-counts strong {
        font-size: 12px;
    }

    .board-counts span {
        font-size: 8px;
        margin-top: 3px;
    }

    .board-latest {
        grid-column: 2/4;
        border-left: 0;
        padding-left: 0;
        margin-top: -5px;
    }

    .board-latest > div {
        display: flex;
        gap: 6px;
        align-items: center;
    }

    .board-latest a {
        max-width: 180px;
        font-size: 9px;
    }

    .board-latest small {
        font-size: 8px;
        margin-top: 0;
    }

    .panel {
        margin-bottom: 18px;
    }

    .content-grid {
        gap: 0;
    }

    .sidebar {
        gap: 14px;
        grid-template-columns: 1fr 1fr;
    }

    .sidebar .recent-panel {
        grid-column: 1/3;
        grid-row: auto;
    }

    .sidebar .recent-panel .panel-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .sidebar .recent-item {
        padding: 13px 14px;
    }

    .sidebar .recent-item .avatar {
        width: 25px;
        height: 25px;
        font-size: 9px;
    }

    .sidebar .recent-item a {
        font-size: 10px;
    }

    .sidebar .recent-item small {
        font-size: 9px;
    }

    .sidebar .panel-header {
        padding: 13px 14px;
    }

    .sidebar .panel-body {
        padding: 14px;
    }

    .sidebar .panel-header h3 {
        font-size: 11px;
    }

    .stats-list div,
    .online-list {
        font-size: 10px;
    }

    .online-list {
        line-height: 2;
    }

    .sidebar p {
        font-size: 10px;
    }

    .community-strip {
        padding: 15px;
        gap: 10px;
    }

    .community-strip p,
    .community-strip strong {
        font-size: 10px;
    }

    .community-strip a {
        font-size: 10px;
    }

    .community-strip svg {
        width: 19px;
        flex-shrink: 0;
    }

    .community-strip .hide-small {
        display: none;
    }

    .site-footer {
        display: block;
        padding: 23px 0;
    }

    .site-footer > div:first-child {
        justify-content: center;
    }

    .footer-links {
        justify-content: center;
        gap: 15px;
        margin-top: 14px;
    }

    .footer-links span {
        width: auto;
        text-align: center;
    }

    .footer-brand {
        font-size: 17px;
    }

    .site-footer {
        font-size: 9px;
    }

    .section-label {
        font-size: 9px;
        margin-bottom: 10px;
    }

    .section-label span:last-child {
        font-size: 9px;
    }

    .topic-meta {
        font-size: 10px;
        gap: 7px;
    }

    .thread-row {
        grid-template-columns: 29px minmax(0, 1fr) 40px;
        gap: 10px;
        padding: 15px 13px;
    }

    .thread-row .avatar {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        font-size: 10px;
    }

    .thread-row .thread-title {
        font-size: 12px;
    }

    .thread-row .topic-meta {
        font-size: 9px;
        gap: 5px;
    }

    .thread-replies {
        font-size: 11px;
    }

    .thread-replies span {
        font-size: 8px;
    }

    .thread-list-header {
        padding: 10px 13px;
        font-size: 9px;
    }

    .pagination .page-count {
        font-size: 9px;
    }

    .post {
        display: block;
    }

    .post-author {
        display: flex;
        align-items: center;
        gap: 10px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        border-radius: 9px 9px 0 0;
        text-align: left;
        padding: 12px 14px;
    }

    .post-author .avatar {
        width: 34px;
        height: 34px;
        font-size: 13px;
        border-radius: 9px;
        margin: 0;
    }

    .post-author .author-name {
        font-size: 11px;
    }

    .post-author .badge {
        margin-top: 3px;
        font-size: 8px;
    }

    .author-stats {
        margin: 0 0 0 auto;
        font-size: 9px;
    }

    .author-bio {
        display: none;
    }

    .post-content {
        padding: 13px 15px;
    }

    .post-top {
        font-size: 9px;
        padding-bottom: 12px;
    }

    .post-body {
        font-size: 12px;
        padding: 17px 0;
        line-height: 1.85;
    }

    .post-bottom {
        gap: 13px;
    }

    .post-bottom button {
        font-size: 9px;
    }

    .panel-header {
        padding: 14px 16px;
    }

    .panel-body {
        padding: 18px 16px;
    }

    .composer textarea {
        min-height: 170px;
        font-size: 12px;
        padding: 13px;
    }

    .toolbar {
        padding: 5px;
        gap: 2px;
    }

    .toolbar button {
        min-width: 26px;
        font-size: 11px;
    }

    .toolbar .toolbar-divider {
        margin: 0 2px;
    }

    .composer-footer {
        flex-wrap: wrap;
        gap: 11px;
    }

    .composer-footer small {
        font-size: 9px;
    }

    .composer-footer .button {
        margin-left: auto;
    }

    .form-group label {
        font-size: 11px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 12px;
    }

    .member-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 13px;
    }

    .member-card {
        padding: 20px 13px;
    }

    .member-card h3 {
        font-size: 12px;
    }

    .member-card p {
        font-size: 9px;
    }

    .profile-header {
        padding: 22px 18px;
        gap: 15px;
        flex-wrap: wrap;
    }

    .profile-header > .avatar {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }

    .profile-header > div {
        flex: 1;
        min-width: 150px;
    }

    .profile-header h1 {
        font-size: 22px;
    }

    .profile-header p {
        font-size: 11px;
    }

    .profile-header .button {
        margin-left: 70px;
    }

    .profile-details {
        font-size: 10px;
        gap: 13px;
    }

    .account-grid {
        gap: 0;
    }

    .account-grid .panel-body {
        padding: 20px;
    }

    .modal {
        padding: 29px 24px;
        border-radius: 12px;
    }

    .modal h2 {
        font-size: 22px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .chat-messages {
        height: 420px;
        padding: 18px 15px;
        gap: 19px;
    }

    .chat-message > div {
        max-width: calc(100% - 40px);
    }

    .chat-message .chat-message-meta {
        font-size: 10px;
    }

    .chat-message p {
        font-size: 11px;
        padding: 9px 12px;
    }

    .chat-message time {
        font-size: 8px;
    }

    .chat-compose {
        padding: 13px;
    }

    .chat-compose input {
        font-size: 12px;
    }

    .chat-compose .button {
        font-size: 11px;
        padding: 7px 11px;
    }

    .rules-content .panel-body {
        padding: 23px;
    }

    .rules-content p,
    .rules-content li {
        font-size: 12px;
    }

    .rules-content h2 {
        font-size: 16px;
    }

    .moderation-bar {
        font-size: 10px;
        padding: 11px;
        gap: 7px;
    }

    .moderation-bar strong {
        width: 100%;
    }

    .moderation-bar .button {
        font-size: 9px;
        padding: 5px 9px;
    }

    .setup-panel {
        margin-top: 10px;
    }

    .setup-panel .panel-body {
        padding: 25px;
    }

    .setup-panel h1 {
        font-size: 21px;
    }

    .setup-panel pre {
        font-size: 10px;
    }

    .toast-region {
        right: 15px;
        bottom: 15px;
    }

    .toast {
        font-size: 11px;
    }

    .mobile-only {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *:before,
    *:after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Keep search available when the compact header hides the search field. */
.main-nav > a.nav-search {
    display: none;
}

@media (max-width: 800px) {
    .main-nav > a.nav-search {
        display: flex;
        padding: 0 11px;
        flex-shrink: 0;
    }

    .nav-search svg {
        width: 17px;
        height: 17px;
    }
}

@media (max-width: 600px) {
    .page-heading {
        flex-direction: column;
        gap: 14px;
    }

    .page-heading .heading-actions {
        flex-wrap: wrap;
    }
}

/* User-provided titles and board labels must not widen the page. */
h1,
h2,
h3,
h4,
.thread-title,
.board-title {
    overflow-wrap: anywhere;
}
.page-heading > div:first-child {
    min-width: 0;
}
.breadcrumbs > :is(a, span) {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Published tables use the same visible cells as the editor and scroll locally. */
.post-body table,
.preview-box table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 16px 0;
}
.post-body :is(td, th),
.preview-box :is(td, th) {
    border: 1px solid var(--border);
    padding: 8px 10px;
    min-width: 90px;
    overflow-wrap: anywhere;
}
.post-body th,
.preview-box th {
    background: var(--surface-alt);
    text-align: left;
}

/* Private and maintenance entry screens retain account/legal controls. */
html[data-community-closed="true"] .x-secondary-nav,
html[data-community-closed="true"] .main-nav > a.nav-search,
html[data-community-closed="true"] .main-nav > a[data-tab="members"],
html[data-community-closed="true"] .main-nav > a[data-tab="chat"] {
    display: none;
}
#community-maintenance-notice {
    margin-bottom: 20px;
}
