:root {
  --bg: #000;
  --panel: #181818;
  --side: #101010;
  --line: #333;
  --text: #f3f3f3;
  --muted: #aaa;
  --link: #00a8ff;
  --topbar: 46px;
  --drawer: 340px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
button, .wide, .pill { border: 1px solid #444; background: #202020; color: #fff; padding: 7px 13px; cursor: pointer; }
input, textarea, select { border: 1px solid #333; background: #252525; color: #eee; padding: 8px; }
textarea { min-height: 260px; resize: vertical; }

.topbar { border-bottom: 1px solid #202020; background: #000; }
.nav { width: min(1200px, calc(100% - 28px)); height: 45px; margin: 0 auto; display: flex; gap: 20px; align-items: center; }
.nav a, .nav button { color: #999; background: transparent; border: 0; padding: 0; }
.nav a:hover, .nav .brand, .nav .account { color: #fff; text-decoration: none; }
.brand { font-size: 21px; }
.spacer { flex: 1; }
.page { width: min(1200px, calc(100% - 28px)); margin: 0 auto; padding: 20px 0 60px; }

.center { width: min(760px, 100%); margin: 10px auto 22px; text-align: center; }
.logo { color: #fff; font-family: Consolas, "Courier New", monospace; font-weight: 400; line-height: 1.05; }
.logo-link { display: block; text-decoration: none; cursor: pointer; }
.logo-link:hover .logo { color: #ff3b3b; }
.home-logo-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.home-logo { width: min(240px, 70vw); height: auto; display: block; margin: 0 auto 12px; position: relative; left: 5px; }
.telegram-link { display: block; color: var(--link); font-size: 22px; font-weight: 700; margin: 6px 0 16px; text-decoration: underline; }
.paste-title { color: #fff; }
.paste-title:hover { text-decoration: underline; }
.label { color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.search { display: grid; gap: 8px; justify-items: center; }
.search input[name="q"] { width: 240px; }
.muted { color: var(--muted); }
.error { color: #ff6161; }
.ok { color: #4caf50; }
.small.ok { background: #153a1e; border-color: #2e6b35; color: #7ce78c; }
button.small { padding: 3px 8px; font-size: 12px; }
.pill-btn { border-radius: 0; }
.profile-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.follower-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #2a2a2a; }
.follow-counts a { color: inherit; text-decoration: none; }
.follow-counts a:hover { text-decoration: underline; }
.square { display: inline-block; border: 1px solid #444; background: #202020; color: #fff; padding: 7px 13px; text-decoration: none; }
.follow-banner.black { background: #000; border: 1px solid #333; padding: 12px 16px; margin-bottom: 14px; }
.follow-banner h1 { margin: 0; font-size: 19px; font-weight: 400; }
.follow-banner b { font-weight: 600; }
.square-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.follow-list { display: flex; flex-direction: column; gap: 10px; padding: 12px; max-width: 560px; margin: 0 auto; }
.follow-list h1 { margin: 0; }
.admin-search { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.admin-search .search { min-width: 260px; flex: 1; justify-items: stretch; }
.admin-control { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.admin-table td { padding: 9px 10px; vertical-align: middle; }
.follower-actions form { display: flex; gap: 4px; }
.empty { color: var(--muted); text-align: center; padding: 28px 0; }
.small { font-size: 12px; }

.pager { display: inline-flex; border: 1px solid #777; }
.pager a, .pager span { color: #fff; min-width: 31px; height: 24px; display: grid; place-items: center; border-right: 1px solid #777; }
.pager a:last-child { border-right: 0; }
.pager .active { background: #1b1b1b; }

.section { margin: 22px 0; }
.section h2 { margin: 0 0 10px; font-size: 20px; font-weight: 400; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; font-weight: 400; }
.table th { background: var(--panel); font-weight: 400; }
.table tr { background: #151515; }
.table tr:nth-child(even) { background: #101010; }
.table td:nth-child(2), .table td:nth-child(3), .table th:nth-child(2), .table th:nth-child(3) { text-align: center; width: 110px; }
.table td:last-child, .table th:last-child { text-align: right; width: 145px; }
.username { font-weight: 400; white-space: nowrap; text-decoration: none; position: relative; }
.username:hover { text-decoration: underline; }
.username.locked { text-decoration: line-through; text-decoration-color: #ff2a2a; }
.shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-repeat: repeat;
  background-position: center;
  background-size: auto;
  mix-blend-mode: screen;
  animation: shine-flicker 1.6s steps(2, end) infinite;
  z-index: 1;
}
@keyframes shine-flicker { 0%, 100% { opacity: 0.7; } 50% { opacity: 0.42; } }
.rank-tag { font-weight: 400; }
.profile-name { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 18px; }
.badge { width: 17px; height: 17px; border: 0; padding: 0; background: transparent; display: inline-grid; place-items: center; position: relative; }
.badge img { width: 15px; height: 15px; object-fit: contain; display: block; }
.badge:focus::after, .badge:hover::after { content: attr(title); position: absolute; left: 50%; top: 22px; transform: translateX(-50%); min-width: 210px; background: #111; color: #fff; border: 1px solid #444; padding: 8px; border-radius: 4px; z-index: 2; font-size: 12px; text-align: center; }

.form { width: min(820px, 100%); margin: 0 auto; display: grid; gap: 13px; }
.form h1 { font-weight: 400; }
.form label { display: grid; gap: 6px; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.checks label { display: flex; align-items: center; gap: 8px; }
.captcha { min-height: 66px; display: flex; align-items: center; }

.settings-panel { border: 1px solid #1d1d1d; background: #050505; padding: 0 12px 12px; }
.settings-grid { display: grid; grid-template-columns: minmax(220px, 320px) minmax(260px, 1fr); gap: 300px; align-items: start; }
.settings-error { grid-column: 1 / -1; }
.settings-col { display: grid; gap: 10px; align-content: start; padding-top: 8px; }
.settings-col label, .settings-col > div { display: grid; gap: 5px; font-size: 12px; }
.settings-col input, .settings-col textarea, .settings-col select { width: 196px; background: #3a3a3a; border-color: #404040; color: #fff; padding: 5px 7px; }
.settings-col textarea { min-height: 66px; }
.settings-col button { width: 196px; padding: 5px 8px; font-size: 12px; font-weight: 700; background: #252525; }
.settings-preview { color: #fff; font-size: 12px; }
.settings-thumb { width: 48px; height: 48px; object-fit: cover; border: 1px solid #333; border-radius: 4px; }
.settings-thumb.wide { width: 260px; height: 90px; }
.badge-toggle { display: flex !important; grid-template-columns: none; flex-direction: row; align-items: center; justify-content: space-between; width: 196px; }
.badge-toggle img { width: 14px; height: 14px; object-fit: contain; }
.check-stack { margin-top: 28px; }
.check-stack label { display: flex !important; flex-direction: row; align-items: center; gap: 7px; }
.check-stack input, .badge-toggle input { width: auto; padding: 0; }

form.paste-layout .paste-side { display: flex; flex-direction: column; gap: 14px; padding: 14px; }
form.paste-layout .paste-side > .side-close { align-self: flex-end; float: none; position: sticky; top: 0; }
form.paste-layout .upload-head { margin-bottom: 0; }
form.paste-layout .upload-head h2 { margin: 0; font-size: 20px; }
form.paste-layout .paste-side > label { display: grid; gap: 6px; font-size: 12px; }
form.paste-layout .paste-side > label > input { background: #3a3a3a; border: 1px solid #404040; color: #fff; padding: 6px 8px; width: 100%; box-sizing: border-box; }
form.paste-layout .paste-side .check-stack { margin-top: 0; }
form.paste-layout .paste-side .check-stack > span { display: block; font-size: 12px; margin-bottom: 7px; }
form.paste-layout .paste-side .wide { margin: 4px 0 0; }
form.paste-layout .paste-side .error { margin: 0; }

.paste-layout { width: 100vw; margin-left: calc(50% - 50vw); position: relative; min-height: calc(100vh - var(--topbar)); padding-right: 0; transition: padding-right 0.25s ease; }
body.no-nav .paste-layout { min-height: 100vh; }
.paste-layout.side-open { padding-right: var(--drawer); }
.paste-text { margin: 0; padding: 15px; font-family: Consolas, "Courier New", monospace; font-size: 12px; font-weight: 400; line-height: 1.2; white-space: pre-wrap; word-break: normal; overflow-x: auto; tab-size: 4; -o-tab-size: 4; -moz-tab-size: 4; background: #000; color: #fff; }
.paste-textarea { display: block; width: 100%; min-height: calc(100vh - var(--topbar)); border: 0; border-radius: 0; background: #000; color: #fff; padding: 15px; font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.2; overflow: auto; resize: vertical; }
body.no-nav .paste-textarea { min-height: 100vh; }
.paste-textarea:focus { outline: none; }
.paste-textarea::placeholder { color: #555; }
.upload-head { margin-bottom: 8px; }
.upload-head h2 { margin: 0 0 6px; font-weight: 400; }
.side-toggle { position: fixed; top: 60px; right: 14px; z-index: 40; background: #202020; color: #fff; border: 1px solid #444; padding: 7px 12px; cursor: pointer; }
.paste-side { position: fixed; top: 54px; right: 0; bottom: 0; width: var(--drawer); max-width: 92vw; background: var(--side); border-left: 1px solid #191919; padding: 10px; overflow-y: auto; transform: translateX(100%); transition: transform 0.25s ease; z-index: 30; }
.paste-side.open { transform: translateX(0); }
.side-close { position: sticky; top: 0; float: right; background: transparent; border: 0; color: #aaa; font-size: 16px; cursor: pointer; z-index: 2; }
.paste-side .logo { font-size: 20px; text-align: left; margin: 0 0 14px; border-bottom: 1px solid #444; padding-bottom: 14px; color: #fff; font-family: Consolas, "Courier New", monospace; line-height: 1.05; }
.paste-side dl { display: grid; grid-template-columns: 90px 1fr; gap: 6px; margin: 0 0 14px; }
.paste-side dt { font-weight: 700; }
.paste-side dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.paste-side hr { border: 0; border-top: 1px solid #444; margin: 14px 0; }
.wide { width: 100%; display: block; text-align: center; margin: 12px 0; text-decoration: none; }
.green { background: #0d3d05; border-color: #1b6510; }
.comment-form textarea { min-height: 70px; width: 100%; }
.comment { border-top: 1px solid #252525; padding: 9px 0; }
.captcha-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: none; align-items: center; justify-content: center; z-index: 60; }
.captcha-modal.show { display: flex; }
.captcha-modal-box { background: #161616; border: 1px solid #444; padding: 22px; text-align: center; max-width: 380px; width: 92%; }
.captcha-modal-box p:first-child { font-weight: 700; margin: 0 0 14px; }
.captcha-slot { min-height: 66px; display: flex; align-items: center; justify-content: center; }

.profile-cover { height: 240px; border: 1px solid #222; background: #020202; background-size: cover; background-position: center; background-repeat: no-repeat; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; margin-top: 18px; }
.profile-head { background: var(--panel); display: grid; grid-template-columns: 110px 1fr auto; gap: 16px; align-items: center; padding: 10px; }
.avatar { width: 110px; aspect-ratio: 1; display: grid; place-items: center; background: #252525; font-size: 42px; color: #aaa; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.side { background: var(--panel); padding: 10px; }
.pill { border-radius: 13px; justify-self: center; }

.rank-grid, .admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.rank { border: 1px solid #333; padding: 12px; }
.rank h2 { margin: 0 0 10px; }
.inline-form { display: flex; gap: 4px; align-items: center; }
.red-btn { background: #5c1212; border-color: #8a2020; color: #ff6161; }
.rm-form { display: inline; }
.rm-text { background: none; border: 0; color: var(--muted); padding: 0; font-size: 12px; cursor: pointer; }
.rm-text:hover { color: #fff; text-decoration: underline; }

.users-table td:nth-child(1), .users-table th:nth-child(1) { text-align: left; width: auto; }
.users-table td:nth-child(2), .users-table th:nth-child(2) { text-align: center; width: 110px; }
.users-table td:nth-child(3), .users-table th:nth-child(3) { text-align: center; width: 110px; }
.users-table td:nth-child(4), .users-table th:nth-child(4) { text-align: center; width: 130px; }

.info-btn { min-width: 40px; }
.red-text { color: #ff6161; font-weight: 700; }
.ok-text { color: #4caf50; font-weight: 700; }
.info-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: none; z-index: 60; }
.info-modal.show { display: block; }
.info-modal-box { position: relative; max-width: 860px; width: 92%; max-height: 90vh; overflow-y: auto; margin: 6vh auto; background: #181818; border: 1px solid #3a3a3a; padding: 20px 24px; }
.info-modal-close { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: #aaa; font-size: 18px; cursor: pointer; }
.info-modal-close:hover { color: #fff; }
.info-modal-body .profile-head { margin-bottom: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.info-field { border: 1px solid #2c2c2c; background: #151515; padding: 8px 10px; }
.info-field > span { display: block; font-size: 11px; letter-spacing: 1px; color: #777; margin-bottom: 3px; }
.info-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.info-stats > div { border-left: 2px solid #3a3a3a; padding: 2px 12px; }
.info-stats b { display: block; font-size: 20px; }
.info-stats span { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.info-title { margin: 16px 0 8px; }
.conn-table td, .conn-table th { text-align: left; padding: 7px 9px; vertical-align: top; }
.conn-table code { font-size: 12px; color: #7bc6ec; }
.conn-table td:last-child { white-space: nowrap; }
.admin-reset { margin: 14px 0; border: 1px solid #2c2c2c; background: #151515; padding: 10px 12px; }
.admin-reset > span { display: block; font-size: 11px; letter-spacing: 1px; color: #777; margin-bottom: 6px; }
.admin-reset > div { display: flex; gap: 8px; }
.admin-reset input[type="password"] { flex: 1; }

@media (max-width: 800px) {
  .nav { width: 100%; overflow-x: auto; padding: 0 12px; }
  .paste-layout, .profile-grid { grid-template-columns: 1fr; }
  .paste-layout.side-open { padding-right: 0; }
  .paste-side { border-left: 0; border-top: 1px solid #191919; }
  .checks { grid-template-columns: 1fr; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 6px; }
  .profile-head { grid-template-columns: 80px 1fr; }
  .avatar { width: 80px; }
  .settings-grid { grid-template-columns: 1fr; gap: 20px; }
  .settings-col input, .settings-col textarea, .settings-col select, .settings-col button, .badge-toggle { width: 100%; }
}
