:root {
  color-scheme: light;
  --bg: #f2f4f5;
  --card: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --hover: #f7f8f9;
  --text: #1f2328;
  --muted: #6a737d;
  --line: #e3e6ea;
  --line-strong: #cfd4da;
  --dark: #393b3d;
  --accent: #00a86b;
  --accent-dark: #008f5a;
  --accent-soft: #e3f6ee;
  --accent-tint: #f3fbf7;
  --danger: #d93f3f;
  --danger-soft: #fdecec;
  --danger-line: #f3c2c2;
  --warn-bg: #fff7e6; --warn-line: #f5d9a3; --warn-text: #7a5300;
  --sys-bg: #eef1f4; --sys-text: #4a5560;
  --thumb-bg: #e9ecef;
  --badge-bg: rgba(255, 255, 255, .94);
  --ph-text: rgba(31, 35, 40, .45);
  --plus: var(--plus); --plus-soft: #f4eeff;
  --cs-scripter: #e8f0fe; --cs-builder: #fdf0e3; --cs-animator: #f3eafb; --cs-gui: #e2f6f8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --c-scripter: #2f6fed;
  --c-builder: #e07b17;
  --c-animator: #9b4dd8;
  --c-gui: #0f9fb0;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121417;
  --card: #1b1e23;
  --surface: #1b1e23;
  --surface-2: #16191d;
  --hover: #242831;
  --text: #e7eaee;
  --muted: #98a1ac;
  --line: #2c3139;
  --line-strong: #3d444e;
  --dark: #d5d9de;
  --accent: #10b979;
  --accent-dark: #2fd193;
  --accent-soft: #123828;
  --accent-tint: #18241f;
  --danger: #f05a5a;
  --danger-soft: #3a1e20;
  --danger-line: #5c2a2d;
  --warn-bg: #352b16; --warn-line: #5a4720; --warn-text: #f0c56a;
  --sys-bg: #252a31; --sys-text: #b8c0ca;
  --thumb-bg: #262a30;
  --badge-bg: rgba(27, 30, 35, .92);
  --ph-text: rgba(255, 255, 255, .55);
  --plus: #a47bff; --plus-soft: #2a2140;
  --cs-scripter: #1b2a4a; --cs-builder: #3b2a18; --cs-animator: #2f2140; --cs-gui: #143439;
  --c-scripter: #79a3ff;
  --c-builder: #f2a65a;
  --c-animator: #c79af0;
  --c-gui: #4fd0de;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
input, select, textarea, button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.ico { width: 18px; height: 18px; flex: none; vertical-align: middle; }

/* ---------- Header ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.topbar-in { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 21px; color: var(--dark); letter-spacing: -.3px; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); }
.brand.small { font-size: 15px; gap: 6px; }
.nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-link { color: var(--text); font-weight: 600; padding: 8px 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; }
.nav-link:hover { background: var(--bg); text-decoration: none; }
.nav-admin { color: var(--danger); }
.lang-sel { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 8px; font-weight: 700; cursor: pointer; }
.burger { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 22px; height: 2px; background: var(--dark); margin: 5px 0; border-radius: 2px; }
.user-menu { position: relative; outline: none; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; font-weight: 700; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 180px; padding: 6px; display: none; }
.user-menu:focus-within .dropdown { display: block; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 7px; color: var(--text); background: none; border: 0; cursor: pointer; font-weight: 600; }
.dropdown a:hover, .dropdown button:hover { background: var(--bg); text-decoration: none; }
.dropdown button { color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 9px 16px; border-radius: 9px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #bf3030; }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger-line); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- Common ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.badge { background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center; }
.avatar { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; border-radius: 50%; flex: none; width: 36px; height: 36px; font-size: 15px; }
.avatar.xs { width: 22px; height: 22px; font-size: 11px; }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.avatar.md { width: 42px; height: 42px; font-size: 18px; }
.avatar.xl { width: 88px; height: 88px; font-size: 38px; }
.uname { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.ulink { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
a.ulink:hover { color: var(--accent-dark); }
.tag-admin { background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .6px; padding: 2px 6px; border-radius: 5px; line-height: 1.4; }
.tag-banned { background: var(--dark); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .4px; padding: 2px 6px; border-radius: 5px; line-height: 1.4; }
.cat { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; margin-right: 4px; }
.cat-scripter { background: var(--cs-scripter); color: var(--c-scripter); }
.cat-builder { background: var(--cs-builder); color: var(--c-builder); }
.cat-animator { background: var(--cs-animator); color: var(--c-animator); }
.cat-gui { background: var(--cs-gui); color: var(--c-gui); }
.price { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--text); white-space: nowrap; }
.price .ico-robux { width: 18px; height: 18px; color: var(--dark); }
.price small { color: var(--muted); font-weight: 600; margin-left: 2px; }
.price.big { font-size: 28px; margin: 4px 0 2px; }
.price.big .ico-robux { width: 30px; height: 30px; }
.price.big small { font-size: 15px; }
.pill { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pill-danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); padding: 10px 14px; border-radius: 10px; margin: 10px 0; }
.notice.danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.back { display: inline-block; margin-bottom: 14px; font-weight: 700; color: var(--muted); }
.page-title { margin-bottom: 18px; }
.section-head { display: flex; align-items: center; gap: 10px; margin: 28px 0 14px; }
.section-head h2 { margin: 0; }
.loading { display: flex; justify-content: center; padding: 60px 0; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-ico { width: 48px; height: 48px; opacity: .25; display: block; margin: 0 auto 10px; }
.empty p { margin: 0 0 12px; }
.grid > .empty, .grid > .error-box { grid-column: 1 / -1; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 700; margin-bottom: 6px; font-size: 14px; }
input[type=text], input:not([type]), input[type=password], input[type=email], input[type=number], input[type=search], textarea, .select {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 168, 107, .15); }
textarea { resize: vertical; min-height: 80px; }
.select { width: auto; cursor: pointer; }
.hint { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 9px 12px; margin: 0 0 14px; font-weight: 600; font-size: 14px; }
.code-input { letter-spacing: 6px; font-size: 20px; text-align: center; font-weight: 800; max-width: 220px; }
.check, .radio { display: flex; align-items: center; gap: 8px; margin: 8px 0; cursor: pointer; }
.check input, .radio input { width: 17px; height: 17px; accent-color: var(--accent); }
.inline-form { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 200px; }
.inline-form .code-input { flex: none; }

/* ---------- Hero / home ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; padding: 32px; align-items: center; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-tint) 100%); }
.hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -.5px; }
.hero p { color: var(--muted); font-size: 16px; margin: 0 0 20px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat-val { font-size: 26px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(0, 168, 107, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(0, 168, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 168, 107, 0); } }
.toolbar { display: flex; gap: 10px; padding: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search { flex: 1; min-width: 200px; }
.search input { background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236a737d' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; padding-left: 38px; border-color: transparent; }
.search input:focus { background-color: var(--surface); }
.seg { display: inline-flex; background: var(--bg); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 7px; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg-wide { margin-bottom: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 15px; font-weight: 700; cursor: pointer; }
.chip:hover { border-color: var(--line-strong); }
.chip.active { background: var(--dark); border-color: var(--dark); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.grid-users { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.more-wrap { text-align: center; margin-top: 20px; }

/* listing card */
.lcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; color: var(--text); box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s, border-color .12s; overflow: hidden; }
.lcard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lcard:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.lcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.lcard h3 { font-size: 17px; margin: 2px 0 0; overflow-wrap: anywhere; }
.desc { color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; flex: 1; }
.lcard-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.seller { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 14px; }
.lwrap { display: flex; flex-direction: column; gap: 6px; }
.lactions { display: flex; gap: 6px; }

/* user card */
.ucard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; align-items: flex-start; color: var(--text); box-shadow: var(--shadow); }
.ucard:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
.ucard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ucard-side { text-align: center; display: flex; flex-direction: column; font-size: 18px; }
.roles { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- Auth ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 30px 0; }
.auth { width: 100%; max-width: 410px; padding: 30px; }
.auth h2 { text-align: center; margin-bottom: 20px; }
.auth-logo { width: 44px; height: 44px; display: block; margin: 0 auto 12px; }
.auth .muted.center { margin: 14px 0 0; }
.shield { font-size: 46px; margin-bottom: 6px; }
.auth .btn-block + .btn-block { margin-top: 8px; }
.ban-card { max-width: 460px; padding: 34px; text-align: center; }
.ban-ico { font-size: 52px; }

/* ---------- Listing page ---------- */
.listing-layout { display: grid; grid-template-columns: 1fr 330px; gap: 18px; align-items: start; }
.listing-main { padding: 26px; }
.listing-title { font-size: 28px; margin-top: 12px; overflow-wrap: anywhere; }
.listing-desc { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; }
.listing-side .card { padding: 20px; position: sticky; top: 80px; }
.side-sep { height: 1px; background: var(--line); margin: 14px 0; }
.seller-box { display: flex; gap: 10px; align-items: center; color: var(--text); padding: 8px; margin: -8px; border-radius: 10px; }
.seller-box:hover { background: var(--bg); text-decoration: none; }
.side-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }

/* ---------- Editor ---------- */
.editor { padding: 26px; max-width: 820px; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.editor-head h2 { margin: 0; }
.radio-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rcard { border: 2px solid var(--line); border-radius: 11px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; position: relative; transition: border-color .15s, background .15s; }
.rcard input { position: absolute; opacity: 0; pointer-events: none; }
.rcard small { color: var(--muted); font-size: 12.5px; }
.rcard:hover { border-color: var(--line-strong); }
.rcard-scripter:has(input:checked) { border-color: var(--c-scripter); background: var(--cs-scripter); }
.rcard-builder:has(input:checked) { border-color: var(--c-builder); background: var(--cs-builder); }
.rcard-animator:has(input:checked) { border-color: var(--c-animator); background: var(--cs-animator); }
.rcard-gui:has(input:checked) { border-color: var(--c-gui); background: var(--cs-gui); }
.rcard:has(input:checked)::after { content: '✓'; position: absolute; top: 8px; right: 10px; font-weight: 800; color: var(--accent); }
.radio-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.rpill input { position: absolute; opacity: 0; pointer-events: none; }
.rpill span { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-weight: 700; cursor: pointer; background: var(--surface); }
.rpill input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.rpill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 168, 107, .25); }

.editor-actions { display: flex; justify-content: flex-end; }

/* ---------- Profile ---------- */
.profile-head { display: flex; gap: 22px; padding: 26px; align-items: flex-start; }
.profile-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.profile-info h1 { margin: 0; font-size: 26px; }
.profile-info h1 .ulink { font-size: 26px; }
.bio { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Settings ---------- */
.settings-block { padding: 24px; margin-bottom: 16px; max-width: 820px; }
.settings-block h2 { font-size: 19px; margin-bottom: 14px; }
.status { font-weight: 800; }
.status.on { color: var(--accent); }
.status.off { color: var(--muted); }

/* ---------- Modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 24, 28, .55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 480px; padding: 24px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); }
.modal.wide { max-width: 900px; }
.modal h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.confirm-text { font-size: 16px; margin: 0; }
.chatlink { background: var(--bg); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; font-size: 13px; }
.lightbox { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; border-radius: 8px; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--dark); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 600; max-width: 340px; transition: opacity .4s, transform .4s; border-left: 4px solid var(--accent); }
.toast.err { border-left-color: var(--danger); }
.toast.hide { opacity: 0; transform: translateY(8px); }

/* ---------- Chats ---------- */
.chat-layout { display: grid; grid-template-columns: 320px 1fr; gap: 14px; height: calc(100vh - 62px - 48px - 70px); min-height: 480px; }
.chat-list { overflow: hidden; display: flex; flex-direction: column; }
.chat-list-head { padding: 14px 16px; font-weight: 800; font-size: 17px; border-bottom: 1px solid var(--line); }
#chat-list-body { overflow-y: auto; flex: 1; }
.chat-list-empty { padding: 20px; font-size: 14px; }
.chat-item { display: flex; gap: 10px; padding: 12px 14px; align-items: center; color: var(--text); border-bottom: 1px solid var(--line); }
.chat-item:hover { background: var(--hover); text-decoration: none; }
.chat-item.active { background: var(--accent-soft); }
.ci-main { flex: 1; min-width: 0; }
.ci-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.ci-last { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-panel { display: flex; flex-direction: column; overflow: hidden; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); }
.chat-empty img { width: 56px; opacity: .2; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.back-btn { display: none; font-size: 20px; color: var(--text); padding: 0 6px; }
.ch-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-info a:hover { text-decoration: none; }
.ch-listing { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-actions { display: flex; gap: 6px; }
.admin-banner { background: var(--warn-bg); color: var(--warn-text); padding: 8px 16px; font-size: 13.5px; font-weight: 600; border-bottom: 1px solid var(--warn-line); }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.msgs-empty { margin: auto; }
.msg { display: flex; }
.msg.me { justify-content: flex-end; }
.bubble { max-width: min(75%, 520px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 7px 11px; box-shadow: var(--shadow); }
.msg.me .bubble { background: var(--accent); border-color: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg-author { font-size: 12.5px; margin-bottom: 2px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-img { display: block; max-width: 100%; max-height: 300px; border-radius: 9px; margin: 3px 0; cursor: zoom-in; }
.msg-time { font-size: 11px; opacity: .65; text-align: right; margin-top: 1px; }
.composer { border-top: 1px solid var(--line); padding: 10px 12px; background: var(--surface); }
.composer-row { display: flex; gap: 8px; align-items: center; }
.composer-row input { flex: 1; }
.attach { display: inline-flex; padding: 9px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.attach:hover { background: var(--bg); color: var(--text); }
.attach .ico { width: 22px; height: 22px; }
.send-btn { padding: 10px 14px; }
.img-preview { position: relative; display: inline-block; margin-bottom: 8px; }
.img-preview img { max-height: 110px; border-radius: 9px; border: 1px solid var(--line); display: block; }
.img-preview .x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--dark); color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.composer-blocked { padding: 14px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- Admin ---------- */
.report { padding: 16px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.report-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.report-users { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-details { background: var(--bg); border-radius: 8px; padding: 9px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.report-links { display: flex; flex-direction: column; gap: 3px; font-size: 14px; overflow-wrap: anywhere; }
.report-actions { display: flex; gap: 8px; }
.admin-user { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 8px; }
.au-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--card); padding: 18px 0; font-size: 13px; }
.footer-in { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding: 22px; }
  .listing-layout { grid-template-columns: 1fr; }
  .listing-side .card { position: static; }
  .radio-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--card); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px 16px; gap: 6px; box-shadow: var(--shadow-lg); }
  body.menu-open .nav { display: flex; }
  .nav .btn { width: 100%; }
  .user-menu .dropdown { position: static; display: block; box-shadow: none; border: 0; padding: 4px 0 0; }
  .user-btn { width: 100%; }
  .lang-sel { align-self: flex-start; }
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 62px - 40px); }
  .chat-layout.has-active .chat-list { display: none; }
  .chat-layout:not(.has-active) .chat-panel { display: none; }
  .back-btn { display: inline-block; }
  .ch-actions .btn span { display: none; }
  main.wrap { padding-top: 16px; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 25px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-val { font-size: 21px; }
  .profile-head { flex-direction: column; align-items: center; text-align: center; }
  .profile-info { align-items: center; }
  .profile-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .grid, .grid-users { grid-template-columns: 1fr; }
  .toolbar .select { width: 100%; }
  .bubble { max-width: 88%; }
  .editor, .listing-main, .settings-block { padding: 18px; }
}

/* ===== v2: thumbnails, payment methods, filters, applications ===== */
.ico-rplus { color: var(--plus); }
.price-plus .ico-rplus { color: var(--plus); }
.lcard-thumb, .listing-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--thumb-bg); overflow: hidden; }
.lcard-thumb img:not(.ph-logo) { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.lcard:hover .lcard-thumb img:not(.ph-logo) { transform: scale(1.04); }
.thumb-ph { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; }
.thumb-scripter { background: linear-gradient(135deg, #dfe9ff, #b9cdfb); }
.thumb-builder { background: linear-gradient(135deg, #ffe9d2, #f9c995); }
.thumb-animator { background: linear-gradient(135deg, #f0e2fb, #d6b6f1); }
.thumb-gui { background: linear-gradient(135deg, #d8f4f7, #a5dee6); }
.ph-logo { width: 42px; height: 42px; opacity: .35; }
.ph-label { font-weight: 800; color: var(--ph-text); font-size: 13px; letter-spacing: .5px; text-transform: uppercase; }
.method-badge { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; background: var(--badge-bg); border-radius: 999px; padding: 3px 9px 3px 5px; font-size: 12px; font-weight: 800; box-shadow: var(--shadow); }
.method-badge .ico { width: 16px; height: 16px; }
.method-gp { color: var(--dark); }
.method-plus { color: var(--plus); }

.filters { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; padding: 10px 14px; margin-bottom: 16px; }
.f-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.f-label { font-weight: 800; font-size: 13px; color: var(--muted); }
.f-range { display: flex; align-items: center; gap: 8px; }
.mini-input { position: relative; width: 130px; }
.mini-input .ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.mini-input input { padding: 7px 10px 7px 31px; font-weight: 700; }
.seg button .ico { width: 15px; height: 15px; margin-right: 4px; vertical-align: -3px; }
#freset { margin-left: auto; }

.listing-main { padding: 0; overflow: hidden; }
.listing-thumb { cursor: zoom-in; }
.listing-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-content { padding: 26px; }
.method-line { font-size: 14px; margin: 8px 0 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.method-line b { display: inline-flex; align-items: center; gap: 4px; }
.gp-link { margin-top: 10px; }
.gp-link .ico { color: var(--dark); }

/* editor */
.thumb-picker { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tp-preview { width: 240px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 2px dashed var(--line); cursor: pointer; background: var(--bg); transition: border-color .15s; }
.tp-preview:hover { border-color: var(--accent); }
.tp-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-weight: 700; font-size: 13px; }
.tp-empty .ico { width: 28px; height: 28px; }
.tp-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; max-width: 300px; }
.method-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mcard { border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; cursor: pointer; position: relative; transition: border-color .15s, background .15s, transform .1s; }
.mcard:hover { border-color: var(--line-strong); }
.mcard input { position: absolute; opacity: 0; pointer-events: none; }
.mcard small { display: block; color: var(--muted); font-size: 12.5px; }
.mcard-ico .ico { width: 34px; height: 34px; }
.mcard-gamepass .mcard-ico { color: var(--dark); }
.mcard-gamepass:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mcard-plus:has(input:checked) { border-color: var(--plus); background: var(--plus-soft); }
.mcard:has(input:checked) { transform: translateY(-1px); }
input.invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(217, 63, 63, .12) !important; }
input.valid { border-color: var(--accent); }
.hint-bad { color: var(--danger) !important; font-weight: 700; }

.price-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.price-input { position: relative; width: 220px; transition: transform .15s; }
.pi-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); display: flex; color: var(--dark); }
.pi-ico .ico { width: 22px; height: 22px; }
.price-input input { padding-left: 42px; font-weight: 800; font-size: 18px; letter-spacing: .3px; }
.price-input.invalid input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(217, 63, 63, .12); }
.price-live { display: inline-flex; align-items: baseline; gap: 6px; font-size: 30px; font-weight: 800; color: var(--accent-dark); transition: color .2s; min-width: 120px; }
.price-live .pl-ico { align-self: center; display: flex; color: var(--dark); }
.price-live .pl-ico .ico { width: 30px; height: 30px; }
.price-live small { font-size: 14px; color: var(--muted); font-weight: 700; }
.price-live.invalid { color: var(--danger); }
.price-meter { height: 6px; border-radius: 6px; background: var(--bg); margin-top: 10px; overflow: hidden; max-width: 480px; }
.pm-fill { height: 100%; width: 0; background: linear-gradient(90deg, #34c98a, var(--accent)); border-radius: 6px; transition: width .35s cubic-bezier(.2, .8, .2, 1), background .2s; }
.pm-fill.over { background: var(--danger); }
.pop { animation: pop .28s ease; }
.shake { animation: shake .35s ease; }
.spin-in { animation: spin-in .45s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes spin-in { from { transform: rotate(-180deg) scale(.4); opacity: 0; } to { transform: rotate(0) scale(1); opacity: 1; } }

/* apply modal */
.apply-listing { display: flex; gap: 12px; align-items: center; background: var(--bg); border-radius: 10px; padding: 10px; margin-bottom: 16px; }
.apply-listing > img, .apply-ph { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center; }
.apply-ph img { width: 24px; opacity: .4; }
.count-bad { color: var(--danger); font-weight: 800; }
.count-ok { color: var(--accent); font-weight: 800; }

/* application cards in chat */
.apps { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 10px; max-height: 45%; overflow-y: auto; }
.app-card { border: 2px solid var(--accent); border-radius: 12px; background: linear-gradient(180deg, var(--accent-tint), var(--surface)); overflow: hidden; animation: app-in .35s ease; transition: opacity .3s, transform .3s; }
.app-card.app-out { opacity: 0; transform: scale(.96); }
@keyframes app-in { from { opacity: 0; transform: translateY(-8px); } }
.app-top { display: flex; gap: 12px; padding: 12px; align-items: center; }
.app-thumb { width: 110px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; flex: none; }
span.app-thumb img { width: 26px; opacity: .4; }
.app-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-label { font-size: 12px; font-weight: 800; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .4px; }
.app-title { font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-body { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.app-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.app-nick { font-family: ui-monospace, Consolas, monospace; background: var(--bg); padding: 1px 6px; border-radius: 5px; }
.app-comment { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.app-actions { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.app-actions .btn { flex: 1; }
.app-wait { padding: 9px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; background: var(--surface); }
.msg-sys { align-self: center; text-align: center; background: var(--sys-bg); color: var(--sys-text); border-radius: 999px; padding: 5px 14px; font-size: 13px; margin: 6px 0; max-width: 90%; display: flex; gap: 8px; align-items: baseline; }
.msg-sys small { opacity: .6; font-size: 11px; }
.msg-sys.sys-accepted { background: var(--accent-soft); color: var(--accent-dark); }
.msg-sys.sys-declined { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 560px) {
  .method-cards { grid-template-columns: 1fr; }
  .tp-preview { width: 100%; }
  .filters { flex-direction: column; align-items: stretch; }
  .mini-input { width: 100%; }
  .f-range { width: 100%; }
  #freset { margin-left: 0; }
  .app-thumb { width: 80px; }
}

/* ===== v3: theme, avatars, presence ===== */
body { transition: background .2s, color .2s; }
:root[data-theme="dark"] .thumb-ph { filter: brightness(.55) saturate(.9); }
:root[data-theme="dark"] .ph-logo, :root[data-theme="dark"] .empty-ico, :root[data-theme="dark"] .chat-empty img,
:root[data-theme="dark"] .auth-logo, :root[data-theme="dark"] .brand img, :root[data-theme="dark"] .apply-ph img, :root[data-theme="dark"] span.app-thumb img { filter: invert(1); }
:root[data-theme="dark"] .msg.me .bubble { color: #fff; }
:root[data-theme="dark"] .chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .toast { background: #2b3038; }
:root[data-theme="dark"] .tag-banned { background: #555c66; }
.theme-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 36px; height: 34px; cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; transition: transform .25s; }
.theme-btn:hover { transform: rotate(20deg); }

.av { position: relative; display: inline-flex; flex: none; }
.av > .avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdot { position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 8px; min-height: 8px; max-width: 18px; max-height: 18px; border-radius: 50%; background: #9aa3ad; border: 2px solid var(--surface); box-sizing: border-box; transition: background .3s; }
.pdot.on { background: #22c55e; }
.av-xl .pdot { border-width: 3px; right: 3px; bottom: 3px; }
.online-label { font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.online-label.on { color: #16a34a; }
.online-label.off { color: var(--muted); }
:root[data-theme="dark"] .online-label.on { color: #4ade80; }

.avatar-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar-edit .avatar.xl { cursor: pointer; }
.avatar-edit-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.apply-gp-ok { color: var(--accent-dark); font-weight: 700; }
.app-link { font-family: ui-monospace, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
:root[data-theme="dark"] .img-preview .x { background: #3a404a; }

/* ===== v4: Roblox username / gamepass check ===== */
.rbx-check { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); margin: -6px 0 16px; font-size: 14px; animation: fade .2s; }
.rbx-check.ok { border-color: var(--accent); background: var(--accent-tint); }
.rbx-check.bad { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.rbx-check.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-text); }
.rbx-check.loading { color: var(--muted); }
.rbx-check .btn { margin-left: auto; }
.rc-ico { font-size: 16px; }
.rc-img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--thumb-bg); flex: none; }
.rc-img.round { border-radius: 50%; }
.rc-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.rc-status { font-size: 13px; font-weight: 800; }
.rc-status.ok { color: var(--accent-dark); }
.rc-status.bad { color: var(--danger); }
.rc-status.warn { color: var(--warn-text); }
.rc-price { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.rc-price .ico { width: 16px; height: 16px; color: var(--dark); }
.rc-verified { color: #3b82f6; font-size: 12px; }
.spinner.sm { width: 18px; height: 18px; border-width: 2px; }
.app-rbx { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 2px 0; }
.app-rbx .rc-img { width: 44px; height: 44px; }

/* ===== v4.1: compact application card (fits at 100% zoom) ===== */
.apps { max-height: 70%; padding: 10px 14px; flex: none; }
.messages { min-height: 120px; }
.app-top { padding: 10px 12px 8px; gap: 10px; }
.app-thumb { width: 84px; }
.app-title { font-size: 15px; }
.app-body { padding: 0 12px 10px; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.app-body > .app-row { flex: none; }
.app-body > .app-rbx { flex: 1 1 280px; margin: 0; padding: 6px 10px; }
.app-rbx .rc-img { width: 34px; height: 34px; }
.app-rbx .rc-main { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.app-rbx .app-nick { font-size: 14px; }
.app-rbx .app-link { flex-basis: 100%; }
.app-comment { flex-basis: 100%; margin-top: 0; padding: 6px 10px; max-height: 84px; overflow-y: auto; }
.app-actions { padding: 8px 12px; }
.app-actions .btn { padding: 7px 12px; }
.app-wait { padding: 7px 12px; }
@media (max-height: 760px) {
  .app-thumb { width: 64px; }
  .app-comment { max-height: 56px; }
}
.chat-panel > .chat-head, .chat-panel > .admin-banner, .chat-panel > .composer, .chat-panel > .composer-blocked { flex: none; }
.chat-panel > .messages { flex: 1 1 auto; }

/* ===== v5: roles & badges ===== */
.badge-ico { width: 16px; height: 16px; flex: none; vertical-align: middle; }
.badge-admin { color: var(--text); }
.tag-mod { background: #2f6fed; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .5px; padding: 2px 6px; border-radius: 5px; line-height: 1.4; }
.tag-vip { background: linear-gradient(135deg, #ffd43b, #f5b301); color: #3d2c00; font-size: 10px; font-weight: 900; letter-spacing: .6px; padding: 2px 6px; border-radius: 5px; line-height: 1.4; box-shadow: 0 0 0 1px rgba(160, 110, 0, .25) inset; }
.uname { gap: 5px; }
.profile-info h1 .badge-ico { width: 22px; height: 22px; }
.roles-preview { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 14px; font-size: 16px; }
.role-seg button { display: inline-flex; align-items: center; }
.check .badge-ico { width: 18px; height: 18px; }

/* ===== v6: Google sign-in ===== */
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; gap: 10px; }
.btn-google:hover { background: #f8f9fa; border-color: #c6c9ce; }
:root[data-theme="dark"] .btn-google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
:root[data-theme="dark"] .btn-google:hover { background: #1f1f20; }
.g-logo { width: 20px; height: 20px; flex: none; }
.or-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.g-linked { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 16px; text-align: left; }
.g-linked .g-logo { width: 26px; height: 26px; }
.g-linked b { overflow-wrap: anywhere; }
.g-ok { margin-left: auto; color: var(--accent-dark); font-weight: 900; font-size: 18px; }
.steps-mini { text-align: left; color: var(--muted); font-size: 14px; padding-left: 20px; margin: 16px 0 4px; }
.steps-mini li { margin: 4px 0; }
.auth.center .btn-google { margin-top: 6px; }
