/* 
 * CWAL Boards Base Styles
 * Uses modern CSS custom properties for theming 
 */

:root {
    /* Light Theme Tokens */
    --bg-color: #f4f6f8;
    --text-color: #1a1a1a;
    --text-muted: #666;
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --secondary-color: #e0e4e8;
    --secondary-text: #333;
    --danger-color: #dc3545;
    --success-color: #28a745;

    /* Panel/Glassmorphism Tokens */
    --panel-bg: rgba(255, 255, 255, 0.85);
    --panel-border: rgba(0, 0, 0, 0.1);
    --panel-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);

    --nav-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #ccc;
    --code-bg: #f8f9fa;
    --quote-bg: #f1f3f5;
    --quote-border: #0066cc;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-danger { color: var(--danger-color); }

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: var(--panel-shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: background 0.3s, border 0.3s;
}

/* Navigation */
.navbar {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--panel-border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none !important;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-search {
    display: flex;
    gap: 5px;
}

.nav-search input {
    padding: 5px 10px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-color);
}

.nav-search button {
    padding: 5px 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Main Content Area */
.main-content {
    padding-top: 30px;
    padding-bottom: 50px;
    min-height: calc(100vh - 150px);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
    text-decoration: none !important;
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--secondary-text);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.875rem;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    background: var(--secondary-color);
    color: var(--secondary-text);
}

.btn-sm:hover {
    background: #ccc;
    color: #000;
}
.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
    font: inherit;
    padding: 0;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-color);
    font-family: inherit;
}

select {
    min-height: 42px;
}

textarea {
    resize: vertical;
}

.help-text {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: #e4f3e8;
    border: 1px solid #397c4b;
    color: #18552a;
}

.alert-danger {
    background-color: #fbe8e5;
    border: 1px solid #b44b3d;
    color: #7b2118;
}

.alert-info {
    background-color: #e4eff6;
    border: 1px solid #477b9d;
    color: #174d70;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-box {
    width: 100%;
    max-width: 400px;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.btn-block {
    width: 100%;
    display: block;
}

.auth-links {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
}

/* Header Actions */
.header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.breadcrumbs {
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: var(--text-muted);
}

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

/* Forum List */
.forum-list {
    display: flex;
    flex-direction: column;
}

/* Topic List */
.topic-list-header {
    display: flex;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--panel-border);
}

.col-title { flex: 1; }
.col-stats { width: 100px; text-align: center; }
.col-last { width: 200px; text-align: right; }

.topic-row {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--panel-border);
    align-items: center;
}

.topic-row.pinned {
    background-color: rgba(0, 102, 204, 0.05);
}

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

.topic-title {
    flex: 1;
}

.topic-title > a {
    font-size: 1.1rem;
    font-weight: 500;
}

.topic-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.topic-stats {
    width: 100px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.topic-last {
    width: 200px;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Post View */
.post {
    display: flex;
    margin-bottom: 20px;
}

.post-sidebar {
    width: 150px;
    padding-right: 20px;
    border-right: 1px solid var(--panel-border);
    text-align: center;
}

.author-avatar {
    margin-bottom: 10px;
}

.author-avatar img {
    max-width: 100px;
    height: auto;
    border-radius: 4px;
}

.default-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    color: white;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin: 0 auto;
}

.author-name {
    font-weight: bold;
    word-break: break-word;
}

.post-content {
    flex: 1;
    min-width: 0;
    padding-left: 20px;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-body {
    min-height: 100px;
    overflow-wrap: anywhere;
}

.post-body img {
    max-width: 100%;
    height: auto;
}

.video-embed {
    width: min(100%, 900px);
    aspect-ratio: 16 / 9;
    margin: 16px 0;
    background: #000;
}

.video-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.spotify-embed {
    width: min(100%, 700px);
    margin: 16px 0;
}

.spotify-embed iframe {
    display: block;
    max-width: 100%;
    border: 0;
}
.media-consent { display: grid; min-height: var(--embed-height, 180px); place-content: center; justify-items: center; gap: 10px; padding: 20px; border: 1px solid var(--panel-border); background: var(--code-bg); text-align: center; }
.media-consent p { font-weight: 700; }
.media-consent a { font-size: .8rem; }

/* BBCode Specific Styles */
.cwal-quote {
    background: var(--quote-bg);
    border-left: 4px solid var(--quote-border);
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 0 4px 4px 0;
}

.quote-header {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.quote-source {
    margin-left: 6px;
    font-size: .76rem;
    font-weight: 600;
}

.code-block {
    background: var(--code-bg);
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid var(--panel-border);
}

.cwal-spoiler {
    max-width: 72ch;
    margin: 10px 0;
    border: 1px solid var(--panel-border);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    background: var(--quote-bg);
}

.cwal-spoiler > summary {
    padding: 9px 12px;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.cwal-spoiler > summary::-webkit-details-marker { display: none; }
.cwal-spoiler > summary::before {
    display: inline-block;
    width: 1em;
    margin-right: 4px;
    color: var(--accent);
    content: "▸";
}
.cwal-spoiler[open] > summary::before { content: "▾"; }
.cwal-spoiler > summary:focus-visible { outline: 2px solid var(--primary-color); outline-offset: -2px; }
.cwal-spoiler[open] > summary { border-bottom: 1px solid var(--panel-border); }
.spoiler-content { padding: 10px 12px; }

/* Attachments */
.post-attachments {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--panel-border);
}

.post-attachments h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

.attachment-item {
    background: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.attachment-missing {
    border: 1px dashed var(--input-border);
    color: var(--text-muted);
}

.attachment-missing small {
    display: block;
}

.attachment-image {
    display: grid;
    grid-template-rows: 130px auto;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    background: var(--secondary-color);
    color: var(--text-color);
    text-decoration: none;
}

.attachment-image img {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.attachment-image span,
.attachment-file {
    padding: 8px;
    overflow-wrap: anywhere;
    font-size: .8rem;
}

.attachment-file {
    display: grid;
    align-content: center;
    min-height: 72px;
    border: 1px solid var(--panel-border);
    background: var(--secondary-color);
    color: var(--text-color);
    text-decoration: none;
}

.attachment-file span { color: var(--text-muted); font-size: .72rem; }
.attachment-image span { display: grid; gap: 2px; }
.attachment-image small { color: var(--text-muted); font-size: .7rem; }

.confirm-dialog, .appearance-dialog, .image-lightbox {
    position: fixed;
    inset: 0;
    margin: auto;
    height: fit-content;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    overflow: auto;
    background: var(--panel-bg);
    color: var(--text-color);
}

.image-lightbox {
    width: min(94vw, 1100px);
    max-height: 92vh;
    padding: 44px 16px 16px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    color: var(--text-color);
}

.image-lightbox::backdrop { background: rgba(5, 12, 16, .82); }
.confirm-dialog { width: min(92vw, 460px); padding: 24px; border: 1px solid var(--panel-border); border-radius: var(--ui-radius, 6px); background: var(--panel-bg); color: var(--text-color); box-shadow: 0 18px 60px rgba(0,0,0,.3); }
.confirm-dialog::backdrop { background: rgba(5, 12, 16, .7); }
.confirm-dialog h2 { margin: 0 0 8px; color: var(--text-color); font-size: 1.2rem; }
.confirm-dialog p { margin: 0 0 18px; color: var(--text-muted); line-height: 1.5; }
.image-lightbox figure { display: grid; justify-items: center; gap: 10px; }
.image-lightbox img { display: block; max-width: 100%; max-height: calc(92vh - 90px); object-fit: contain; }
.image-lightbox figcaption { color: var(--text-muted); overflow-wrap: anywhere; }
.lightbox-close { position: absolute; top: 9px; right: 10px; padding: 5px 9px; border: 1px solid var(--panel-border); background: var(--secondary-color); color: var(--secondary-text); cursor: pointer; }

.composer-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 9px 10px;
    background: var(--secondary-color);
}

.composer-tools button {
    min-width: 30px;
    min-height: 28px;
    padding: 3px 6px;
    border: 1px solid var(--panel-border);
    border-radius: 2px;
    background: var(--input-bg);
    color: var(--text-color);
    font: inherit;
    font-size: .7rem;
    cursor: pointer;
}
.toolbar-group { display: inline-flex; align-items: center; gap: 5px; padding-right: 10px; }
.toolbar-group + .toolbar-group { padding-left: 10px; border-left: 1px solid var(--panel-border); }
.toolbar-group:last-of-type { padding-right: 0; }
.toolbar-group-label { margin: 0 2px 0 3px; color: var(--text-muted); font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.composer-tools button:hover, .composer-tools button:focus-visible { border-color: var(--primary-color); background: var(--panel-bg); color: var(--primary-color); }
.composer-tools button.is-active { border-color: var(--primary-color); background: color-mix(in srgb, var(--primary-color) 12%, var(--panel-bg)); color: var(--primary-color); }
.formatting-help { margin: 0; padding: 7px 10px 9px; border-top: 1px solid var(--panel-border); background: color-mix(in srgb, var(--secondary-color) 62%, var(--panel-bg)); color: var(--text-muted); font-size: .7rem; }
.formatting-help summary { width: max-content; cursor: pointer; color: var(--primary-color); font-weight: 750; }
.formatting-examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px; margin-top: 7px; }
.formatting-examples span { display: grid; gap: 2px; min-width: 0; padding: 6px 8px; border: 1px solid var(--panel-border); background: var(--panel-bg); }
.formatting-examples code { overflow-wrap: anywhere; color: var(--text-color); font-size: .68rem; }
.formatting-examples small { color: var(--text-muted); font-size: .65rem; }

.smiley-picker { flex: 1 0 100%; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; padding-top: 6px; border-top: 1px solid var(--panel-border); }
.smiley-picker:not([hidden]) { display: grid; }
.composer-tools .smiley-picker button { padding: 3px; font-size: 1.05rem; }
.smiley-toggle[aria-expanded="true"] { border-color: var(--primary-color); background: var(--panel-bg); }

.composer-tools + textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.composer-preview { margin-top: 10px; border: 1px solid var(--panel-border); background: var(--panel-bg); }
.composer-preview-heading { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-bottom: 1px solid var(--panel-border); background: var(--secondary-color); font-size: .68rem; }
.preview-status { color: var(--text-muted); }
.post-body ul, .post-body ol { margin: 8px 0 16px; padding-left: 28px; }
.post-body li { margin: 4px 0; }
.composer-count { display: block; margin-top: 4px; color: var(--text-muted); font-size: .68rem; text-align: right; transition: color .15s ease; }
.draft-recovery, .file-selection { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 7px 0; padding: 8px 10px; border: 1px solid var(--panel-border); background: var(--secondary-color); font-size: .8rem; }
.draft-recovery span, .file-selection span { margin-right: auto; }
.form-group.is-dragging { outline: 3px solid var(--primary-color); outline-offset: 4px; }

.topic-meta .topic-moderation-link { color: var(--text-muted); font-size: inherit; font-weight: 600; text-decoration: none; }

.topic-moderation-link:hover,
.topic-moderation-link:focus-visible {
    color: var(--primary-color);
    text-decoration: underline;
}

.poll-options {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.poll-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--panel-border);
    background: var(--input-bg);
    cursor: pointer;
}

.nav-logout {
    display: inline-flex;
    margin: 0;
}

fieldset {
    border: 1px solid var(--panel-border);
    padding: 16px;
    margin: 20px 0;
}

legend {
    padding: 0 6px;
    font-weight: 600;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 20px 0;
}
.page-jump { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.page-jump input { width: 70px; min-height: 36px !important; padding: 5px 7px; }

.page-link {
    display: inline-block;
    padding: 5px 10px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
}

.page-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Footer */
.site-footer {
    padding: 20px 0;
    border-top: 1px solid var(--panel-border);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

.footer-subtext {
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Profile specific */
.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
}
.default-avatar-large {
    width: 120px;
    height: 120px;
    background: var(--primary-color);
    color: white;
    font-size: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.profile-avatar-large img {
    width: 120px;
    height: 120px;
    border-radius: 4px;
    object-fit: cover;
}
.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}
.badge-primary { background: var(--primary-color); color: var(--on-primary, white); }
.badge-secondary { background: #414b53; color: #ffffff; }
.badge-danger { background: var(--danger-color); color: white; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-content { flex-direction: column; gap: 15px; }
    .nav-links { width: 100%; flex-wrap: wrap; justify-content: center; }
    .nav-search { width: 100%; }
    .nav-search input { flex: 1; min-width: 0; }
    .header-action { align-items: flex-start; gap: 12px; }
    .topic-list-header { display: none; }
    .topic-row { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
    .topic-title { flex-basis: 100%; }
    .topic-stats, .topic-last { width: auto; text-align: left; }
    .post { flex-direction: column; }
    .post-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--panel-border); padding: 0 0 15px 0; display: flex; align-items: center; gap: 15px; text-align: left; }
    .author-avatar img, .default-avatar { width: 40px; height: 40px; font-size: 20px; }
    .post-content { padding-left: 0; padding-top: 15px; }
    .profile-header { align-items: flex-start; gap: 16px; }
    .profile-avatar-large img, .default-avatar-large { width: 72px; height: 72px; font-size: 34px; }
}

/* 2026 community archive interface */
:root {
    --canvas: #f3f0e8;
    --canvas-grid: rgba(20, 47, 64, 0.045);
    --ink: #182a36;
    --accent: #d34b32;
    --accent-strong: #ac3524;
    --rule: #c8c3b7;
}

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    font-family: var(--body-font, "Trebuchet MS", Verdana, sans-serif);
    font-size: 15px;
    line-height: 1.65;
    background-color: var(--bg-color);
    background-image: linear-gradient(var(--canvas-grid) 1px, transparent 1px);
    background-size: 100% 32px;
}

body::before {
    content: "";
    display: block;
    height: 4px;
    background: var(--accent);
}

.container { width: min(1180px, calc(100% - 40px)); padding: 0; }
.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; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 8px 12px; background: #fff; color: #111; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.navbar {
    padding: 8px 0;
    background: var(--nav-bg);
    border: 0;
    box-shadow: 0 2px 12px rgba(7, 25, 37, 0.16);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: #fff !important; }
.brand-mark { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--accent); color: #fff; font: 700 18px/1 Georgia, serif; }
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { font: 700 1.15rem/1.1 var(--heading-font, Georgia, serif); }
.brand-copy small { margin-top: 3px; color: rgba(255,255,255,.64); font-size: .68rem; }
.nav-links { gap: 8px; }
.nav-menu-button { display: none; min-height: 40px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; font: inherit; font-weight: 700; }
.nav-count { display: inline-grid; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; border-radius: 10px; background: var(--accent); color: var(--on-accent, #fff); font-size: .68rem; }
.nav-link, .btn-link { padding: 8px 10px; color: rgba(255,255,255,.82) !important; text-decoration: none; }
.nav-link:hover, .btn-link:hover { color: #fff !important; background: rgba(255,255,255,.08); text-decoration: none; }
.admin-link { color: #ffd6c9 !important; }
.nav-search { position: relative; margin-right: 8px; }
.nav-search input { width: 235px; min-height: 38px; padding: 7px 76px 7px 12px; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; }
.nav-search input::placeholder { color: rgba(255,255,255,.58); }
.nav-search button { position: absolute; right: 3px; top: 3px; min-height: 32px; padding: 4px 11px; background: var(--accent); color: var(--on-accent, #fff); font-weight: 700; }

.main-content { padding-top: 28px; padding-bottom: 56px; }
h1, h2, h3, h4 { color: var(--text-color); line-height: 1.2; }
h1 { font-size: 2.35rem; }
h2 { font-size: 1.45rem; }

.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.page-intro { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); align-items: end; gap: 48px; padding: 18px 0 32px; border-bottom: 1px solid var(--panel-border); }
.page-intro h1 { max-width: 700px; margin: 0; }
.page-intro > p { color: var(--text-muted); font-family: var(--heading-font, Georgia, serif); font-size: 1.05rem; }
.page-heading { padding: 10px 0 16px; border-bottom: 1px solid var(--panel-border); }
.page-heading h1 { margin: 0; font-size: 2.1rem; }
.page-heading p:not(.eyebrow) { max-width: 720px; margin-top: 8px; color: var(--text-muted); }

.forum-index { display: flex; flex-direction: column; }
.community-stats { display: block; align-items: center; gap: 22px; order: 1; margin-bottom: 16px; padding: 8px 10px; border: 1px solid var(--ui-rule); background: var(--panel-bg); color: var(--text-muted); font-size: .72rem; box-shadow: none; }
.community-numbers, .community-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.community-actions { margin-left: auto; gap: 8px; }
.community-stats strong { color: var(--text-color); font-size: 1rem; }
.community-stats form { margin-left: auto; }
.community-actions form { margin-left: 0; }
.unread-action {
    white-space: nowrap;
    border: 1px solid color-mix(in srgb, var(--accent) 78%, var(--panel-border));
    background: color-mix(in srgb, var(--accent) 8%, var(--panel-bg));
    color: var(--accent-strong) !important;
}
.unread-action:hover,
.unread-action:focus-visible {
    background: color-mix(in srgb, var(--accent) 16%, var(--panel-bg));
    color: var(--accent-strong) !important;
}
.mark-read-form { padding: 4px; border: 1px solid var(--panel-border); background: var(--panel-bg); box-shadow: var(--shadow-sm); }
.mark-read-button { min-height: 34px; padding: 6px 12px; border: 1px solid var(--input-border); border-radius: 2px; background: var(--input-bg); color: var(--text-color); font: inherit; font-size: .78rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.mark-read-button:hover, .mark-read-button:focus-visible { border-color: var(--primary-color); background: var(--secondary-color); color: var(--text-color); }
.compact-action { color: var(--text-muted); font-size: .78rem; text-decoration: none; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding: 0 0 12px; border-bottom: 3px solid var(--text-color); }
.section-heading h2 { margin: 0; }
.section-heading > p { max-width: 560px; color: var(--text-muted); }
.forum-directory { order: 2; }

.forum-list { background: var(--panel-bg); border-bottom: 1px solid var(--panel-border); }


.forum-last-post small, .forum-last-post span { color: var(--text-muted); }

.nested-category { padding: 16px 12px 8px calc(12px + var(--forum-depth, 0) * 24px); background: var(--secondary-color); border-bottom: 1px solid var(--panel-border); }
.nested-category h3 { margin: 0; font-size: .84rem; letter-spacing: .08em; text-transform: uppercase; }
.nested-category p { margin-top: 3px; color: var(--text-muted); font-size: .82rem; }

.glass-panel { background: var(--panel-bg); backdrop-filter: none; border-radius: 3px; box-shadow: 0 8px 24px rgba(24, 42, 54, .06); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-right: 7px; color: var(--text-muted); }
.topic-list { padding: 0; overflow: hidden; }
.topic-list-header { padding: 10px 18px; background: var(--secondary-color); border-bottom: 1px solid var(--panel-border); color: var(--text-muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.topic-row { padding: 16px 18px; }
.topic-row.pinned { background: color-mix(in srgb, var(--primary-color) 7%, var(--panel-bg)); }
.topic-anniversary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin: 16px 0; padding: 12px 15px; border-left: 4px solid var(--accent); background: var(--secondary-color); }
.topic-anniversary span { color: var(--text-muted); font-size: .82rem; }
.topic-participants { margin: 16px 0; }
.topic-participants > summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 700; }
.topic-participants > summary small { color: var(--text-muted); font-weight: 400; }
.participant-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.participant-list a { display: inline-flex; gap: 6px; padding: 5px 8px; border: 1px solid var(--panel-border); background: var(--panel-bg); font-size: .76rem; text-decoration: none; }
.participant-list span { color: var(--text-muted); }
.resurrection-notice { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 6px; color: var(--text-muted); font-size: .78rem; }
.resurrection-notice::before { content: ""; flex: 1; height: 1px; background: var(--panel-border); }
.resurrection-notice::after { content: ""; flex: 1; height: 1px; background: var(--panel-border); }
.resurrection-notice strong { color: var(--accent); }
.status-chip { display: inline-block; margin: 0 7px 4px 0; padding: 2px 6px; border: 1px solid var(--accent); color: var(--accent); font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; }
.status-muted { border-color: var(--text-muted); color: var(--text-muted); }
.first-unread-link { font-weight: 700; }
.topic-page-shortcuts { display: inline-flex; gap: 3px; margin-left: 7px; }
.topic-page-shortcuts::before { content: "Pages"; margin-right: 2px; color: var(--text-muted); }
.topic-page-shortcuts a { min-width: 22px; padding: 0 4px; border: 1px solid var(--panel-border); text-align: center; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions form { margin: 0; }
.forum-quiet-action { display:inline-flex; align-items:center; justify-content:center; min-height:var(--control-min,36px); padding:6px 8px; border:0; border-radius:4px; background:transparent; color:var(--text-muted); font:inherit; font-size:.78rem; font-weight:600; text-decoration:none; cursor:pointer; }
.forum-quiet-action:hover,.forum-quiet-action:focus-visible { background:color-mix(in srgb,var(--primary-color) 8%,var(--panel-bg)); color:var(--primary-color); text-decoration:underline; }

.post { padding: 0; overflow: hidden; border-top: 3px solid var(--text-color); }
.post-sidebar { width: 178px; padding: 22px 18px; background: color-mix(in srgb, var(--secondary-color) 55%, var(--panel-bg)); }
.post-content { padding: 20px 24px 22px; }
.author-name { margin-top: 8px; }
.author-title { color: var(--accent); font-size: .72rem; font-weight: 700; }
.author-facts { display: grid; margin-top: 12px; color: var(--text-muted); font-size: .72rem; }
.post-meta { padding-bottom: 10px; border-bottom: 1px solid var(--panel-border); }
.post-permalink { color: var(--text-muted); font-weight: 500; }
.post-permalink span { margin-right: 5px; color: var(--primary-color); font-weight: 800; }
.post-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.copy-link.is-copied { border-color: var(--success-color); color: var(--success-color); }
.post-body { padding: 8px 0 18px; font-size: 1rem; line-height: 1.72; }
.post-body > * { max-width: 76ch; }
.post-body > .video-embed, .post-body > .spotify-embed, .post-body > img, .post-body > .post-image { max-width: 100%; }
.first-unread-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--accent); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.first-unread-divider::before, .first-unread-divider::after { content: ""; flex: 1; height: 1px; background: var(--accent); }
.edit-note { color: var(--text-muted); font-size: .73rem; font-style: italic; }
.post-signature { max-width: 520px; margin-top: 16px; padding-top: 12px; overflow-wrap: anywhere; border-top: 1px solid var(--panel-border); color: var(--text-muted); font-size: .78rem; }
.post-signature img { max-width: 100%; height: auto; }
.locked-notice { display: grid; gap: 4px; color: var(--text-muted); }
.locked-notice strong { color: var(--text-color); }

.btn { min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 3px; font-weight: 700; }
.btn-primary { background: var(--accent); color: var(--on-accent, #fff); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent, #fff); }
.btn-sm.btn-danger { background: var(--danger-color); color: #fff; }
.btn-sm.btn-success { background: #176b32; color: #fff; }
.btn-sm:hover { background: color-mix(in srgb, var(--secondary-color) 72%, var(--text-color)); color: var(--secondary-text); }
.btn-sm.btn-success:hover { background: #0f5125; color: #fff; }
.btn-sm.btn-danger:hover { background: #9d1f2d; color: #fff; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 42px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-color); outline-offset: 1px; border-color: var(--primary-color); }
.form-row { display: flex; align-items: end; gap: 14px; }
.flex-1 { flex: 1; }.flex-2 { flex: 2; }.button-group { flex: 0 0 auto; }
.empty-state { padding: 36px 20px; color: var(--text-muted); text-align: center; }
.text-muted { color: var(--text-muted); }.mt-2 { margin-top: .5rem; }

.forum-highlights { display: grid; gap: 10px; order: 3; margin: 6px 0 10px; }
.highlight-panel { min-width: 0; padding: 16px 18px; border: 1px solid var(--panel-border); background: var(--panel-bg); box-shadow: var(--shadow-sm); }
.highlight-panel .section-heading { margin-bottom: 14px; }
.recent-topics > summary, .on-this-day > summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; }
.recent-topics > summary > span:first-child, .on-this-day > summary > span:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 1.05rem; font-weight: 700; }
.recent-topics > summary small, .on-this-day > summary small { color: var(--text-muted); font-size: .75rem; font-weight: 400; }
.expand-hint { flex: 0 0 auto; padding: 4px 7px; border: 1px solid var(--panel-border); background: var(--secondary-color); color: var(--text-color); font-size: .72rem; font-weight: 700; }
.expand-hint span:last-child, details[open] > summary .expand-hint span:first-child { display: none; }
details[open] > summary .expand-hint span:last-child { display: inline; }
.recent-topics[open] > summary, .on-this-day[open] > summary { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--panel-border); }
.on-this-day { margin-top: 0; }
.recent-topic-list { margin: 0; padding: 0; list-style: none; }
.recent-topic-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--panel-border); }
.recent-topic-list li:last-child { border-bottom: 0; }
.recent-topic-list li > div { min-width: 0; }
.recent-topic-list li > div > a { display: block; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.recent-topic-list li span, .recent-topic-list small, .activity-count { color: var(--text-muted); font-size: .78rem; }
.recent-topic-list li span { display: block; margin-top: 2px; }
.recent-topic-list small { white-space: nowrap; }
.activity-more { border-top: 1px solid var(--panel-border); }
.activity-more summary, .on-this-day > summary { padding: 10px 4px; color: var(--primary-color); font-weight: 700; cursor: pointer; }
.activity-more[open] summary { margin-bottom: 2px; }
.on-this-day > summary { padding: 0; list-style-position: inside; }
.archive-browser { order: 4; margin: 0 0 30px; }
.archive-browser > summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.archive-browser > summary span { font-weight: 700; }
.archive-browser > summary small { color: var(--text-muted); }
.archive-picker { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 14px; }
.archive-picker .form-group { min-width: 150px; margin: 0; }
.archive-picker-results { margin: 0 0 24px; }
.archive-topic-list { overflow: hidden; }
.archive-topic-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 20px; padding: 15px 18px; border-bottom: 1px solid var(--panel-border); color: var(--text-color); text-decoration: none; }
.archive-topic-list a:last-child { border-bottom: 0; }
.archive-topic-list a:hover { background: var(--secondary-color); }
.archive-topic-list strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-topic-list span, .archive-topic-list time { color: var(--text-muted); font-size: .78rem; }
.archive-topic-list time { grid-column: 2; grid-row: 1 / span 2; align-self: center; white-space: nowrap; }
.footer-content { display: flex; align-items: center; justify-content: space-between; gap: 24px; text-align: left; }
.footer-theme { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--panel-border) 70%, transparent); background: color-mix(in srgb, var(--panel-bg) 14%, transparent); }
.footer-theme label { color: var(--text-muted); font-size: .68rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.footer-theme select { min-width: 180px; min-height: 34px; width: auto; font-size: .75rem; }
.theme-picker-copy { display: grid; gap: 1px; }
.theme-picker-copy span { color: var(--text-muted); font-size: .65rem; }
/* Footer controls use the navigation surface in every appearance. */
.site-footer .footer-theme { border-color: rgba(255,255,255,.48); background: color-mix(in srgb, var(--nav-bg) 82%, #fff); }
.site-footer .footer-theme label { color: #fff; }
.site-footer .footer-theme .theme-picker-copy span { color: rgba(255,255,255,.82); }

.theme-swatch { width: 16px; height: 16px; border: 2px solid var(--panel-border); background: var(--accent); }
.otd-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 12px; background: var(--panel-border); }
.otd-item { display: grid; gap: 3px; padding: 18px; background: var(--panel-bg); }
.otd-year { color: var(--accent); font: 700 1.3rem/1 var(--heading-font, Georgia, serif); }
.otd-item a { font-weight: 700; }
.otd-author { color: var(--text-muted); font-size: .78rem; }
.history-more-link { display: inline-block; margin-top: 12px; font-weight: 700; }
.history-list { display: grid; gap: 10px; margin: 24px 0; padding: 0; list-style: none; }
.history-item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 18px; padding: 18px; }
.history-item > time { color: var(--accent); font: 700 1.35rem/1 var(--heading-font, Georgia, serif); }
.history-item h2 { margin: 0 0 5px; font-size: 1.05rem; }
.history-item p { margin-top: 8px; }
.history-meta { color: var(--text-muted); font-size: .78rem; }
.pagination { flex-wrap: wrap; }
.page-link { min-width: 36px; text-align: center; }
.search-form-advanced { width: 100%; }
.search-filter-grid { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) 120px 120px auto; align-items: end; gap: 12px; }
.search-filter-grid-expanded { grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) repeat(5, minmax(105px, .7fr)) auto; }
.search-filter-grid .form-group { margin: 0; }
.active-filters { margin-top: 12px; color: var(--text-muted); font-size: .8rem; }
.result-snippet mark { padding: 0 2px; background: #ffe58a; color: #1d1d1d; }
.search-result-item { padding: 18px 20px; border-left: 3px solid var(--accent); }
.result-header h3 { margin-bottom: 4px; }
.result-meta, .activity-date { color: var(--text-muted); font-size: .78rem; }
.result-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; }
.search-group { margin: 0 0 34px; }
.search-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.search-entity-card { display: flex; flex-direction: column; gap: 5px; padding: 16px; color: var(--text-color); text-decoration: none; }
.search-entity-card:hover { border-color: var(--primary-color); }
.search-entity-card span, .search-topic-list span, .search-group .section-heading > span { color: var(--text-muted); font-size: .78rem; }
.search-topic-list { padding: 0; }
.search-topic-list > a { display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; border-bottom: 1px solid var(--panel-border); text-decoration: none; }
.search-topic-list > a:last-child { border-bottom: 0; }
.result-snippet { margin-top: 10px; line-height: 1.55; }
.field-error { display: block; min-height: 1.2em; margin: 5px 0; color: var(--danger-color); font-size: .82rem; font-weight: 600; }
[aria-invalid="true"] { border-color: var(--danger-color) !important; }
.topic-end-actions { display: flex; justify-content: flex-end; gap: 14px; margin: 4px 0 18px; font-size: .82rem; }
.mobile-reply-action { display: none; }
.mobile-reply-action[hidden] { display: none !important; }
.activity-list { list-style: none; }
.inbox-section { margin-top: 30px; scroll-margin-top: 24px; }
.inbox-list { margin: 0; padding: 0 18px; list-style: none; }
.inbox-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--panel-border); }
.inbox-list li:last-child { border-bottom: 0; }
.inbox-list div { display: grid; }
.inbox-list a { font-weight: 700; }
.inbox-list span, .inbox-list time { color: var(--text-muted); font-size: .78rem; }
.activity-list li { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--panel-border); }
.profile-info { min-width: 0; }
.profile-info h2 { margin-bottom: 6px; font-size: 2rem; }
.profile-joined { margin-top: 10px; color: var(--text-muted); font-size: .82rem; }
.profile-bio { max-width: 680px; margin-top: 16px; }
.profile-signature { margin-top: 18px; overflow-wrap: anywhere; }
.profile-signature img { max-width: 100%; height: auto; }
.auth-box { border-top: 4px solid var(--accent); padding: 30px; }
.auth-box h1 { font-size: 2rem; }
.site-footer { background: var(--nav-bg); color: rgba(255,255,255,.68); }

@media (max-width: 820px) {
    .forum-highlights { grid-template-columns: 1fr; }
    .container { width: min(100% - 28px, 1180px); }
    .nav-content { align-items: stretch; }
    .brand { align-self: flex-start; }
    .nav-menu-button { display: inline-block; position: absolute; top: 8px; right: 14px; }
    .nav-links { justify-content: flex-start; }
    .nav-links[hidden] { display: none; }
    .nav-search { order: 2; flex-basis: 100%; margin: 4px 0 0; }
    .nav-search input { width: 100%; }
    .page-intro { grid-template-columns: 1fr; gap: 14px; }
    h1, .page-heading h1 { font-size: 1.8rem; }
    .community-stats { align-items: stretch; gap: 12px; overflow: visible; }
    .community-numbers { flex: 1 1 100%; justify-content: space-between; }
    .community-actions { flex: 1 1 100%; margin-left: 0; }
    .otd-list { grid-template-columns: 1fr; }
    .form-row { align-items: stretch; flex-direction: column; }
    .form-row > * { width: 100%; }
    .search-filter-grid, .search-filter-grid-expanded { grid-template-columns: 1fr 1fr; }
    .search-keywords { grid-column: 1 / -1; }
    .search-filter-grid .button-group { align-self: end; }
    .header-action { flex-direction: column; }
    .header-actions { width: 100%; flex-wrap: wrap; }
}

@media (max-width: 560px) {
    .history-item { grid-template-columns: 1fr; gap: 8px; }
    .archive-picker > * { width: 100%; }
    .archive-topic-list a { grid-template-columns: 1fr; }
    .archive-topic-list time { grid-column: 1; grid-row: auto; white-space: normal; }
    .recent-topic-list li { grid-template-columns: 1fr; gap: 3px; }
    .recent-topic-list small, .recent-topic-list li span, .forum-last-post small { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
    .footer-content { align-items: stretch; flex-direction: column; text-align: center; }
    .footer-theme { justify-content: center; }
    .container { width: min(100% - 20px, 1180px); }
    .main-content { padding-top: 26px; }
    .brand-copy small { display: none; }
    .nav-links { gap: 2px; }
    .nav-link, .btn-link { padding: 7px; font-size: .82rem; }
    .community-stats { justify-content: space-between; gap: 10px; }
    .community-numbers > span { display: grid; }
    .community-actions > * { flex: 1 1 100%; }
    .community-actions .btn, .community-actions button { width: 100%; text-align: center; }
    .post-sidebar { width: 100%; padding: 14px; }
    .post-content { padding: 16px; }
    .post-meta { align-items: flex-start; gap: 10px; }
    .post-meta { flex-direction: column; }
    .post-actions { width: 100%; }
    .profile-header { flex-direction: column; }
    .activity-list li { display: grid; gap: 3px; }
    .search-filter-grid, .search-filter-grid-expanded { grid-template-columns: 1fr; }
    .search-keywords { grid-column: auto; }
    .attachment-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
    .attachment-image { grid-template-rows: 105px auto; }
    .attachment-image img { height: 105px; }
    .mobile-reply-action { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 80; display: inline-flex; min-height: 42px; align-items: center; padding: 8px 15px; border: 1px solid color-mix(in srgb, var(--accent) 75%, #000); background: var(--accent); color: var(--on-accent, #fff); font-weight: 700; box-shadow: 0 5px 16px rgba(0,0,0,.24); text-decoration: none; }
    .inbox-list li { grid-template-columns: 1fr; gap: 3px; }
    .toolbar-group { flex: 1 1 auto; padding-right: 0; }
    .toolbar-group + .toolbar-group { padding-left: 0; border-left: 0; }
    .toolbar-group-label { display: none; }
    .composer-submit { width: 100%; position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
}

/* Presence, category hierarchy, and long-form composer recovery. */
.presence-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -10px 0 20px;
    padding: 7px 10px;
    border: 1px solid var(--ui-rule, var(--panel-border));
    background: color-mix(in srgb, var(--panel-bg) 78%, var(--secondary-color));
    color: var(--text-muted);
    font-size: .72rem;
}
.presence-label { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; color: var(--text-color); font-weight: 800; }
.presence-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 18%, transparent); }
.presence-members { display: flex; flex-wrap: wrap; gap: 5px 12px; min-width: 0; }
.presence-member { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--primary-color); font-weight: 700; text-decoration: none; }
.presence-member > span:last-child { overflow: hidden; max-width: 18ch; text-overflow: ellipsis; white-space: nowrap; }
.presence-member img, .presence-avatar { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; object-fit: cover; background: var(--secondary-color); color: var(--primary-color); font-size: .66rem; font-weight: 800; }
.forum-section { border-inline: 1px solid var(--ui-rule, var(--panel-border)); }

.forum-section > .forum-list { border-top: 0; }
.latest-topic-action { color: var(--primary-color); font-weight: 800; }
.field-error[tabindex="-1"]:focus { outline: 2px solid var(--danger-color); outline-offset: 3px; }

@media (max-width: 820px) {
    .presence-strip { align-items: flex-start; flex-direction: column; margin-top: -6px; }
    .presence-members { width: 100%; }
    .forum-section { border-inline: 0; }
}

.page-link.active { color: var(--on-primary, #fff); }

@media (max-width: 820px) {
    .topic-stats::before,
    .topic-last::before {
        content: attr(data-label) ": ";
        color: var(--text-muted);
        font-size: .7rem;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* 2026 reading-first refinement
 * Keep the archive character in the colour and content while reducing visual
 * weight, density of chrome, and the amount of information competing with a post.
 */
:root {
    --ui-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ui-radius: 6px;
    --ui-rule: color-mix(in srgb, var(--panel-border) 72%, transparent);
}

body {
    font-family: var(--ui-font);
    font-size: 13px;
    line-height: 1.6;
    background-image: none;
}

h1, h2, h3, h4, h5, h6, .brand,
.brand-copy strong,
.forum-details h3,
.topic-title > a,
.author-name,
.section-heading h2 {
    font-family: var(--ui-font);
}

h1 { font-size: clamp(1.55rem, 2.4vw, 1.85rem); letter-spacing: -.02em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

.container { width: min(1160px, calc(100% - 32px)); }
.main-content { padding-top: 22px; padding-bottom: 44px; }
.navbar { padding: 6px 0; box-shadow: 0 1px 8px rgba(7, 25, 37, .13); }
.brand { gap: 9px; }
.brand-mark { width: 29px; height: 29px; font-size: 16px; }
.brand-copy strong { font-size: 1rem; }
.nav-links { gap: 4px; }
.nav-link, .btn-link { padding: 7px 8px; font-size: .82rem; }
.nav-search { margin-right: 5px; }
.nav-search input { width: 210px; min-height: 34px; }
.nav-search button { min-height: 28px; font-size: .78rem; }

.page-heading { padding: 6px 0 12px; }
.page-heading h1 { font-size: clamp(1.55rem, 2.4vw, 1.85rem); }
.page-intro { gap: 30px; padding: 10px 0 22px; }
.page-intro > p { font-size: .92rem; }
.breadcrumbs { margin-bottom: 16px; font-size: .7rem; }
.section-heading { padding-bottom: 9px; border-bottom-width: 2px; }
.forum-section { margin-bottom: 22px; }

.forum-list, .topic-list, .inbox-list, .search-topic-list { box-shadow: none; }

.nested-category { padding: 11px 10px 6px calc(10px + var(--forum-depth, 0) * 20px); }

.glass-panel, .highlight-panel { border-radius: var(--ui-radius); box-shadow: 0 3px 12px rgba(24, 42, 54, .045); }
.highlight-panel { padding: 12px 14px; }
.topic-anniversary { margin: 12px 0; padding: 9px 12px; }
.topic-participants { margin: 12px 0; }

.topic-view > .page-heading { align-items: center; }
.topic-kicker { margin-bottom: 3px; font-size: .72rem; }
.status-chip { padding: 2px 5px; font-size: .58rem; }
.post {
    margin-bottom: 14px;
    border-top-width: 2px;
    border-radius: var(--ui-radius);
}
.post-sidebar { width: 154px; padding: 16px 14px; }
.post-content { padding: 15px 19px 17px; }
.author-avatar img { max-width: 76px; }
.default-avatar { width: 62px; height: 62px; font-size: 28px; }
.author-name { margin-top: 6px; font-size: .9rem; }
.author-title, .author-facts { font-size: .67rem; }
.post-meta { margin-bottom: 9px; padding-bottom: 8px; font-size: .72rem; }
.post-actions { gap: 3px; }
.post-body { padding: 5px 0 13px; font-size: 13px; line-height: 1.7; }
.post-body > * { max-width: 72ch; }
.post-signature { margin-top: 11px; padding-top: 9px; font-size: .7rem; }
.post-attachments { margin-top: 13px; padding-top: 11px; }
.post-attachments h3 { font-size: .85rem; }

.btn { min-height: 35px; padding: 7px 12px; border-radius: 5px; font-size: .8rem; }
.btn-sm { padding: 4px 7px; font-size: .7rem; }
.btn-danger { background: #b72e3c; }
.btn-secondary, .mark-read-button { border: 1px solid var(--panel-border); }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 38px; padding: 8px; font-size: 13px; }
textarea { line-height: 1.55; }
.form-group { margin-bottom: 12px; }
.help-text, .active-filters { font-size: .72rem; }
.alert { padding: 10px 12px; margin-bottom: 14px; font-size: .8rem; }

.topic-end-actions { margin: 2px 0 13px; font-size: .75rem; }
.pagination { margin: 14px 0; }
.page-link { min-width: 30px; padding: 4px 8px; font-size: .75rem; }
.pagination { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ui-rule, var(--panel-border)); background: color-mix(in srgb, var(--secondary-color) 35%, var(--panel-bg)); border-radius: var(--ui-radius, 6px); }
.pagination-context { display: inline-flex; align-items: baseline; gap: 5px; color: var(--text-muted); font-size: .76rem; white-space: nowrap; }
.pagination-context strong { color: var(--text-color); font-size: .9rem; }
.pagination-links { display: inline-flex; justify-content: center; align-items: center; gap: 4px; min-width: 0; }
.pagination .page-link { display: inline-flex; justify-content: center; align-items: center; gap: 5px; min-width: 32px; min-height: 32px; padding: 4px 9px; border: 1px solid var(--panel-border); border-radius: 5px; background: var(--panel-bg); color: var(--text-color); font-size: .76rem; font-weight: 700; text-decoration: none; }
.pagination .page-link:hover { border-color: var(--primary-color); background: color-mix(in srgb, var(--primary-color) 8%, var(--panel-bg)); color: var(--primary-color); }
.pagination .page-link.active { background: var(--primary-color); border-color: var(--primary-color); color: var(--on-primary, #fff); }
.pagination .page-link-disabled { opacity: .42; cursor: not-allowed; }
.pagination .page-ellipsis { padding: 0 3px; color: var(--text-muted); }
.pagination .page-jump { display: inline-flex; align-items: end; gap: 5px; margin-left: 0; }
.pagination .page-jump label { display: grid; gap: 2px; color: var(--text-muted); font-size: .63rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pagination .page-jump input { width: 58px; min-height: 32px !important; padding: 4px 6px; }
.pagination .page-jump .btn-sm { min-height: 32px; }
.topic-page-shortcuts { display: inline-flex; align-items: center; gap: 3px; margin-left: 9px; vertical-align: middle; }
.topic-page-shortcuts::before { content: none; }
.topic-pages-label { margin-right: 2px; color: var(--text-muted); font-size: .7rem; }
.topic-page-shortcuts a { display: inline-grid; place-items: center; min-width: 26px; min-height: 27px; padding: 2px 5px; border: 0; border-radius: 3px; background: transparent; color: var(--text-muted); font-size: .76rem; font-weight: 650; text-decoration: none; }
.topic-page-shortcuts a:hover,.topic-page-shortcuts a:focus-visible { background: color-mix(in srgb, var(--primary-color) 9%, var(--panel-bg)); color: var(--primary-color); text-decoration: underline; }
.topic-page-ellipsis { padding: 0 1px; color: var(--text-muted); }

@media (max-width: 700px) {
    .pagination { grid-template-columns: 1fr; justify-items: center; gap: 9px; }
    .pagination-context { grid-row: 1; }
    .pagination-links { grid-row: 2; max-width: 100%; flex-wrap: wrap; }
    .pagination .page-jump { grid-row: 3; justify-self: center; margin: 0; }
}

@media (max-width: 420px) {
    .pagination .page-link { min-width: 30px; padding-inline: 7px; }
    .pagination .page-previous span:last-child,
    .pagination .page-next span:first-child { display: none; }
}
.reply-box { padding: 15px; }
.reply-box h2 { margin-bottom: 10px; }

.profile-header { gap: 20px; padding: 18px; }
.profile-info h2 { font-size: 1.55rem; }
.profile-joined, .profile-bio { font-size: .78rem; }
.profile-activity { padding: 16px; }
.search-result-item, .search-entity-card { padding: 13px 15px; }
.result-meta, .search-entity-card span, .search-topic-list span, .inbox-list span, .inbox-list time, .activity-date { font-size: .7rem; }
.result-snippet { margin-top: 8px; line-height: 1.5; }
.inbox-section { margin-top: 22px; }
.inbox-list { padding: 0 14px; }
.inbox-list li { padding: 11px 0; }
.site-footer { padding: 15px 0; font-size: .75rem; }
.footer-subtext { font-size: .68rem; }

@media (max-width: 820px) {
    .container { width: min(100% - 24px, 1160px); }
    h1, .page-heading h1 { font-size: 1.55rem; }
    .post-sidebar { width: 100%; padding: 10px 12px; }
    .post-content { padding: 13px 15px 15px; }
    .author-avatar img, .default-avatar { width: 42px; height: 42px; font-size: 19px; }
    .post-body { font-size: 13px; }
}

@media (max-width: 560px) {
    .container { width: min(100% - 16px, 1160px); }
    .main-content { padding-top: 20px; }
    .post-content { padding: 12px; }
    .mobile-reply-action { min-height: 38px; padding: 7px 12px; font-size: .78rem; }
}

/* Second visual pass: calmer surfaces, clearer hierarchy, less boxed chrome. */
.section-heading h2 { font-size: 1.15rem; letter-spacing: -.01em; }
.section-heading > p { font-size: .78rem; }
.forum-list { border: 1px solid var(--ui-rule); border-top: 0; }

.forum-row:last-child { border-bottom: 0; }
.forum-row:hover { background: color-mix(in srgb, var(--primary-color) 7%, var(--panel-bg)); }
.forum-details h3 a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

.forum-last-post small { font-size: .68rem; }
.latest-post-link { white-space: nowrap !important; }

.topic-view > .page-heading { border-bottom: 1px solid var(--ui-rule); }
.topic-state { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.topic-participants { border: 1px solid var(--ui-rule); background: color-mix(in srgb, var(--panel-bg) 86%, var(--secondary-color)); box-shadow: none; }
.topic-participants > summary { padding: 1px 0; }
.post { border: 1px solid var(--ui-rule); border-top: 2px solid color-mix(in srgb, var(--text-color) 70%, var(--accent)); box-shadow: none; }
.post-sidebar { width: 136px; padding: 14px 12px; background: color-mix(in srgb, var(--secondary-color) 35%, var(--panel-bg)); }
.post-content { padding: 13px 17px 15px; }
.post-actions .btn-sm { border-color: transparent; background: transparent; }
.post-actions .btn-sm:hover { border-color: var(--panel-border); background: var(--secondary-color); }
.post-actions .btn-danger { background: var(--danger-color); color: #fff; }
.post-body p { max-width: 72ch; }
.post-body blockquote, .post-body .cwal-quote { max-width: 72ch; }
.reply-box { border: 1px solid var(--ui-rule); box-shadow: none; }
.topic-end-actions a { text-decoration: none; }
.topic-end-actions a:hover { text-decoration: underline; }

.highlight-panel, .search-result-item, .search-entity-card, .profile-header, .profile-activity, .inbox-list, .archive-topic-list { border-color: var(--ui-rule); box-shadow: none; }
.search-result-item { border-left: 2px solid var(--accent); }
.archive-topic-list a:hover, .search-entity-card:hover { background: color-mix(in srgb, var(--primary-color) 6%, var(--panel-bg)); }
.footer-content { align-items: flex-start; }
.theme-swatch { flex: 0 0 14px; width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }

@media (max-width: 820px) {
    .post-sidebar { width: 100%; }
    .topic-state { justify-content: flex-start; }
}

@media (max-width: 560px) {
    .footer-theme { align-items: flex-start; flex-wrap: wrap; }
    .footer-theme select { width: 100%; }
}

/* Completion pass for the remaining interaction and identity details. */
.nav-links { align-items: center; }
.nav-primary, .nav-account { display: flex; align-items: center; gap: 4px; }
.nav-account { padding-left: 7px; border-left: 1px solid rgba(255,255,255,.22); }
.nav-inbox { position: relative; }
.nav-count { margin-left: 3px; vertical-align: 1px; }

.forum-icon i { display: block; color: inherit; font-size: 14px; line-height: 1; }
.post-actions .btn-sm:not(.btn-danger) { color: var(--primary-color); }
.formatter-panel { margin-bottom: 0; border: 1px solid var(--input-border); background: var(--secondary-color); }
.formatter-panel > summary { display: flex; justify-content: flex-start; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; color: var(--text-color); font-size: .75rem; font-weight: 750; list-style: none; }
.formatter-panel > summary::-webkit-details-marker { display: none; }
.formatter-panel > summary::after { content: "⌄"; margin-left: 8px; color: var(--primary-color); font-size: 1rem; line-height: 1; }
.formatter-panel[open] > summary::after { content: "⌃"; }
.formatter-panel > summary > span:first-child { color: var(--text-color); }
.formatter-panel > summary .formatter-hint { margin-left: auto; color: var(--primary-color); font-size: .68rem; font-weight: 700; }
.formatter-panel[open] > summary { border-bottom: 1px solid var(--panel-border); }
.formatter-panel .composer-tools { margin: 0; border: 0; }
.formatter-panel + textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.formatter-panel:focus-within { border-color: var(--primary-color); }
.bbcode-composer { min-height: 150px; max-height: min(65vh, 640px); overflow-y: hidden; resize: vertical; transition: border-color .15s ease, box-shadow .15s ease; }
.bbcode-composer:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 18%, transparent); }
.composer-count.is-near-limit { color: var(--accent); font-weight: 700; }
.composer-count.is-at-limit { color: var(--danger-color); font-weight: 800; }
.draft-status { display: block; min-height: 1.2em; color: var(--text-muted); font-size: .68rem; text-align: right; }
.draft-clear { margin-left: 7px; padding: 0; border: 0; background: transparent; color: var(--primary-color); cursor: pointer; font: inherit; font-size: .68rem; }
.composer-progress { display: none; height: 5px; margin: 8px 0 0; overflow: hidden; border-radius: 999px; background: var(--secondary-color); }
.composer-progress:not([hidden]) { display: block; }
.composer-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .15s ease; }
.composer-mode { margin-top: 10px; border: 1px solid var(--panel-border); border-radius: 6px; overflow: hidden; background: var(--panel-bg); }
.composer-mode-tabs { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--panel-border); background: color-mix(in srgb, var(--secondary-color) 72%, var(--panel-bg)); }
.composer-mode-tab { min-width: 82px; padding: 7px 14px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; font: inherit; font-size: .76rem; font-weight: 800; }
.composer-mode-tab:hover, .composer-mode-tab:focus-visible { color: var(--primary-color); }
.composer-mode-tab:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 1px; }
.composer-mode-tab.is-active { border-color: var(--panel-border); background: var(--panel-bg); color: var(--primary-color); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.composer-mode-pane[hidden] { display: none !important; }
.composer-mode-pane[data-composer-mode-pane="write"] { padding: 0; }
.composer-mode-pane[data-composer-mode-pane="write"] .formatter-panel { border: 0; border-radius: 0; }
.composer-mode-pane[data-composer-mode-pane="write"] .bbcode-composer { display: block; width: 100%; border: 0; border-radius: 0; box-shadow: none; }
.composer-mode-pane[data-composer-mode-pane="write"] .bbcode-composer:focus { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary-color) 28%, transparent); }
.composer-preview-pane { min-height: 184px; }
.composer-preview-pane .composer-preview-heading { min-height: 40px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--panel-border); background: color-mix(in srgb, var(--secondary-color) 72%, var(--panel-bg)); }
.composer-preview[aria-busy="true"] .composer-preview-body, .composer-preview-pane[aria-busy="true"] .composer-preview-body, .composer-preview-body[aria-busy="true"] { opacity: .62; }
.composer-preview-body { min-height: 132px; padding: 15px; }
.composer-preview-body:empty::before { content: "Your formatted comment preview will appear here."; color: var(--text-muted); }
.file-selection { display: grid; gap: 7px; }
.file-dropzone { min-height: 48px; border-style: dashed; }
.file-dropzone:empty { display: none; }
.file-dropzone.file-selection { transition: border-color .15s ease, background .15s ease; }
.file-selection > strong { color: var(--text-color); }
.file-selection-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 0; border-top: 1px solid var(--panel-border); }
.file-selection-item img { width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--panel-border); object-fit: cover; }
.file-selection-item span { overflow: hidden; margin-right: 0; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.file-selection-item .btn-sm { flex: 0 0 auto; margin-left: auto; }
.file-selection-error { color: var(--danger-color); font-size: .75rem; font-weight: 700; }
.form-group.is-dragging { outline: 3px solid color-mix(in srgb, var(--primary-color) 35%, transparent); outline-offset: 3px; background: color-mix(in srgb, var(--primary-color) 5%, transparent); }
.profile-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.profile-stats span { display: grid; gap: 1px; min-width: 58px; }
.profile-stats strong { font-size: .95rem; }
.profile-stats small { color: var(--text-muted); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; }
.attachment-image, .attachment-file { position: relative; border-radius: 6px; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.attachment-image:hover, .attachment-file:hover { transform: translateY(-1px); border-color: var(--primary-color); box-shadow: 0 3px 10px rgba(0,0,0,.09); text-decoration: none; }
.attachment-image span, .attachment-file { min-width: 0; }
.attachment-image strong, .attachment-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 520px) {
    .composer-mode-tabs { padding: 3px; }
    .composer-mode-tab { flex: 1 1 0; min-width: 0; padding-inline: 8px; }
    .composer-preview-pane { min-height: 150px; }
    .composer-preview-body { min-height: 108px; padding: 12px; }
}
.attachment-type { display: inline-grid; place-items: center; width: max-content; min-width: 28px; margin-bottom: 5px; padding: 3px 5px; border-radius: 3px; background: var(--secondary-color); color: var(--text-muted); font-size: .6rem; font-weight: 800; letter-spacing: .05em; }
.attachment-file { align-content: start; }
.history-item { border: 1px solid var(--ui-rule); box-shadow: none; }
.history-item:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--panel-bg)); }

@media (max-width: 820px) {
    .nav-primary, .nav-account { width: 100%; }
    .nav-account { padding: 5px 0 0; border-top: 1px solid rgba(255,255,255,.18); border-left: 0; }
    .nav-account .nav-link, .nav-account .nav-logout { flex: 1; }
}

@media (max-width: 560px) {
    .nav-primary, .nav-account { gap: 2px; }
    .profile-stats { gap: 10px; }
    .attachment-type { margin-bottom: 3px; }
}

@media (prefers-reduced-motion: reduce) {
    .attachment-image, .attachment-file { transition: none; }
}

/* Forum directory: shared desktop rules, followed by responsive layouts. */
.forum-row {
    display: grid;
    align-items: center;
    border-bottom: 1px solid var(--ui-rule);
    grid-template-columns: 40px minmax(280px, 1fr) 116px minmax(260px, 320px);
    gap: 16px;
    min-height: 84px;
    padding: 14px 14px 14px calc(14px + var(--forum-depth, 0) * 24px);
}
.forum-icon { font-size: 2rem; padding: 0; opacity: 1; }
.forum-icon span { display: grid; place-items: center; overflow: hidden; border: 1px solid var(--forum-accent, var(--primary-color)); color: var(--forum-accent, var(--primary-color)); font: 700 13px/1 var(--heading-font, Georgia, serif); width: 30px; height: 30px; border-radius: 8px; background: color-mix(in srgb, var(--forum-accent, var(--primary-color)) 8%, var(--panel-bg)); font-family: var(--ui-font); font-size: 17px; font-weight: 700; }
.forum-details { flex: 1; }
.forum-details h3 { margin: 0 0 6px; font-size: .98rem; line-height: 1.25; }
.forum-description { color: var(--text-muted); max-width: 680px; font-size: .8rem; line-height: 1.5; }
.forum-stats { font-size: 0.9rem; display: grid; color: var(--text-muted); text-align: center; border-left: 1px solid var(--ui-rule); border-right: 1px solid var(--ui-rule); padding: 0 7px; grid-template-columns: 1fr 1fr; gap: 8px; }
.forum-stats span { display: grid; align-content: center; min-width: 34px; }
.forum-stats strong { color: var(--text-color); font-size: .78rem; font-weight: 700; line-height: 1.2; }
.forum-stats small { letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-top: 3px; font-size: .58rem; line-height: 1.2; }
.forum-last-post { display: grid; align-content: center; min-width: 0; gap: 2px; font-size: .83rem; line-height: 1.35; }
.forum-last-post a { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.forum-last-post .latest-post-link { margin-top: 2px; font-weight: 600; font-size: .68rem; }

.community-stats .unread-action {
    border: 1px solid color-mix(in srgb, var(--accent) 78%, var(--panel-border));
    background: color-mix(in srgb, var(--accent) 8%, var(--panel-bg));
    color: var(--accent-strong) !important;
}
.community-stats .unread-action:hover,
.community-stats .unread-action:focus-visible {
    background: color-mix(in srgb, var(--accent) 16%, var(--panel-bg));
    color: var(--accent-strong) !important;
}
.community-stats-top { display: flex; align-items: center; gap: 22px; }
.on-this-day-strip {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid var(--ui-rule, var(--panel-border));
    color: var(--text-muted);
    font-size: .74rem;
    line-height: 1.35;
}
.on-this-day-strip-label {
    flex: 0 0 auto;
    color: var(--text-color);
    font-weight: 800;
}
.on-this-day-strip-label a { color: var(--primary-color); font-size: .68rem; font-weight: 700; white-space: nowrap; }
.on-this-day-strip-items {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 16px;
    min-width: 0;
}
.on-this-day-strip-item { display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; }
.on-this-day-strip-item:not(:last-child)::after { content: "|"; margin-left: 12px; color: var(--panel-border); }
.on-this-day-strip-item strong { color: var(--accent-strong); font-size: .76rem; }
.on-this-day-strip-item a { overflow: hidden; max-width: 28ch; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }

@media (max-width: 1060px) and (min-width: 821px) {
    .forum-row {
        grid-template-columns: 38px minmax(220px, 1fr) 108px minmax(220px, 280px);
        gap: 12px;
        padding-inline: 10px;
    }
    .forum-last-post { font-size: .79rem; }
}

@media (max-width: 820px) {
    .community-stats-top { align-items: stretch; flex-wrap: wrap; gap: 12px; }
    .on-this-day-strip { align-items: flex-start; flex-direction: column; gap: 4px; }
    .forum-row {
        grid-template-columns: 38px minmax(0, 1fr);
        min-height: auto;
        padding: 12px 10px 12px calc(10px + var(--forum-depth, 0) * 14px);
    }
    .forum-stats, .forum-last-post { grid-column: 2; }
    .forum-stats { display: flex; gap: 14px; text-align: left; border: 0; padding: 0; }
    .forum-stats span { display: inline; }
    .forum-stats small { margin: 0 0 0 3px; }
    .forum-last-post { padding-top: 9px; border-top: 1px solid var(--ui-rule); }
}

@media (max-width: 560px) {
    .forum-row { padding-left: calc(8px + var(--forum-depth, 0) * 12px); }
    .community-stats { padding: 10px; }
    .community-actions { gap: 6px; }
    .on-this-day-strip-items { display: grid; gap: 4px; }
    .on-this-day-strip-item a { max-width: 34ch; }
}

/* Compact anniversary rows retain inline years, punctuation and titles. */
@media (max-width: 560px) {
    .community-stats .on-this-day-strip { align-items: stretch; gap: 5px; }
    .community-stats .on-this-day-strip-label { display: inline-flex; align-items: baseline; gap: 4px; }
    .community-stats .on-this-day-strip-item { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 0; border-bottom: 1px solid var(--ui-rule, var(--panel-border)); }
    .community-stats .on-this-day-strip-item:last-child { border-bottom: 0; }
    .community-stats .on-this-day-strip-item > span { display: inline; }
    .community-stats .on-this-day-strip-item:not(:last-child)::after { content: none; }
}

/* Keep category headers distinct from the individual forum rows at every
   desktop breakpoint, including the compact rules defined earlier. */
.forum-section > .section-heading {
    min-height: 56px;
    padding: 12px 16px 11px 18px;
    border: 1px solid var(--accent);
    border-left: 6px solid var(--accent);
    background: color-mix(in srgb, var(--secondary-color) 72%, var(--panel-bg));
}
.forum-section > .section-heading h2 { font-size: 1.18rem; letter-spacing: .01em; }
.forum-section > .section-heading > p { font-size: .8rem; line-height: 1.35; }

@media (max-width: 820px) {
    .forum-section > .section-heading { min-height: 0; padding: 10px 12px 9px 14px; }
}

/* 2026 experience system: stable geometry across themes and independent density. */
:root {
    --title-weight-read: 600;
    --title-weight-unread: 800;
    --row-pad-block: 14px;
    --row-pad-inline: 16px;
    --post-pad: 20px;
    --control-min: 36px;
    --reading-measure: 72ch;
}
[data-density="compact"] { --row-pad-block: 9px; --row-pad-inline: 12px; --post-pad: 15px; }
.btn, .btn-sm, button, select { min-height: var(--control-min); }
.forum-index { gap: 14px; }
.community-stats { order: 1; margin-bottom: 0; }
.forum-directory { order: 2; }
.home-discovery { display: grid; gap: 0; order: 2; padding: 3px 10px; border: 1px solid var(--ui-rule); background: var(--panel-bg); font-size: .72rem; }
.home-discovery .presence-strip { margin: 0; padding: 5px 0; border: 0; background: transparent; }
.home-discovery .presence-label, .home-discovery .on-this-day-strip-label { color: var(--text-muted); font-weight: 700; }
.home-discovery .presence-member { color: var(--text-color); font-weight: 600; }
.home-discovery .on-this-day-strip { margin: 0; padding: 6px 0 4px; border-top: 1px solid var(--ui-rule); }
.home-discovery .on-this-day-strip:first-child { border-top: 0; }
.home-discovery .on-this-day-strip-item a { color: var(--text-color); font-weight: 600; }
.forum-highlights, .archive-browser, .home-secondary-panel { order: 4; margin: 0; }
.forum-directory { order: 3; }
@media (max-width: 560px) {
    .home-discovery .presence-member:nth-child(n+5) { display: none; }
}
.forum-section > .section-heading { min-height: 0; padding: 11px 15px; border: 0; border-bottom: 2px solid var(--accent); border-left: 0; box-shadow: none !important; }
.forum-list { border: 1px solid var(--ui-rule); border-top: 0; box-shadow: none !important; }
.forum-row { min-height: 0; padding: var(--row-pad-block) var(--row-pad-inline); box-shadow: none !important; border-left: 0 !important; }
.forum-row.has-unread { background: var(--panel-bg); box-shadow: none; }
.forum-row.has-unread .forum-icon span { box-shadow: none; }
.forum-row.has-unread::after, .topic-row.has-unread::after, .forum-row .unread-chip { content: none !important; display: none !important; }
.forum-details h3 > a, .topic-title > a { font-weight: var(--title-weight-read); }
.forum-row.has-unread .forum-details h3 > a, .topic-row.has-unread .topic-title > a { font-weight: var(--title-weight-unread); }
.forum-icon span { border-color: color-mix(in srgb, var(--primary-color) 45%, var(--panel-border)); background: color-mix(in srgb, var(--primary-color) 8%, var(--panel-bg)); color: color-mix(in srgb, var(--primary-color) 78%, var(--text-color)); box-shadow: none !important; }
.topic-row { display: grid; grid-template-columns: minmax(0,1fr) 100px minmax(170px,220px); gap: 16px; padding: var(--row-pad-block) var(--row-pad-inline); box-shadow: none !important; }
.topic-row.pinned { border-left: 0; }
.topic-title { min-width: 0; }
.post { box-shadow: none !important; }
.post-content { padding: var(--post-pad); }
.post-body { font-size: clamp(1rem, .98rem + .12vw, 1.0625rem); line-height: 1.7; }
.post-body > *, .post-body p, .post-body blockquote, .post-body .cwal-quote { max-width: var(--reading-measure); }
.post-sidebar, .post-signature, .edit-note, .post-meta { color: var(--text-muted); }
.post-signature { font-size: .82rem; line-height: 1.55; opacity: .88; }
.post-actions { align-items: flex-start; }
.post-more { position: relative; }
.post-more > summary { list-style: none; cursor: pointer; }
.post-more > summary::-webkit-details-marker { display: none; }
.post-more-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 30; display: grid; min-width: 150px; padding: 6px; border: 1px solid var(--panel-border); border-radius: 6px; background: var(--panel-bg); box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.post-more-menu .btn-sm, .post-more-menu form { width: 100%; text-align: left; }
.post-more-menu .inline-form { display: block !important; }
.formatter-panel { border: 0; background: transparent; }
.composer-tools { border: 0; border-bottom: 1px solid var(--panel-border); }
.composer-attachments { margin-top: -1px; padding: 12px; border: 1px solid var(--panel-border); border-radius: 0 0 6px 6px; background: color-mix(in srgb, var(--secondary-color) 45%, var(--panel-bg)); }
.composer-attachments label { font-size: .78rem; }
.toolbar-more { position: relative; align-self: center; }
.toolbar-more > summary { min-height: 32px; padding: 6px 9px; cursor: pointer; font-size: .72rem; font-weight: 700; }
.toolbar-more[open] .toolbar-group { position: absolute; right: 0; z-index: 5; display: flex; padding: 6px; border: 1px solid var(--panel-border); background: var(--panel-bg); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.appearance-dialog { width: min(760px, calc(100% - 24px)); max-height: min(86vh, calc(100dvh - 24px)); padding: 0; border: 1px solid var(--panel-border); border-radius: 10px; background: var(--panel-bg); color: var(--text-color); }
.appearance-dialog::backdrop { background: rgba(0,0,0,.55); }
.appearance-dialog form { padding: 18px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.dialog-heading h2, .dialog-heading p { margin: 0; }
.appearance-groups { display: grid; gap: 14px; margin-top: 16px; }
.appearance-groups fieldset, .density-options { padding: 0; border: 0; }
.appearance-groups legend, .density-options legend { margin-bottom: 7px; font-weight: 800; }
.theme-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 8px; }
.theme-option { display: grid; gap: 6px; min-height: 76px; padding: 8px; border: 1px solid var(--panel-border); border-radius: 6px; background: var(--panel-bg); color: var(--text-color); text-align: left; cursor: pointer; }
.theme-option.is-selected, .density-options .is-selected { outline: 3px solid var(--primary-color); outline-offset: 1px; }
.theme-preview { position: relative; display: block; height: 34px; overflow: hidden; border-radius: 4px; background: var(--preview-bg); }
.theme-preview i { position: absolute; inset: 5px 34% 5px 5px; background: var(--preview-surface); }
.theme-preview b { position: absolute; left: 10px; top: 10px; width: 34%; height: 4px; background: var(--preview-text); }
.theme-preview em { position: absolute; right: 6px; bottom: 6px; width: 25%; height: 10px; background: var(--preview-accent); }
.density-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

@media (max-width: 820px) {
    .forum-row { grid-template-columns: 36px minmax(0,1fr) auto; gap: 8px 12px; }
    .forum-details { grid-column: 2 / -1; }
    .forum-last-post { grid-column: 2; grid-row: 2; display: inline; padding: 0; border: 0; font-size: .75rem; }
    .forum-last-post::before { content: "Latest: "; color: var(--text-muted); }
    .forum-last-post a, .forum-last-post small, .forum-last-post .latest-post-link { display: inline; white-space: normal; }
    .forum-last-post .latest-post-link { margin-left: 6px; }
    .forum-stats { grid-column: 3; grid-row: 2; justify-content: flex-end; align-self: end; order: 4; white-space: nowrap; }
    .topic-row { grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; }
    .topic-title { grid-column: 1 / -1; }
    .topic-stats, .topic-last { width: auto; font-size: .72rem; text-align: left; }
    .topic-last { grid-column: 1; grid-row: 2; }
    .topic-stats { grid-column: 2; grid-row: 2; }
    .post-sidebar { display: grid; grid-template-columns: 42px minmax(0,1fr); width: 100%; padding: 10px 12px; text-align: left; }
    .author-avatar { grid-row: 1 / 4; }
    .author-facts { display: flex; gap: 8px; }
}
@media (max-width: 560px) {
    :root { --control-min: 40px; }
    .community-stats-top { display: grid; }
    .community-actions { justify-content: flex-start; }
    .post-meta { flex-direction: row; align-items: center; }
    .post-actions { margin-left: auto; width: auto; }
    .post-more-menu { position: fixed; top: auto; right: 12px; bottom: 12px; left: 12px; }
    .forum-row { grid-template-columns: 32px minmax(0,1fr); }
    .forum-details, .forum-last-post, .forum-stats { grid-column: 2; }
    .forum-last-post { grid-row: 2; padding-right: 0; }
    .forum-stats { grid-row: 3; justify-content: flex-start; }
}
