    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    a { text-decoration: none; }

    :root {
      --soil:      #1C1408;
      --soil-mid:  #261c0a;
      --blue:      #38C8FF;
      --blue-dim:  rgba(56,200,255,0.11);
      --green:     #5ADB8A;
      --green-dim: rgba(90,219,138,0.13);
      --orange:    #E07A28;
      --canvas:    #F0EAE0;
      --card:      #FDF9F3;
      --border:    #DDD5C4;
      --text-1:    #1a1208;
      --text-2:    #4a4030;
      --muted:     #9a9070;
    }

    html { font-size: 14px; }
    body {
      font-family: 'Nunito', sans-serif;
      background-color: var(--canvas);
      color: var(--text-1);
      min-height: 100vh;
      line-height: 1.5;
    }

    .btn-new {
      background: var(--blue); color: var(--soil);
      border: none; border-radius: 6px; padding: 7px 14px;
      font-size: 13px; font-weight: 600;
      font-family: 'Nunito', sans-serif;
      display: flex; align-items: center; gap: 5px;
      transition: background .15s, opacity .15s; white-space: nowrap;
      cursor: pointer;
    }
    .btn-new:hover { opacity: .88; background: var(--blue); }

    .layout {
      display: flex;
      min-height: calc(100vh - 55px);
    }

    .sidebar {
      width: 216px; flex-shrink: 0;
      background: var(--card);
      border-right: 1px solid var(--border);
      position: fixed; top: 55px; bottom: 0;
      overflow-y: auto;
      padding: 18px 0 40px;
    }

    .sb-label {
      font-family: 'Outfit', sans-serif;
      font-size: 10px; font-weight: 700;
      letter-spacing: 0.9px; text-transform: uppercase;
      color: var(--muted);
      padding: 2px 16px 8px;
    }

    .sb-item {
      display: flex; align-items: center; gap: 9px;
      padding: 7px 16px;
      color: var(--text-2); font-size: 13.5px; font-weight: 500;
      cursor: pointer; user-select: none;
      border-left: 3px solid transparent;
      transition: background .12s, color .12s, border-color .12s;
    }
    .sb-item:hover { background: var(--canvas); color: var(--text-1); }
    .sb-item.active {
      background: var(--blue-dim); color: var(--blue);
      border-left-color: var(--blue); font-weight: 600;
    }

    .cat-pip { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
    .sb-div { position: relative; height: 1px; background: var(--border); margin: 10px 14px; }
    .sb-div::after {
      content: '';
      position: absolute;
      left: 50%; top: 50%;
      transform: translate(-50%, -50%);
      width: 5px; height: 5px;
      border-radius: 50%;
      background: var(--blue);
      opacity: 0.5;
    }

    .sb-stat {
      display: flex; justify-content: space-between;
      padding: 4px 16px;
      font-size: 12.5px; color: var(--muted);
    }
    .sb-stat strong {
      font-family: 'Fira Code', monospace;
      font-size: 11.5px; color: var(--text-1); font-weight: 500;
    }

    .main { flex: 1; margin-left: 216px; padding: 24px 28px 48px; background: var(--canvas); }

    .page-head { margin-bottom: 20px; }
    .page-title {
      font-family: 'Outfit', sans-serif;
      font-size: 20px; font-weight: 700; color: var(--soil);
    }
    .page-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
    .consent-notice { font-size: 12px; color: var(--muted); margin-top: 10px; max-width: 480px; }

    .subnav {
      display: flex; align-items: center;
      border-bottom: 1px solid var(--border);
      margin-bottom: 16px;
    }
    .sn-tab {
      padding: 8px 14px;
      font-size: 13.5px; font-weight: 500;
      color: var(--muted); cursor: pointer;
      border-bottom: 2px solid transparent;
      margin-bottom: -1px;
      transition: color .15s, border-color .15s;
      user-select: none;
    }
    .sn-tab:hover { color: var(--text-1); }
    .sn-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

    /* ── Section label (main-site style) ── */
    .sec-label {
      font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
      color: var(--muted); display: flex; align-items: center; gap: 8px;
      margin-bottom: 14px;
    }
    .sec-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

    /* ── View tabs (Latest / Categories / Top / Tags) ── */
    .view-tabs {
      display: flex; align-items: center;
      border-bottom: 1px solid var(--border);
      margin-bottom: 16px;
    }
    .v-tab {
      padding: 8px 14px; font-size: 13.5px; font-weight: 500;
      color: var(--muted); cursor: pointer;
      border-bottom: 2px solid transparent; margin-bottom: -1px;
      transition: color .15s, border-color .15s; user-select: none;
    }
    .v-tab:hover { color: var(--text-1); }
    .v-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

    /* ── Sidebar new-topic button ── */
    .sb-btn {
      display: block; width: calc(100% - 20px); margin: 0 10px 14px;
      background: var(--blue); color: var(--soil);
      border: none; border-radius: 6px; padding: 8px 0;
      font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 700;
      text-align: center; cursor: pointer;
      transition: opacity .15s;
    }
    .sb-btn:hover { opacity: .88; }

    /* ── Topic table ── */
    .topic-table {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 8px; overflow: hidden;
    }
    .tt-cols { grid-template-columns: 1fr 88px 56px 60px 82px; }
    .tt-head {
      display: grid; padding: 8px 16px;
      background: var(--canvas);
      border-bottom: 1px solid var(--border);
    }
    .tt-head-cell {
      font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px;
      text-transform: uppercase; color: var(--muted);
    }
    .tt-head-cell:not(:first-child) { text-align: center; }

    .topic-row {
      display: grid; padding: 11px 16px;
      border-bottom: 1px solid var(--border);
      border-left: 3px solid transparent;
      align-items: center;
      transition: background .1s;
      cursor: pointer;
    }
    .topic-row:last-child { border-bottom: none; }
    .topic-row:hover { background: #f7f8fc; }

    .topic-link {
      font-size: 14px; font-weight: 600; color: var(--text-1);
      display: block; margin-bottom: 4px;
      transition: color .12s;
    }
    .topic-row:hover .topic-link { color: var(--blue); }

    .topic-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

    .cat-badge {
      display: inline-flex; align-items: center; gap: 3px;
      padding: 2px 7px; border-radius: 4px;
      font-size: 10px; font-weight: 700;
      text-transform: uppercase; letter-spacing: .04em;
    }
    .pinned-tag {
      font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
      color: var(--orange); background: rgba(224,112,24,0.11);
      padding: 1px 6px; border-radius: 3px;
    }
    .locked-tag {
      font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
      color: #991b1b; background: rgba(239,68,68,0.1);
      padding: 1px 6px; border-radius: 3px;
    }

    .posters { display: flex; align-items: center; justify-content: center; }
    .av-link { text-decoration: none; display: contents; }
    .av-link .av { cursor: pointer; }
    .av-link .av:hover { opacity: 0.82; }
    .av {
      border-radius: 50%;
      border: 2px solid #fdf9f3;
      display: flex; align-items: center; justify-content: center;
      font-size: 8.5px; font-weight: 700; color: white;
      font-family: 'Outfit', sans-serif;
      margin-left: -4px; flex-shrink: 0;
    }
    .av:first-child { margin-left: 0; }

    .t-num {
      text-align: center;
      font-family: 'Fira Code', monospace;
      font-size: 13px; color: var(--text-2); font-weight: 500;
    }
    .t-time { text-align: center; font-size: 12px; color: var(--muted); white-space: nowrap; }

    /* ── Category grid ── */
    .cat-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 12px;
    }
    .cat-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 8px; overflow: hidden;
      transition: box-shadow .15s, transform .15s;
      cursor: pointer;
    }
    .cat-card:hover { box-shadow: 0 4px 18px rgba(15,24,41,0.09); transform: translateY(-1px); }
    .cat-card-head {
      padding: 14px 16px;
      display: flex; align-items: center; gap: 12px;
      border-bottom: 1px solid var(--border);
    }
    .cat-icon {
      width: 36px; height: 36px; border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      font-size: 18px; flex-shrink: 0;
    }
    .cat-name { font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 700; }
    .cat-desc { font-size: 12px; color: var(--muted); margin-top: 1px; }
    .cat-card-foot {
      padding: 8px 16px;
      background: var(--canvas);
      display: flex; gap: 16px;
    }
    .c-stat { font-size: 11.5px; color: var(--muted); }
    .c-stat strong {
      font-family: 'Fira Code', monospace;
      font-size: 11px; color: var(--text-1); font-weight: 500;
    }

    /* ── Tags ── */
    .tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
    .tag-pill {
      background: var(--card); border: 1px solid var(--border);
      border-radius: 999px; padding: 5px 12px;
      font-size: 12.5px; color: var(--text-2); font-weight: 500;
      cursor: pointer; transition: border-color .15s, color .15s;
    }
    .tag-pill:hover { border-color: var(--blue); color: var(--blue); }
    .tag-count {
      font-family: 'Fira Code', monospace;
      font-size: 11px; color: var(--muted); margin-left: 4px;
    }

    /* ── View management ── */
    .view { display: none; }
    .view.active { display: block; }

    /* ── Loading / empty states ── */
    .state-msg {
      padding: 40px; text-align: center;
      color: var(--muted); font-size: 13.5px;
    }

    /* ══ THREAD PANEL ══ */
    .thread-panel {
      position: fixed;
      top: 55px; left: 216px; right: 0; bottom: 0;
      background: var(--canvas);
      overflow-y: auto;
      z-index: 50;
      transform: translateX(100%);
      transition: transform 0.18s ease;
    }
    .thread-panel.open { transform: translateX(0); }

    .thread-toolbar {
      display: flex; align-items: center; gap: 10px;
      padding: 12px 28px;
      background: var(--card);
      border-bottom: 1px solid var(--border);
      position: sticky; top: 0; z-index: 10;
    }
    .btn-back {
      background: none; border: 1px solid var(--border);
      border-radius: 6px; padding: 6px 12px;
      font-size: 13px; color: var(--text-2);
      cursor: pointer; font-family: 'Nunito', sans-serif;
      display: flex; align-items: center; gap: 5px;
      flex-shrink: 0;
    }
    .btn-back:hover { border-color: var(--blue); color: var(--blue); }

    .thread-body { padding: 24px 28px 60px; max-width: 780px; }

    .thread-title {
      font-family: 'Outfit', sans-serif;
      font-size: 22px; font-weight: 700;
      color: var(--soil); margin-bottom: 12px; line-height: 1.3;
    }
    .thread-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
    .thread-tags .tag-pill { font-size: 11.5px; padding: 3px 10px; }

    .post {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 16px;
      margin-bottom: 10px;
      display: flex; gap: 14px;
    }
    .post.post-first { border-top: 3px solid var(--blue); }
    .post-av {
      width: 36px; height: 36px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 12px; font-weight: 700; color: white;
      font-family: 'Outfit', sans-serif; flex-shrink: 0;
    }
    .post-body { flex: 1; min-width: 0; }
    .post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
    .post-author { font-size: 13.5px; font-weight: 600; color: var(--text-1); }
    .post-time { font-size: 12px; color: var(--muted); }
    .post-edited { font-size: 11px; color: var(--muted); font-style: italic; }
    .post-content { font-size: 14px; line-height: 1.7; color: var(--text-1); }
    .post-content p { margin-bottom: 10px; }
    .post-content p:last-child { margin-bottom: 0; }
    .post-content code {
      font-family: 'Fira Code', monospace; font-size: 12.5px;
      background: var(--canvas); padding: 1px 5px; border-radius: 3px;
    }
    .post-content pre {
      background: var(--soil); color: #e2e8f0;
      border-radius: 6px; padding: 14px 16px;
      overflow-x: auto; margin: 10px 0;
    }
    .post-content pre code { background: none; padding: 0; color: inherit; font-size: 13px; }
    .post-content h1, .post-content h2, .post-content h3 {
      font-family: 'Outfit', sans-serif; font-weight: 700; color: var(--text-1);
      margin: 16px 0 8px; line-height: 1.3;
    }
    .post-content h1 { font-size: 18px; }
    .post-content h2 { font-size: 16px; }
    .post-content h3 { font-size: 14.5px; }
    .post-content ul, .post-content ol { margin: 8px 0 10px 20px; }
    .post-content li { margin-bottom: 4px; }
    .post-content blockquote {
      border-left: 3px solid var(--blue); margin: 10px 0; padding: 8px 12px;
      background: var(--canvas); border-radius: 0 6px 6px 0;
    }
    .post-content blockquote p { margin-bottom: 0; color: var(--text-2); }
    .post-content img { max-width: 100%; height: auto; border-radius: 6px; margin: 10px 0; }
    .post-content hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
    .post-content a { color: var(--blue); text-decoration: underline; }
    .post-content a:hover { color: #1570a0; }

    .reply-prompt {
      padding: 20px; text-align: center;
      font-size: 13.5px; color: var(--muted);
      background: var(--card); border: 1px solid var(--border);
      border-radius: 8px; margin-top: 12px;
    }
    .reply-prompt a { color: var(--blue); }

    .reply-box {
      background: var(--card); border: 1px solid var(--border);
      border-radius: 8px; padding: 16px; margin-top: 12px;
    }
    .reply-box textarea {
      width: 100%; min-height: 100px;
      border: 1px solid var(--border); border-radius: 6px;
      padding: 10px 12px; font-size: 13.5px;
      font-family: 'Nunito', sans-serif;
      resize: vertical; color: var(--text-1); outline: none;
      line-height: 1.5;
    }
    .reply-box textarea:focus { border-color: var(--blue); }
    .reply-box-footer {
      display: flex; align-items: center;
      justify-content: flex-end; gap: 10px; margin-top: 10px;
    }
    .form-error-inline { font-size: 12px; color: #dc2626; flex: 1; }

    /* ══ MODALS ══ */
    .modal-overlay {
      position: fixed; inset: 0;
      background: rgba(15,24,41,0.55);
      z-index: 300;
      display: flex; align-items: center; justify-content: center;
      padding: 16px;
    }
    .modal-overlay.hidden { display: none; }

    .modal-card {
      background: var(--card); border-radius: 10px;
      padding: 28px; width: 100%; max-width: 480px;
      max-height: 90vh; overflow-y: auto;
      position: relative;
    }
    .modal-title {
      font-family: 'Outfit', sans-serif;
      font-size: 18px; font-weight: 700; color: var(--soil);
      margin-bottom: 20px;
    }
    .modal-close {
      position: absolute; top: 16px; right: 16px;
      background: none; border: none; font-size: 20px;
      cursor: pointer; color: var(--muted); line-height: 1;
      padding: 4px;
    }
    .modal-close:hover { color: var(--text-1); }

    .auth-tabs {
      display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px;
    }
    .auth-tab {
      padding: 8px 16px; font-size: 14px; font-weight: 500;
      color: var(--muted); cursor: pointer;
      border-bottom: 2px solid transparent; margin-bottom: -1px;
      transition: color .15s, border-color .15s;
    }
    .auth-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

    .form-group { margin-bottom: 16px; }
    .form-label {
      display: block; font-size: 12.5px; font-weight: 600;
      color: var(--text-2); margin-bottom: 5px;
    }
    .form-input, .form-select, .form-textarea {
      width: 100%; padding: 9px 12px;
      border: 1px solid var(--border); border-radius: 6px;
      font-size: 13.5px; font-family: 'Nunito', sans-serif;
      color: var(--text-1); outline: none; background: var(--card);
    }
    .form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--blue); }
    .form-textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
    .form-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
    .form-error { font-size: 12px; color: #dc2626; margin: 8px 0; min-height: 16px; }

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

    .auth-form.hidden { display: none; }

    /* ── Profile ── */
    .post-av-link { text-decoration: none; display: contents; }
    .post-av-link .post-av { cursor: pointer; }
    .post-av-link .post-av:hover { opacity: 0.85; }
    .profile-card { padding: 20px; }
    .profile-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
    .profile-av { width: 48px; height: 48px; font-size: 1.2rem; flex-shrink: 0; }
    .profile-name { font-size: 1.1rem; font-weight: 700; }
    .profile-username { color: #64748b; font-size: 0.875rem; margin-top: 2px; }
    .profile-joined { color: #94a3b8; font-size: 0.8rem; margin-top: 4px; }
    .profile-bio { margin: 0 0 12px; line-height: 1.6; }
    .profile-website { margin: 0 0 16px; font-size: 0.875rem; }
    .profile-website a { color: #2b7de9; }
    .profile-topics-heading { font-size: 0.75rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
    .profile-topic-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; cursor: pointer; font-size: 0.9rem; }
    .profile-topic-row:hover { color: #2b7de9; }
    .char-counter { font-size: 0.75rem; color: #94a3b8; text-align: right; margin-top: 4px; }

    /* ── Responsive ── */
    @media (max-width: 900px) {
      .sidebar { display: none; }
      .main { margin-left: 0; padding: 16px; }
      .thread-panel { left: 0; }
    }
    /* Toast */
    .toast {
      position: fixed; bottom: 24px; left: 50%;
      transform: translateX(-50%);
      background: #1e293b; color: #f8fafc;
      padding: 12px 20px; border-radius: 8px;
      font-size: 0.9rem; z-index: 9999;
      opacity: 1; transition: opacity 0.4s ease;
      pointer-events: none; white-space: nowrap;
    }
    .toast.toast-success { border-left: 4px solid #16a34a; }
    .toast.toast-error   { border-left: 4px solid #dc2626; }
    .toast.toast-info    { border-left: 4px solid #2b7de9; }
    .toast.fade-out      { opacity: 0; }

    /* Verification banner */
    .verify-banner {
      background: #fef3c7; color: #92400e;
      padding: 10px 20px; text-align: center;
      font-size: 0.875rem;
      border-bottom: 1px solid #fcd34d;
    }
    .verify-banner button {
      background: none; border: none;
      color: #92400e; font-weight: 600;
      text-decoration: underline; cursor: pointer;
      font-size: inherit; padding: 0;
    }

/* ── Converted from inline style= attributes ─────────────────────── */
.sb-btn-new-topic  { width: calc(100% - 20px); margin: 0 10px 14px; justify-content: center; }
.cat-pip-all       { background: var(--muted); }
.btn-full-width    { width: 100%; justify-content: center; }
.modal-new-topic   { max-width: 540px; }
.tag-label-hint    { color: var(--muted); font-weight: 400; }
.modal-profile     { max-width: 480px; }
.bio-textarea      { min-height: 80px; }
#thread-pin-badge,
#thread-lock-badge { display: none; }
/* User header avatar colour applied via JS .style.background (CSP-safe) */
/* Avatar size variants */
.av-24             { width: 24px; height: 24px; font-size: 8px; }

/* ── Auth modal: forgot-password flow ── */
.btn-text-link { margin-top: 0.75rem; background: none; border: none; color: #2b7de9; cursor: pointer; font-size: 0.9rem; width: 100%; text-align: center; }
.forgot-lead { margin-bottom: 1rem; color: #64748b; font-size: 0.95rem; }
/* No display:none here — forgot-success visibility is toggled via JS .style.display (CSP-safe, see forum.js) */
.form-success { color: #16a34a; margin-bottom: 1rem; font-size: 0.95rem; }
