
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --slate: #334155;
    --slate-light: #64748b;
    --slate-lighter: #94a3b8;
    --slate-bg: #f8fafc;
    --slate-border: #e2e8f0;
    --accent: #7c3aed;
    --accent-light: #ede9fe;
    --accent-mid: #a78bfa;
    --white: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --sidebar-w: 220px;
  }

  body {
    font-family: 'Work Sans', sans-serif;
    background: var(--white);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
  }

  a { color: var(--accent); text-decoration: none; }
  a:hover { text-decoration: underline; }

  /* UTILITY ROW */
  .utility-row {
    background: var(--slate);
    color: #cbd5e1;
    font-size: 12px;
    padding: 5px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    align-items: center;
  }
  .utility-row a { color: #cbd5e1; font-size: 12px; }
  .utility-row a:hover { color: var(--white); text-decoration: none; }

  /* HEADER */
  header {
    background: var(--white);
    border-bottom: 2px solid var(--slate-border);
    position: relative;
  }
  .header-tabs {
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 0;
    border-bottom: 1px solid var(--slate-border);
  }
  .header-tabs nav {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
  }
  .header-tabs nav a {
    display: block;
    padding: 14px 18px;
    color: var(--slate-light);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s;
  }
  .header-tabs nav a:hover { color: var(--accent); text-decoration: none; border-bottom-color: var(--accent-mid); }
  .header-tabs nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

  .hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    gap: 5px;
    margin-left: auto;
  }
  .hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--slate);
    border-radius: 2px;
  }

  /* LAYOUT */
  .page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
  }

  /* LEFT SIDEBAR */
  .sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: 20px;
  }
  .sidebar-section {
    margin-bottom: 28px;
  }
  .sidebar-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-lighter);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--slate-border);
  }
  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--slate-light);
    font-size: 13.5px;
    font-weight: 400;
    transition: background 0.12s, color 0.12s;
    margin-bottom: 2px;
  }
  .sidebar-link:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }
  .sidebar-link.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
  .sidebar-link .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--slate-border);
    flex-shrink: 0;
  }
  .sidebar-link.active .dot { background: var(--accent); }

  /* MAIN CONTENT */
  .main-content { flex: 1; min-width: 0; }

  /* BREADCRUMBS */
  .breadcrumbs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
  }
  .breadcrumb-pill {
    font-size: 12px;
    color: var(--slate-light);
    background: var(--slate-bg);
    border: 1px solid var(--slate-border);
    border-radius: 20px;
    padding: 3px 11px;
  }
  .breadcrumb-pill a { color: var(--slate-light); }
  .breadcrumb-pill a:hover { color: var(--accent); text-decoration: none; }
  .breadcrumb-sep { color: var(--slate-lighter); font-size: 12px; display: flex; align-items: center; }

  /* THREAD TITLE AREA */
  .thread-header { margin-bottom: 22px; }
  h1.thread-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 10px;
  }
  .thread-meta-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12.5px;
    color: var(--text-muted);
    align-items: center;
  }
  .thread-meta-inline span { display: flex; align-items: center; gap: 5px; }
  .category-tag {
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 4px;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 600;
  }

  /* POST CARDS */
  .post-card {
    background: var(--white);
    border: 1px solid var(--slate-border);
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 14px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    position: relative;
  }
  .post-card.op-card { border-left: 3px solid var(--accent); }

  .post-meta-left {
    flex: 1;
    min-width: 0;
  }
  .post-meta-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
  }
  .username {
    font-weight: 600;
    font-size: 14px;
    color: var(--slate);
  }
  .username.op-badge::after {
    content: 'OP';
    background: var(--accent);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: middle;
  }
  .post-time {
    font-size: 12px;
    color: var(--slate-lighter);
  }
  .post-num {
    margin-left: auto;
    font-size: 12px;
    color: var(--slate-lighter);
  }
  .post-body {
    font-size: 14.5px;
    color: var(--text);
    line-height: 1.7;
  }
  .post-body p { margin-bottom: 8px; }
  .post-body p:last-child { margin-bottom: 0; }

  .post-avatar-right {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: var(--white);
    order: 2;
  }

  .post-actions {
    display: flex;
    gap: 14px;
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--slate-lighter);
  }
  .post-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--slate-lighter);
    font-size: 12.5px;
    font-family: 'Work Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    transition: color 0.12s;
  }
  .post-actions button:hover { color: var(--accent); }

  /* Reply form */
  .reply-form-wrap {
    background: var(--slate-bg);
    border: 1px solid var(--slate-border);
    border-radius: 10px;
    padding: 20px 22px;
    margin-top: 24px;
  }
  .reply-form-wrap h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--slate);
  }
  .reply-form-wrap textarea {
    width: 100%;
    min-height: 80px;
    border: 1px solid var(--slate-border);
    border-radius: 7px;
    padding: 10px 14px;
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    resize: vertical;
    margin-bottom: 10px;
  }
  .reply-form-wrap textarea:focus { outline: none; border-color: var(--accent-mid); }
  .btn-reply {
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: 7px;
    padding: 9px 22px;
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s;
  }
  .btn-reply:hover { background: #6d28d9; }
  .login-note { font-size: 12.5px; color: var(--slate-lighter); margin-left: 12px; }

  /* FOOTER */
  footer {
    background: var(--slate);
    color: #94a3b8;
    padding: 40px 24px 24px;
    margin-top: 60px;
  }
  .footer-inner {
    max-width: 1200px;
    margin: 0 auto;
  }
  .footer-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 28px;
  }
  .footer-col h4 {
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 14px;
  }
  .footer-col ul { list-style: none; }
  .footer-col ul li { margin-bottom: 8px; }
  .footer-col ul li a { color: #94a3b8; font-size: 13px; }
  .footer-col ul li a:hover { color: var(--white); text-decoration: none; }
  .footer-bottom {
    border-top: 1px solid #475569;
    padding-top: 18px;
    font-size: 12px;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Mobile nav drawer */
  .mobile-nav {
    display: none;
    background: var(--white);
    border-top: 1px solid var(--slate-border);
    padding: 16px 24px;
    flex-direction: column;
    gap: 4px;
  }
  .mobile-nav.open { display: flex; }
  .mobile-nav a {
    display: block;
    padding: 9px 12px;
    color: var(--slate);
    font-size: 14px;
    border-radius: 6px;
  }
  .mobile-nav a:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }

  /* Avatar colors */
  .av1 { background: #7c3aed; }
  .av2 { background: #0891b2; }
  .av3 { background: #059669; }
  .av4 { background: #d97706; }
  .av5 { background: #dc2626; }
  .av6 { background: #7c3aed; opacity: 0.75; }
  .av7 { background: #475569; }
  .av8 { background: #0f766e; }
  .av9 { background: #9333ea; }

  @media (max-width: 768px) {
    .header-tabs nav { display: none; }
    .hamburger { display: flex; }
    .page-wrap { flex-direction: column; padding: 16px; gap: 20px; }
    .sidebar { width: 100%; position: static; }
    .sidebar-section { display: none; }
    .footer-cols { grid-template-columns: 1fr; gap: 24px; }
    h1.thread-title { font-size: 18px; }
    .post-card { flex-wrap: wrap; }
    .post-avatar-right { order: -1; }
  }
