
:root {
  --bg: #09090b; --s1: #111113; --s2: #16161a; --s3: #1c1c21;
  --line: #232328; --line-2: #2e2e35;
  --text: #f4f4f5; --text-2: #c9c9d1; --muted: #85858f;
  --accent: #8b5cf6; --accent-h: #7c3aed; --accent-soft: rgba(139, 92, 246, .12); --accent-text: #b39dfc;
  --good: #22c55e; --bad: #ef4444; --warn: #f5a524;
  --r: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent-text); }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 14px; font-weight: 600; margin: 0; }
h3 { font-size: 14px; font-weight: 600; margin: 0; }
p { margin: 4px 0 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.i { flex-shrink: 0; vertical-align: middle; }
code { font: 12.5px ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--s3);
  border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
pre { background: #0c0c0f; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 8px 0; }
pre code { border: 0; padding: 0; background: none; }
.post-body a, .online a { color: var(--accent-text); }

/* ---------- header ---------- */
.hdr { position: sticky; top: 0; z-index: 10; background: rgba(9, 9, 11, .8);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.hdr-in { max-width: 1240px; margin: 0 auto; height: 60px; padding: 0 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.hdr-nav { display: flex; gap: 2px; }
.hdr-nav a { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.hdr-nav a:hover { color: var(--text); background: var(--s2); }
.hdr-nav a.on { color: var(--text); background: var(--s3); }
.hdr-search { position: relative; flex: 1; max-width: 300px; margin-left: auto; }
.hdr-search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.hdr-search input { padding-left: 34px; height: 36px; background: var(--s1); }
.hdr-user { display: flex; align-items: center; gap: 8px; }
.hdr-me { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; font-weight: 600; }
.hdr-me:hover { background: var(--s2); color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--s1); color: var(--text-2); font-size: 13px; }
.chip b { color: var(--text); }
.chip:hover, .chip.on { border-color: var(--line-2); color: var(--text); }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--s1); color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- page frame ---------- */
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 24px 56px; flex: 1; }
.wrap.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.ftr { border-top: 1px solid var(--line); }
.ftr-in { max-width: 1240px; margin: 0 auto; padding: 20px 24px; display: flex; justify-content: space-between; font-size: 13px; }

/* ---------- cards & rows ---------- */
.panel { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pad { padding: 18px 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 20px;
  border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { display: flex; align-items: center; gap: 8px; }
.panel-head a { color: var(--muted); font-size: 12.5px; }
.panel-head a:hover { color: var(--text); }
.count { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--s3); padding: 0 7px; border-radius: 999px; }
.section-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.row { display: grid; grid-template-columns: auto minmax(0, 1fr) 140px 210px; gap: 16px; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--line); transition: background .12s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--s2); }
.row > .row-main:first-child { grid-column: 1 / -1; }
.row.tx { grid-template-columns: 1fr auto; }
.row.tx > .row-main:first-child { grid-column: auto; }
.row-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); }
.row-title { font-weight: 600; color: var(--text); }
.row-title:hover { color: var(--accent-text); }
.row-main .muted { margin-top: 1px; }
.row-stats { display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; }
.row-stats span { display: inline-flex; align-items: center; gap: 5px; }
.row-stats b { color: var(--text-2); font-weight: 600; }
.row-last { min-width: 0; font-size: 12.5px; }
.row-last a.clip { font-weight: 500; font-size: 13px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head p { color: var(--muted); }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--line-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2.tight { gap: 12px; }

/* hero */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px;
  border: 1px solid var(--line); border-radius: 14px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(139, 92, 246, .16), transparent 55%), var(--s1); }
.hero h1 { font-size: 24px; }
.hero p { color: var(--text-2); }
.hero-actions { display: flex; gap: 8px; }

/* ---------- avatars, names, badges ---------- */
.av { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 600; flex-shrink: 0;
  background: hsl(var(--h) 35% 22%); color: hsl(var(--h) 70% 78%); }
.av-xs { width: 22px; height: 22px; font-size: 11px; }
.av-sm { width: 28px; height: 28px; font-size: 12px; }
.av-md { width: 38px; height: 38px; font-size: 15px; }
.av-lg { width: 60px; height: 60px; font-size: 22px; }
.av-xl { width: 76px; height: 76px; font-size: 28px; }
.uname { font-weight: 600; color: var(--text); }
.uname.role-admin { color: #f87171; }
.uname.role-mod { color: #4ade80; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 1px 7px;
  border-radius: 6px; margin-right: 6px; vertical-align: 2px; background: var(--s3); color: var(--text-2); }
.badge.pin { background: rgba(245, 165, 36, .12); color: var(--warn); }
.badge.lock { background: rgba(239, 68, 68, .12); color: #f87171; }
.role-bg-admin { background: rgba(239, 68, 68, .12); color: #f87171; }
.role-bg-mod { background: rgba(34, 197, 94, .12); color: #4ade80; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px;
  vertical-align: 1px; background: var(--s3); color: var(--text-2); }
.tag-cs2 { background: rgba(249, 115, 22, .13); color: #fb923c; }
.tag-configs { background: rgba(139, 92, 246, .14); color: #b39dfc; }
.tag-scripts { background: rgba(6, 182, 212, .13); color: #22d3ee; }
.tag-software { background: rgba(59, 130, 246, .14); color: #60a5fa; }
.tag-services { background: rgba(34, 197, 94, .13); color: #4ade80; }
.tag-other { background: rgba(161, 161, 170, .13); color: #a1a1aa; }
.stars { display: inline-flex; gap: 1px; color: #3a3a42; vertical-align: -2px; }
.stars .on { color: var(--warn); }
.stars .on svg { fill: currentColor; }
.price { color: var(--text); font-weight: 600; white-space: nowrap; }
.big-price { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }

/* ---------- forms & buttons ---------- */
input, textarea, select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; font: inherit; transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: #5f5f69; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13px; color: var(--text-2); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; border: 1px solid transparent; cursor: pointer;
  height: 38px; padding: 0 16px; border-radius: 8px; font: inherit; font-weight: 600; color: #fff; white-space: nowrap;
  background: var(--accent); transition: background .12s; }
.btn:hover { background: var(--accent-h); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; background: var(--accent); }
.btn.ghost { background: var(--s1); border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--s2); border-color: var(--line-2); }
.btn.danger { background: transparent; border-color: rgba(239, 68, 68, .35); color: #f87171; }
.btn.danger:hover { background: rgba(239, 68, 68, .1); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.full { width: 100%; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--muted);
  cursor: pointer; font: inherit; font-size: 12.5px; padding: 0; }
.link-btn:hover { color: #f87171; }
form.inline { display: inline; }
.alert { background: rgba(239, 68, 68, .08); border: 1px solid rgba(239, 68, 68, .3); color: #fca5a5;
  padding: 10px 14px; border-radius: 8px; font-size: 13.5px; }
.alert.ok { background: rgba(34, 197, 94, .08); border-color: rgba(34, 197, 94, .3); color: #86efac; }
.mod-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hint { font-size: 12.5px; color: var(--muted); }

/* ---------- tabs, chips, pager ---------- */
.tabs { display: flex; gap: 2px; background: var(--s1); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.tabs a { padding: 5px 12px; border-radius: 6px; color: var(--muted); font-weight: 500; font-size: 13px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--s3); color: var(--text); }
.filters { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--line); background: var(--s1); }
.fchip:hover { color: var(--text); border-color: var(--line-2); }
.fchip.on { color: var(--text); background: var(--s3); border-color: var(--line-2); }
.pager { display: flex; gap: 4px; align-items: center; }
.pager a { min-width: 34px; height: 34px; display: grid; place-items: center; padding: 0 8px; border-radius: 8px;
  background: var(--s1); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; }
.pager a:hover { border-color: var(--line-2); color: var(--text); }
.pager a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- shoutbox ---------- */
.shout-feed { height: 230px; overflow-y: auto; padding: 6px 0; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.shout { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 5px 20px; }
.shout:hover { background: var(--s2); }
.shout-body { min-width: 0; overflow-wrap: anywhere; color: var(--text-2); }
.shout-body .uname { margin-right: 4px; }
.shout-body a:not(.uname) { color: var(--accent-text); }
.shout time { padding-top: 2px; }
.shout-form { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ---------- threads & posts ---------- */
.post { display: grid; grid-template-columns: 180px 1fr; }
.post-user { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 20px 12px; border-right: 1px solid var(--line); background: var(--s2); }
.post-meta { margin-top: 6px; display: grid; gap: 2px; width: 100%; }
.post-meta div { display: flex; justify-content: space-between; padding: 0 8px; }
.post-meta b { color: var(--text-2); font-weight: 500; }
.post-main { padding: 16px 22px 20px; min-width: 0; }
.post-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.post-head a { color: var(--muted); }
.post-body { overflow-wrap: anywhere; color: var(--text-2); line-height: 1.65; }
.post-body strong { color: var(--text); }

/* ---------- aside widgets ---------- */
.online { padding: 14px 20px; line-height: 1.9; font-size: 13.5px; }
.mini-listing { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 11px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mini-listing:last-child { border-bottom: 0; }
.mini-listing:hover { background: var(--s2); color: var(--text); }
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; }
.stats > div { padding: 16px 8px; display: flex; flex-direction: column; gap: 2px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats b { font-size: 18px; font-weight: 700; }
.newest { padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; display: flex; justify-content: space-between; }

/* ---------- market ---------- */
.listing .row-icon { background: var(--s3); color: var(--text-2); }
.listing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.listing-layout > div { display: flex; flex-direction: column; gap: 16px; }
.buy-box { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 84px; }
.kv { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.kv span:first-child { color: var(--muted); }
.seller { display: flex; gap: 10px; align-items: center; }
.delivery { border-color: rgba(34, 197, 94, .3); }
.delivery .panel-head { color: #4ade80; border-color: rgba(34, 197, 94, .2); background: rgba(34, 197, 94, .05); }
.star-pick { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-pick input { display: none; }
.star-pick label { color: #3a3a42; cursor: pointer; }
.star-pick label svg { fill: currentColor; }
.star-pick input:checked ~ label, .star-pick label:hover, .star-pick label:hover ~ label { color: var(--warn); }
.rate-form { flex-direction: row; align-items: center; border-bottom: 1px solid var(--line); }
.rate-form input[name=comment] { flex: 1; }

/* ---------- profile, wallet, auth ---------- */
.profile-head { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 24px; }
.profile-head h1 { display: flex; align-items: center; gap: 8px; }
.profile-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line);
  margin: 4px -24px -24px; }
.profile-stats > div { display: flex; flex-direction: column; padding: 14px 24px; }
.profile-stats > div + div { border-left: 1px solid var(--line); }
.profile-stats b { font-size: 16px; }
.wallet-card .big { font-size: 34px; font-weight: 700; letter-spacing: -.03em; margin: 2px 0 16px; }
.pos { color: #4ade80; } .neg { color: #f87171; }
.auth { width: 100%; max-width: 400px; margin: 40px auto; padding: 28px; }
.auth h1 { margin-bottom: 4px; }
.auth .stack { margin-top: 20px; }
.auth .foot { margin-top: 16px; text-align: center; }
.auth .foot a { color: var(--accent-text); }

@media (max-width: 1150px) {
  .wrap.with-aside { grid-template-columns: 1fr; }
  .aside { position: static; }
  .row { grid-template-columns: auto minmax(0, 1fr) 190px; }
  .row-stats { display: none; }
}
@media (max-width: 900px) {
  .hdr-search, .hdr-me span { display: none; }
  .listing-layout { grid-template-columns: 1fr; }
  .buy-box { position: static; }
}
@media (max-width: 680px) {
  .hdr-in { padding: 0 14px; gap: 10px; }
  .hdr-nav a { padding: 7px 9px; }
  .hdr-nav a .i { display: none; }
  .hdr-user .btn, .chip { display: none; }
  .wrap { padding: 18px 14px 40px; }
  .row { grid-template-columns: auto minmax(0, 1fr); }
  .row-last { display: none; }
  .grid-2, .post { grid-template-columns: 1fr; }
  .post-user { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); text-align: left; }
  .post-meta { display: none; }
  .hero { flex-direction: column; align-items: flex-start; }
  .profile-stats { grid-template-columns: repeat(3, 1fr); }
}
