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

:root {
    --ink: #222;
    --muted: #626b74;
    --line: #c4cbd2;
    --panel: #ffffff;
    --panel-alt: #f2f5f8;
    --navy: #18344f;
    --navy-2: #294d70;
    --navy-3: #3e6488;
    --accent: #dd6600;
    --accent-soft: #ffcc66;
    --link: #006699;
}

html { min-width: 0; }
body {
    font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-size: 12px;
    background: #e5e5e5 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAEklEQVQImWNgYGD4z0AswK4SAFXuAf8Lsi1VAAAAAElFTkSuQmCC') repeat;
    color: var(--ink);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }
button, input, textarea, select { font: inherit; }

#wrapper {
    width: min(960px, calc(100% - 20px));
    margin: 10px auto;
    background: var(--panel);
    border: 1px solid #999;
    box-shadow: 0 0 8px rgba(0,0,0,.15);
}

#header {
    background: linear-gradient(to bottom, #1f4265 0%, #10283f 100%);
    color: #fff;
    padding: 13px 15px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 3px solid var(--accent);
}
#header .logo { min-width: 0; }
#header .logo a {
    display: inline-block;
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -.6px;
}
#header .logo a:hover { color: var(--accent-soft); }
#header .tagline {
    display: block;
    font-size: 11px;
    color: #bdd6ef;
    margin-top: 5px;
}
#header .userbar { font-size: 11px; text-align: right; white-space: nowrap; }
#header .userbar a, #header .userbar .link-button { color: var(--accent-soft); margin-left: 12px; }
#header .userbar a:hover, #header .userbar .link-button:hover { color: #fff; }
#header .welcome { color: #d6dde4; }

#nav {
    background: var(--navy-2);
    padding: 6px 15px;
    border-bottom: 1px solid var(--navy);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
}
#nav a {
    color: #fff;
    margin-right: 18px;
    font-weight: bold;
    font-size: 11px;
}
#nav a:hover { color: var(--accent-soft); text-decoration: none; }

#breadcrumbs {
    background: #f0f0f0;
    padding: 7px 12px;
    border-bottom: 1px solid #ccc;
    font-size: 11px;
    color: #555;
    overflow-x: auto;
    white-space: nowrap;
}

#content { padding: 12px; min-height: 420px; }

.page-heading {
    margin-bottom: 13px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}
.page-heading h1 {
    font-size: 16px;
    line-height: 1.35;
    color: var(--navy);
    margin: 0;
}
.page-heading p { margin-top: 4px; color: var(--muted); font-size: 11px; }

.forum-section { margin-bottom: 18px; }
.forum-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #999;
    table-layout: auto;
}
.forum-table th {
    background: linear-gradient(to bottom, #4a6a8c 0%, #2a4a6c 100%);
    color: #fff;
    padding: 7px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: bold;
    border-bottom: 1px solid #1a3a5c;
}
.forum-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
    background: #fafafa;
}
.forum-table tr:nth-child(even) td { background: #f0f4f8; }
.forum-table tbody tr:hover td { background: #e8f0f8; }
.forum-table .cat-header {
    background: #3a5a7c !important;
    color: #fff;
    font-weight: bold;
    padding: 7px 10px;
    font-size: 12px;
}
.cat-desc { font-weight: normal; color: #d6e0ea; margin-left: 4px; }
.forum-table .primary-cell { width: 55%; }
.forum-table .forum-name { font-weight: bold; font-size: 13px; }
.forum-table .forum-desc { color: #555; font-size: 11px; margin-top: 3px; }
.forum-table .stats { text-align: center; width: 72px; color: #444; font-size: 11px; }
.forum-table th.stats { color: #fff; }
.forum-table .lastpost { width: 185px; font-size: 11px; color: #555; }
.forum-table th.lastpost { color: #fff; }
.empty-state { text-align: center; padding: 24px !important; color: #666; }

.topic-title { font-weight: bold; font-size: 13px; }
.topic-meta { font-size: 10px; color: #777; margin-top: 3px; }
.mobile-topic-stats { display: none; color: #6a737c; font-size: 10px; margin-top: 5px; }
.sticky { background: #fff8e0 !important; }
.locked { opacity: .8; }
.topic-flag {
    display: inline-block;
    vertical-align: 1px;
    margin-right: 5px;
    padding: 1px 4px;
    border: 1px solid currentColor;
    font-size: 9px;
    line-height: 1.2;
    font-weight: 700;
}
.sticky-flag { color: #b85c00; }
.locked-flag { color: #8d1b1b; }
.pulse-list-total { font-weight: 700; color: #9a4a00 !important; }

.post {
    border: 1px solid #999;
    margin-bottom: 12px;
    background: #fff;
}
.post-header {
    background: linear-gradient(to bottom, #e8eef5 0%, #d0d8e0 100%);
    padding: 6px 10px;
    border-bottom: 1px solid #999;
    font-size: 11px;
    color: #333;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.post-author { font-weight: bold; color: var(--link); }
.post-body {
    padding: 14px;
    min-height: 64px;
    line-height: 1.55;
    white-space: normal;
    overflow-wrap: anywhere;
}
.post-footer {
    background: #f5f5f5;
    padding: 5px 10px;
    border-top: 1px solid #ddd;
    font-size: 10px;
    color: #777;
    text-align: right;
}

.pulse-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 13px;
    padding: 8px 10px;
    border: 1px solid #b8bec5;
    background: linear-gradient(to bottom, #fffdf7, #f4f0e8);
}
.pulse-score {
    min-width: 76px;
    text-align: center;
    padding-right: 12px;
    border-right: 1px solid #d0c8bb;
}
.pulse-score strong {
    display: block;
    font-size: 20px;
    line-height: 1;
    color: #a54e00;
}
.pulse-score span { display: block; margin-top: 3px; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: #6e665d; }
.pulse-actions { display: flex; align-items: center; gap: 5px; }
.pulse-label { color: #5a554f; font-size: 10px; font-weight: 700; margin-right: 2px; }
.pulse-btn {
    min-width: 34px;
    height: 28px;
    border: 1px solid #9c7a52;
    background: linear-gradient(to bottom, #fff, #eadbc8);
    color: #7b3d00;
    font-weight: 700;
    cursor: pointer;
}
.pulse-btn:hover:not(:disabled) { background: #fff4df; border-color: #b65b00; }
.pulse-btn:disabled { opacity: .48; cursor: default; }
.pulse-status { margin-left: auto; font-size: 10px; color: #666; text-align: right; }
.pulse-status[data-state="success"] { color: #096b22; }
.pulse-status[data-state="error"] { color: #8d1b1b; }

.form-box {
    border: 1px solid #999;
    background: #f8f8f8;
    padding: 15px;
    margin-bottom: 15px;
}
.form-box h2 {
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--navy);
    border-bottom: 1px solid #ccc;
    padding-bottom: 6px;
}
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 4px; color: #333; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 650px;
    padding: 7px 8px;
    border: 1px solid #999;
    font-family: Verdana, sans-serif;
    font-size: 12px;
    background: #fff;
}
.form-group textarea { min-height: 190px; resize: vertical; }

.btn {
    display: inline-block;
    padding: 7px 16px;
    background: linear-gradient(to bottom, #4a6a8c 0%, #2a4a6c 100%);
    color: #fff !important;
    border: 1px solid #1a3a5c;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: linear-gradient(to bottom, #5a7a9c 0%, #3a5a7c 100%); text-decoration: none; color: var(--accent-soft) !important; }
.btn-secondary { background: linear-gradient(to bottom, #888 0%, #555 100%); border-color: #333; }

.error, .success, .info { padding: 8px 12px; margin-bottom: 12px; }
.error { background: #ffe0e0; border: 1px solid #cc0000; color: #900; }
.success { background: #e0ffe0; border: 1px solid #009900; color: #060; }
.info { background: #e8f4ff; border: 1px solid #0066aa; color: #003366; }

.text-page {
    max-width: 760px;
    border: 1px solid #bbb;
    background: #fafafa;
    padding: 18px;
}
.text-page h1 { font-size: 17px; color: var(--navy); margin-bottom: 14px; }
.text-page p { margin-bottom: 12px; line-height: 1.65; }

#footer {
    background: var(--navy-2);
    color: #cdd6df;
    padding: 11px 12px;
    text-align: center;
    font-size: 10px;
    border-top: 3px solid var(--accent);
}
#footer a { color: var(--accent-soft); }
.footer-sep { padding: 0 7px; }

.small { font-size: 10px; color: #666; }
.inline-form { display: inline; margin: 0; padding: 0; }
.link-button { display: inline; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; text-decoration: none; }
.link-button:hover { text-decoration: underline; }

@media (max-width: 760px) {
    body { font-size: 13px; background: #e5e5e5; }
    #wrapper { width: 100%; margin: 0; border-left: 0; border-right: 0; box-shadow: none; }
    #header { align-items: flex-start; padding: 13px 12px; }
    #header .logo a { font-size: 23px; }
    #header .tagline { max-width: 70vw; line-height: 1.35; }
    #content { padding: 10px; min-height: 360px; }
    #breadcrumbs { padding-left: 10px; padding-right: 10px; }
    .page-heading { align-items: center; }
    .page-heading h1 { font-size: 15px; }
    .forum-table { border-collapse: separate; border-spacing: 0; }
    .forum-table .stats, .forum-table .lastpost { display: none; }
    .forum-table .primary-cell { width: auto; }
    .mobile-topic-stats { display: block; }
    .cat-desc { display: block; margin: 2px 0 0; font-size: 10px; line-height: 1.35; }
    .post-body { padding: 12px; }
    .pulse-panel { flex-wrap: wrap; gap: 8px 10px; }
    .pulse-score { min-width: 64px; }
    .pulse-status { flex-basis: 100%; margin-left: 0; text-align: left; border-top: 1px solid #ddd4c6; padding-top: 7px; }
    .form-group input[type="text"], .form-group input[type="password"], .form-group select, .form-group textarea { max-width: none; font-size: 16px; }
    .btn { min-height: 34px; }
}

@media (max-width: 480px) {
    #header { display: block; }
    #header .userbar { margin-top: 9px; text-align: left; white-space: normal; }
    #header .userbar a, #header .userbar .link-button { margin-left: 0; margin-right: 12px; }
    #header .welcome { display: block; margin-bottom: 4px; }
    #header .tagline { max-width: none; }
    #nav { padding: 7px 10px; }
    #nav a { margin-right: 15px; }
    .column-headings { display: none; }
    .forum-table, .forum-table tbody, .forum-table tr, .forum-table td { display: block; width: 100%; }
    .forum-table thead, .forum-table thead tr, .forum-table thead th { width: 100%; }
    .forum-table tbody tr { border-bottom: 1px solid #cbd1d7; }
    .forum-table tbody tr:last-child { border-bottom: 0; }
    .forum-table td.primary-cell { border: 0; padding: 11px 10px; }
    .forum-table tr:nth-child(even) td.primary-cell { background: #f0f4f8; }
    .forum-table tbody tr:hover td.primary-cell { background: #e8f0f8; }
    .page-heading { align-items: flex-start; }
    .page-heading .btn { padding-left: 10px; padding-right: 10px; white-space: nowrap; }
    .post-header { align-items: flex-start; }
    .pulse-actions { margin-left: auto; }
    .pulse-btn { min-width: 38px; height: 32px; }
    .text-page { padding: 14px; }
}
.access-box { max-width: 400px; margin: 28px auto; }
.mobile-forum-list, .mobile-topic-list { display: none; }
.mobile-cat-header {
    background: #3a5a7c;
    color: #fff;
    border: 1px solid #273f57;
    padding: 8px 10px;
}
.mobile-cat-header strong { display: block; font-size: 12px; }
.mobile-cat-header span { display: block; margin-top: 2px; color: #d9e3ec; font-size: 10px; }
.mobile-forum-card, .mobile-topic-card {
    display: block;
    padding: 11px 10px;
    border: 1px solid #c2c9d0;
    border-top: 0;
    background: #fafafa;
    color: #222;
    text-decoration: none;
}
.mobile-forum-card:nth-child(odd), .mobile-topic-card:nth-child(even) { background: #f0f4f8; }
.mobile-forum-card strong, .mobile-topic-card strong { display: block; color: #006699; font-size: 13px; }
.mobile-forum-card span, .mobile-topic-card span { display: block; margin-top: 3px; color: #555; font-size: 11px; }
.mobile-forum-card small, .mobile-topic-card small { display: block; margin-top: 6px; color: #707981; font-size: 10px; }
.mobile-forum-card:hover, .mobile-topic-card:hover { background: #e8f0f8; text-decoration: none; }
.mobile-empty { border: 1px solid #bbb; background: #fafafa; padding: 18px; text-align: center; color: #666; }
.pulse-actions { flex: 0 0 auto; }
.pulse-btn { flex: 0 0 34px; }
.pulse-status { flex: 1 1 180px; min-width: 140px; }

@media (max-width: 480px) {
    .desktop-forum-table { display: none; }
    .mobile-forum-list, .mobile-topic-list { display: block; }
    .forum-section { margin-bottom: 14px; }
}
