:root {
  --bg: #161616;
  --topbar: #1b1b1b;
  --row: #1d1d1d;
  --row-hover: #232323;
  --border: #2c2c2c;
  --border-strong: #383838;
  --text: #e8e8e8;
  --muted: #8d8a9f;
  --accent: #ff6a00;
  --accent-hover: #ff8c33;
  --yellow: #e5dc12;
  --radius: 4px;
  --font: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1 { font-size: 26px; margin: 0 0 4px; font-weight: 500; letter-spacing: -.01em; }
p { margin: 0 0 12px; }
button { font: inherit; color: inherit; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon.inline { width: 14px; height: 14px; vertical-align: -2px; }
.muted, .meta { color: var(--muted); }
.meta { font-size: 13px; }
.c-white { color: #fff; }
.c-accent { color: var(--accent); }
.c-yellow { color: var(--yellow); }

.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 40px; padding-bottom: 40px; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--topbar);
  border-bottom: 1px solid #111;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav { display: flex; align-items: stretch; height: 100%; flex: 1; min-width: 0; }
.nav-item { position: relative; display: flex; align-items: stretch; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .02em;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s;
}
.nav-link .icon { width: 15px; height: 15px; }
.nav-link .caret { width: 13px; height: 13px; margin-left: -2px; }
.nav-item:hover > .nav-link, .nav-link:hover { color: #fff; }
.nav-item.active > .nav-link { color: #fff; font-weight: 600; }
.nav-item.active > .nav-link::after {
  content: '';
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 12px;
  height: 2px;
  background: var(--accent);
}
.nav-highlight > .nav-link { color: var(--yellow); font-weight: 600; }
.nav-highlight > .nav-link:hover { color: #fff35a; }

.dd {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #202020;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 6px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  z-index: 60;
}
.dd-right { left: auto; right: 0; }
.has-dd:hover > .dd, .has-dd:focus-within > .dd, .has-dd.open > .dd { display: block; }
.dd a, .dd button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 14px;
  font-size: 14px;
  color: var(--text);
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.dd a:hover, .dd button:hover { background: #2a2a2a; color: var(--accent-hover); }
.dd form { margin: 0; }
.dd .icon { width: 15px; height: 15px; }
.dd-label {
  padding: 8px 14px 3px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.nav-right { display: flex; align-items: center; gap: 4px; height: 100%; margin-left: auto; }

/* Account panel (opens from the username) */
.account-wrap { position: relative; height: 100%; display: flex; align-items: center; }
.account-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px;
  background: none;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.account-toggle:hover, .account-wrap.open .account-toggle { background: #262626; }
.account-panel {
  display: none;
  position: absolute;
  top: calc(100% - 4px);
  right: 0;
  width: 350px;
  background: #1e1e1e;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
  z-index: 70;
  overflow: hidden;
}
.account-wrap.open .account-panel { display: block; }
.ap-tabs { display: flex; gap: 4px; padding: 0 12px; background: #181818; border-bottom: 1px solid var(--border-strong); }
.ap-tabs button {
  padding: 11px 12px 9px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.ap-tabs button:hover { color: #fff; }
.ap-tabs button.on { color: #fff; border-bottom-color: var(--accent); }
.ap-head { display: flex; gap: 16px; align-items: center; padding: 14px 12px; border-bottom: 1px solid var(--border-strong); }
.ap-who { flex: 1; min-width: 0; }
.ap-name { color: var(--accent); font-weight: 600; font-size: 16px; word-break: break-all; }
.ap-role { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.ap-stats { margin: 0; display: grid; gap: 2px; font-size: 14px; }
.ap-stats div { display: flex; justify-content: space-between; gap: 8px; }
.ap-stats dt { color: var(--muted); }
.ap-stats dd { margin: 0; }
.ap-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
  margin: 0 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-strong);
}
.ap-links a { padding: 3px 4px; color: #a3a3a3; font-size: 14px; }
.ap-links a:hover { color: var(--accent-hover); }
.ap-logout { margin: 0; padding: 6px 12px 8px; }
.ap-logout button { background: none; border: 0; padding: 3px 4px; color: #a3a3a3; font-size: 14px; cursor: pointer; }
.ap-logout button:hover { color: var(--accent-hover); }
.ap-empty { padding: 18px 16px; margin: 0; color: var(--muted); font-size: 14px; }
.ap-bookmarks { list-style: none; margin: 0; padding: 6px 0; max-height: 360px; overflow-y: auto; }
.ap-bookmarks li { display: grid; padding: 7px 16px; border-bottom: 1px solid var(--border); }
.ap-bookmarks li:last-child { border-bottom: 0; }
.ap-bookmarks a { color: var(--text); font-weight: 500; word-break: break-word; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}
.icon-btn:hover { color: #fff; background: #262626; }
.search-toggle .icon { width: 20px; height: 20px; color: #fff; }
.search-wrap { position: relative; }
.search-pop {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 11px);
  background: #202020;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px;
  gap: 8px;
  width: 320px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.search-wrap.open .search-pop { display: flex; }
.search-pop input { flex: 1; min-width: 0; }
.search-pop button {
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  padding: 0 12px;
  font-weight: 600;
  cursor: pointer;
}

.nav-toggle, .brand-mobile { display: none; }

/* ---------- Avatars ---------- */
.avatar {
  --size: 36px;
  width: var(--size);
  height: var(--size);
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--av);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-weight: 600;
  font-size: calc(var(--size) * .45);
  line-height: 1;
}

/* ---------- Panels (boxed sections with the title on the border) ---------- */
.panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px 16px;
  margin-bottom: 26px;
}
.panel-title {
  position: absolute;
  top: -11px;
  left: 14px;
  margin: 0;
  padding: 0 8px;
  background: var(--bg);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 22px;
  max-width: calc(100% - 28px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* Forum rows */
.node-list { display: grid; gap: 16px; }
.node {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 110px minmax(0, 290px);
  align-items: center;
  gap: 14px;
  min-height: 70px;
  padding: 12px 16px 12px 22px;
  background: var(--row);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: background .15s, border-color .15s;
}
.node:hover { background: var(--row-hover); border-color: #444; }
.node-icon .icon { width: 26px; height: 26px; }
.node-title { font-size: 17px; font-weight: 500; }
.node-title:hover { color: var(--accent-hover); }
.node-desc { color: var(--muted); font-size: 13px; }
.node-stats { text-align: center; line-height: 1.15; }
.node-stats strong { display: block; font-size: 18px; font-weight: 600; }
.node-stats span { color: var(--muted); font-size: 13px; }
.node-latest { display: flex; align-items: center; gap: 10px; min-width: 0; }
.latest-meta { min-width: 0; }
.latest-title {
  display: block;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-link { color: var(--accent); font-weight: 600; }
.user-link:hover { color: var(--accent-hover); }

/* Whole row clickable, inner links stay on top */
.stretched::after { content: ''; position: absolute; inset: 0; }
.node a:not(.stretched), .thread-row a:not(.stretched), .node .avatar, .thread-row .avatar { position: relative; z-index: 1; }

/* Sidebar */
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.side-list li { display: flex; gap: 10px; align-items: flex-start; }
.side-list li > div { min-width: 0; }
.side-title { color: var(--text); font-weight: 500; word-break: break-word; }
.side-forum { display: block; color: #b9b9b9; }
.side-forum:hover { color: var(--accent-hover); }
.member-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-list { margin: 0; display: grid; gap: 6px; }
.stats-list div { display: flex; justify-content: space-between; gap: 12px; }
.stats-list dt { color: var(--muted); }
.stats-list dd { margin: 0; font-weight: 600; }

/* ---------- Page headers, crumbs ---------- */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a:hover { color: var(--accent-hover); }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}
.page-head h1 { word-break: break-word; }

/* Thread list */
.thread-list { display: grid; gap: 10px; }
.thread-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 150px 150px;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--row);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.thread-row:hover { background: var(--row-hover); }
.thread-title { font-weight: 600; font-size: 16px; display: block; word-break: break-word; }
.thread-title:hover { color: var(--accent-hover); }
.thread-stats { margin: 0; display: grid; gap: 2px; font-size: 13px; }
.thread-stats div { display: flex; justify-content: space-between; gap: 8px; }
.thread-stats dt { color: var(--muted); }
.thread-stats dd { margin: 0; }
.thread-last { text-align: right; font-size: 13px; }

.pager { display: flex; gap: 6px; flex-wrap: wrap; }
.pager a {
  min-width: 34px;
  padding: 5px 10px;
  text-align: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--row);
}
.pager a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Posts */
.posts { display: grid; gap: 16px; margin-bottom: 30px; }
.post {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  background: var(--row);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-margin-top: 80px;
}
.post-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  background: #1a1a1a;
  border-right: 1px solid var(--border);
  text-align: center;
}
.post-username { font-size: 16px; word-break: break-all; }
.post-user-stats { margin: 6px 0 0; width: 100%; font-size: 12px; display: grid; gap: 2px; }
.post-user-stats div { display: flex; justify-content: space-between; }
.post-user-stats dt { color: var(--muted); }
.post-user-stats dd { margin: 0; }
.post-body { padding: 14px 18px 18px; min-width: 0; }
.post-head { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 12px; }
.post-content { white-space: pre-wrap; word-wrap: break-word; }

.role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: 3px;
  background: #2b2b2b;
  color: #bbb;
}

/* Profile */
.profile-head { display: flex; gap: 22px; align-items: center; padding: 22px; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 24px; margin: 12px 0 0; }
.profile-stats dt { color: var(--muted); font-size: 13px; }
.profile-stats dd { margin: 0; font-weight: 600; font-size: 18px; }

/* ---------- Tickets ---------- */
.hero { display: grid; place-items: center; padding: 30px 0 70px; }
.hero-text {
  font-size: clamp(48px, 9vw, 104px);
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
  color: #f5f5f5;
  text-shadow: -3px -2px 0 #6d3cff, 3px 3px 0 var(--accent);
}
.crumbs-accent a { color: var(--accent); font-weight: 600; }
.ticket-row { grid-template-columns: 40px minmax(0, 1fr) auto 140px; }
.status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 9px;
  border-radius: 3px;
  vertical-align: 1px;
  margin-right: 6px;
}
.status-open { background: rgba(0, 200, 83, .15); color: #4ee38b; }
.status-closed { background: #2b2b2b; color: #9a9a9a; }
.post-staff { border-color: rgba(255, 106, 0, .55); }

.modal {
  width: min(800px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  background: #1e1e1e;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.modal::backdrop { background: rgba(0, 0, 0, .7); }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-strong);
}
.modal-head h2 { margin: 0; font-size: 24px; font-weight: 600; color: var(--accent); }
.modal-close { background: none; border: 0; color: var(--accent); font-size: 32px; line-height: 1; cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--accent-hover); }
.picker-item {
  display: grid;
  gap: 1px;
  padding: 9px 16px 22px;
  border-bottom: 1px solid var(--border-strong);
}
.picker-item:last-child { border-bottom: 0; }
.picker-item:hover { background: #252525; }
.picker-name { color: var(--accent); font-size: 16px; }
.picker-item:hover .picker-name { color: var(--accent-hover); }
.picker-desc { color: var(--muted); font-size: 13px; }

.detail-list { margin: 0 0 18px; display: grid; gap: 10px; max-width: 520px; }
.detail-list div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 600; }
.panel.narrow { max-width: 520px; }

/* ---------- Forms & buttons ---------- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input, textarea {
  width: 100%;
  background: #121212;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  font-weight: 400;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 106, 0, .2); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: #252525;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: #2e2e2e; color: #fff; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-on { border-color: var(--accent); color: var(--accent); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.btn-block { width: 100%; padding: 11px 16px; font-size: 15px; }
.badge { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; border: 1px solid var(--border-strong); padding: 6px 10px; border-radius: var(--radius); }
.badge .icon { width: 14px; height: 14px; }

.alert {
  background: rgba(255, 106, 0, .12);
  border: 1px solid rgba(255, 106, 0, .5);
  color: #ffc799;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 14px;
}
.alert-ok { background: rgba(0, 200, 83, .12); border-color: rgba(0, 200, 83, .5); color: #9ff0c0; }
.empty { color: var(--muted); margin: 4px 0; }
.empty a { color: var(--accent); }
.message-panel { max-width: 640px; margin: 40px auto; text-align: center; padding: 34px 20px 26px; }
.search-big { display: flex; gap: 10px; margin-bottom: 30px; }

/* ---------- Auth gate ---------- */
.auth-page {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
  padding: 20px 0;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #1c1c1c;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 30px 28px 24px;
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 26px; font-weight: 600; margin-bottom: 8px; }
.auth-logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; }
.auth-logo .icon { width: 22px; height: 22px; }
.auth-gate { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.auth-gate .icon { width: 14px; height: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border-strong); margin-bottom: 18px; }
.auth-tabs a { text-align: center; padding: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.auth-tabs a.on { color: #fff; border-bottom-color: var(--accent); }
.auth-switch { text-align: center; font-size: 14px; margin: 16px 0 0; }
.auth-switch a { color: var(--accent); font-weight: 600; }

.footer { border-top: 1px solid var(--border); padding: 18px 0; font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .nav-link { padding: 0 8px; font-size: 13px; }
  .nav-item.active > .nav-link::after { left: 8px; right: 8px; }
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: grid; place-items: center; width: 38px; height: 38px; background: none; border: 0; color: #fff; cursor: pointer; }
  .brand-mobile { display: block; font-weight: 600; font-size: 18px; }
  .nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    height: auto;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    flex-direction: column;
    background: var(--topbar);
    border-bottom: 1px solid var(--border-strong);
    padding: 6px 0 12px;
  }
  .nav.open { display: flex; }
  .nav-item { flex-direction: column; }
  .nav-link { padding: 12px 18px; font-size: 14px; }
  .nav-item.active > .nav-link::after { display: none; }
  .nav-item.active > .nav-link { color: var(--accent); }
  .nav-highlight > .nav-link { color: var(--yellow); }
  .nav .dd { position: static; box-shadow: none; border: 0; background: #151515; border-radius: 0; }
  .nav .has-dd:hover > .dd, .nav .has-dd:focus-within > .dd { display: none; }
  .nav .has-dd.open > .dd { display: block; }
  .nav .dd a { padding-left: 42px; }
  .nav .dd-label { padding-left: 42px; }
}

@media (max-width: 760px) {
  main.container { padding-top: 28px; }
  .node { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 12px 14px; }
  .node-icon .icon { width: 22px; height: 22px; }
  .node-latest { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--border); }
  .thread-row { grid-template-columns: 36px minmax(0, 1fr); }
  .thread-stats, .thread-last { display: none; }
  .post { grid-template-columns: 1fr; }
  .post-user { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 14px; text-align: left; }
  .post-user .avatar { --size: 40px !important; }
  .post-user-stats { display: none; }
  .page-head { flex-direction: column; }
  .profile-head { flex-direction: column; text-align: center; }
  .profile-stats { justify-content: center; }
  .username { display: none; }
  .account-panel { position: fixed; top: 60px; left: 16px; right: 16px; width: auto; max-height: calc(100vh - 76px); overflow-y: auto; }
  .ticket-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .hero { padding: 10px 0 40px; }
  .search-pop { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; }
}

/* ---------- Roles & moderation ---------- */
.role-owner { background: linear-gradient(90deg, #ff6a00, #ffb300); color: #1a1a1a; }
.role-admin { background: #d32f2f; color: #fff; }
.ap-role { margin: 3px 0 6px; }
.ap-links a.ap-staff { color: var(--accent); font-weight: 600; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge-row .status { margin: 0; }
.status-banned { background: rgba(211, 47, 47, .18); color: #ff6b6b; }
.status-timeout { background: rgba(255, 179, 0, .15); color: #ffc94d; }
.timeout-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  background: rgba(255, 179, 0, .12);
  border-bottom: 1px solid rgba(255, 179, 0, .35);
  color: #ffd27a;
  font-size: 14px;
  text-align: center;
}
.timeout-bar .icon { width: 15px; height: 15px; }

.mod-panel { border-color: rgba(255, 106, 0, .4); }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.mod-box { background: var(--row); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 14px; margin: 0; }
.mod-box h3 { margin: 0 0 4px; font-size: 16px; }
.mod-box form { margin: 0; }
.mod-row { display: flex; gap: 8px; }
.mod-form { display: grid; gap: 8px; }
select {
  background: #121212;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 9px 10px;
  font: inherit;
  min-width: 0;
  flex: 1;
}
select:focus { outline: none; border-color: var(--accent); }
.btn-warn { background: #b26a00; border-color: #b26a00; color: #fff; }
.btn-warn:hover { background: #cc7a00; border-color: #cc7a00; }
.btn-danger { background: #c62828; border-color: #c62828; color: #fff; }
.btn-danger:hover { background: #e53935; border-color: #e53935; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.member-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.table .status { margin: 0; white-space: nowrap; }

/* ---------- Premium ---------- */
.role-premium { background: linear-gradient(90deg, #7c4dff, #d500f9); color: #fff; }

/* ---------- Conversations & alerts popovers ---------- */
.pop-wrap { position: relative; }
.icon-btn { position: relative; }
.count-badge {
  position: absolute;
  top: 1px;
  right: -1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}
.pop-panel {
  display: none;
  position: absolute;
  right: -40px;
  top: calc(100% + 11px);
  width: 340px;
  background: #1e1e1e;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
  z-index: 70;
}
.pop-wrap.open .pop-panel { display: block; }
.pop-title { margin: 0; padding: 10px 14px; font-size: 20px; font-weight: 600; border-bottom: 1px solid var(--border-strong); }
.pop-empty { margin: 0; padding: 14px; font-weight: 600; font-size: 14px; }
.pop-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.pop-list a { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.pop-list a:hover { background: #252525; color: var(--text); }
.pop-list li.unread a { background: rgba(255, 106, 0, .08); }
.pop-text { display: grid; gap: 1px; min-width: 0; font-size: 14px; }
.pop-preview, .convo-preview { color: #b5b5b5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-foot { padding: 8px 14px; font-size: 14px; color: var(--muted); }

/* ---------- Conversations & alerts pages ---------- */
.convo-row { grid-template-columns: 40px minmax(0, 1fr) auto 140px; }
.convo-row.unread .thread-title { font-weight: 600; }
.convo-row.unread { border-color: rgba(255, 106, 0, .45); }
.status-new { background: rgba(255, 106, 0, .18); color: #ffa04d; }
.convo-head { display: flex; gap: 12px; align-items: center; }
.profile-dm { margin-top: 14px; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 6px; border-bottom: 1px solid var(--border); }
.alert-list li:last-child { border-bottom: 0; }
.alert-list li.unread { background: rgba(255, 106, 0, .07); border-radius: var(--radius); }
.alert-list a { color: var(--text); }
.alert-list a:hover { color: #fff; }

@media (max-width: 760px) {
  .pop-panel { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; }
  .convo-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
}

/* ---------- Account section (sidebar + pages) ---------- */
.account-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.account-side .panel { padding: 18px 10px 10px; margin-bottom: 22px; }
.side-nav { display: grid; }
.side-nav a, .side-nav button {
  display: block;
  width: 100%;
  padding: 5px 10px;
  border: 0;
  border-left: 2px solid transparent;
  background: none;
  color: #8f8f8f;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.side-nav a:hover, .side-nav button:hover { color: #fff; }
.side-nav a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.side-nav form { margin: 0; }
.account-main > .panel, .account-main > .box, .account-main > .redeem, .account-main > .alert { margin-bottom: 18px; }

.box { background: var(--row); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 14px 16px; }
.box-center { text-align: center; font-weight: 600; }
.box-title { margin: 0 0 8px; font-size: 16px; }
.req-list { margin: 0; padding-left: 20px; display: grid; gap: 2px; }

.redeem { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: #121212; }
.redeem input { flex: 1; border: 0; border-radius: 0; background: transparent; }
.redeem input:focus { box-shadow: none; }
.redeem button { border: 0; border-left: 1px solid var(--border-strong); background: #1d1d1d; padding: 0 18px; font-weight: 600; font-size: 14px; cursor: pointer; }
.redeem button:hover { background: #262626; color: #fff; }
.redeem:focus-within { border-color: var(--accent); }

.upgrade-list { display: grid; gap: 10px; }
.upgrade-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 10px 14px; background: var(--row); border: 1px solid var(--border-strong); border-radius: var(--radius); }
.upgrade-name { display: grid; text-align: right; }
.upgrade-price { color: #a993ff; font-size: 13px; }
.upgrade-actions { display: flex; gap: 8px; }
.upgrade-note { margin: 10px 0 0; }

.settings-form { display: grid; gap: 0; }
.settings-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-of-type { border-bottom: 0; }
.settings-label { text-align: right; font-weight: 600; font-size: 14px; padding-top: 8px; display: flex; justify-content: flex-end; gap: 6px; }
.settings-label .icon { width: 16px; height: 16px; margin-top: 2px; }
.settings-fields { display: grid; gap: 8px; }
.select-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 12px; font-size: 14px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: auto; margin-top: 3px; accent-color: var(--accent); }
.hint { margin: 0; font-size: 12px; color: var(--muted); }
.settings-save { display: flex; justify-content: center; padding-top: 14px; }
.counter { margin-right: auto; align-self: center; }

.people-list { list-style: none; margin: 0; padding: 0; }
.people-list li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.people-list li:last-child { border-bottom: 0; }
.people-list form { margin: 0 0 0 auto; }
.people-list .grow { flex: 1; min-width: 0; }
.excerpt { color: #b5b5b5; font-size: 14px; margin: 3px 0; white-space: pre-wrap; word-break: break-word; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border-strong); margin: -14px 0 26px; }
.tabs a { padding: 8px 12px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: #fff; }
.tabs a.on { color: #fff; border-bottom-color: var(--accent); }

/* Posts: signature, likes, ignored */
.post-signature { margin-top: 16px; padding-top: 10px; border-top: 1px dashed var(--border-strong); color: #9a9a9a; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.post-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.post-foot form { margin: 0; }
.likers { margin-right: auto; font-size: 13px; color: #c9c9c9; display: inline-flex; align-items: center; gap: 5px; }
.likers .icon { color: #ff4d6d; }
.like-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 1px solid transparent; border-radius: var(--radius); padding: 4px 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.like-btn .icon { width: 15px; height: 15px; }
.like-btn:hover { color: #fff; border-color: var(--border-strong); }
.like-btn.on { color: #ff4d6d; }
.like-btn.on .icon { fill: currentColor; }
.post-ignored { background: var(--row); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.post-ignored > summary { padding: 12px 16px; color: var(--muted); cursor: pointer; font-size: 14px; }
.post-ignored[open] > summary { border-bottom: 1px dashed var(--border-strong); }
.post-ignored .post { border: 0; }
.anchor { display: block; position: relative; top: -80px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.profile-actions form { margin: 0; }

@media (max-width: 900px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); }
  .account-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 760px) {
  .account-side { grid-template-columns: minmax(0, 1fr); }
  .settings-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .settings-label { text-align: left; justify-content: flex-start; padding-top: 0; }
  .select-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .upgrade-name { text-align: left; }
}

/* ---------- Highlight text: glowing rainbow sweeping diagonally ----------
   Only for the specially highlighted text (the Updates forum title and the Store tab). */
.c-yellow,
.nav-highlight > .nav-link span {
  background-image: linear-gradient(135deg, #ff1f5a, #ff8a00, #ffe600, #2bff88, #00d4ff, #7a5cff, #ff2bd6, #ff1f5a);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, .28)) drop-shadow(0 0 9px rgba(180, 110, 255, .35));
  animation: rainbow-sweep 1.2s ease-in-out infinite alternate;
}
.c-yellow:hover,
.nav-highlight > .nav-link:hover span {
  filter: brightness(1.25) drop-shadow(0 0 5px rgba(255, 255, 255, .45)) drop-shadow(0 0 12px rgba(180, 110, 255, .5));
}
@keyframes rainbow-sweep {
  from { background-position: 0% 0%; }
  to { background-position: 100% 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .c-yellow, .nav-highlight > .nav-link span { animation: none; }
}

/* License key hint on sign-up */
.auth-hint { margin: -4px 0 0; font-size: 12px; color: var(--muted); }
.auth-hint a { color: var(--accent); font-weight: 600; }
.form label .optional { color: var(--muted); font-weight: 400; }

/* ---------- Restraint pass ---------- */
.avatar { font-weight: 500; color: rgba(255, 255, 255, .92); }
.role-member { background: none; color: var(--muted); padding: 0; letter-spacing: 0; text-transform: none; font-size: 12px; font-weight: 500; }
.thread-title, .latest-title, .side-title { transition: color .12s; }
.thread-title:hover, .latest-title:hover, .side-title:hover { color: var(--accent-hover); }
.panel-title { font-weight: 500; letter-spacing: .04em; font-size: 14px; }
.meta { font-size: 12.5px; }
.post-user .avatar { --size: 60px !important; }
.node { min-height: 64px; }
.footer { color: var(--muted); }
.footer-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.footer-inner > :last-child { justify-self: end; }
.footer a:hover { color: var(--accent-hover); }
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr; justify-items: center; gap: 4px; }
  .footer-inner > :last-child { justify-self: center; }
}

/* ---------- Attachments ---------- */
.attach { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.attach-btn, .form label.attach-btn { position: relative; cursor: pointer; display: inline-flex; gap: 7px; font-weight: 600; }
.attach-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.attach-btn:focus-within { border-color: var(--accent); }
.attach-picked { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 2px; font-size: 13px; color: #c4c4c4; }
.att-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.att-images img { display: block; max-width: 320px; max-height: 240px; border-radius: var(--radius); border: 1px solid var(--border-strong); object-fit: cover; background: #111; }
.att-files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.att-files a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #181818; border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text); max-width: 520px; }
.att-files a:hover { border-color: var(--accent); color: #fff; }
.att-files .icon { color: var(--accent); }
.att-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
@media (max-width: 760px) { .att-images img { max-width: 100%; } }

/* ---------- Pinned threads ---------- */
.pin-badge { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; padding: 1px 7px; border-radius: 3px; background: rgba(255, 106, 0, .14); color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; vertical-align: 3px; }
.pin-badge .icon { width: 11px; height: 11px; }
h1 .pin-badge { vertical-align: 5px; }
.thread-row.pinned { border-color: rgba(255, 106, 0, .35); }
