:root {
  --bg: #0f1115;
  --panel: #171a21;
  --line: #262b36;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --danger: #f87171;
  --ok: #34d399;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.hidden { display: none !important; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.brand span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; color: transparent; }
.userbar { display: flex; gap: 14px; align-items: center; }
.balance { color: var(--muted); }
.balance strong { color: var(--ok); }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
.auth { display: flex; justify-content: center; padding-top: 60px; }
.auth-card { width: 380px; }

.nav { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.nav button, .tabs button {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  padding: 9px 16px; border-radius: 10px; cursor: pointer; font-size: 14px;
}
.nav button.active, .tabs button.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 20px; }
.card h2 { margin: 0 0 14px; font-size: 18px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) { .row, .row.three { grid-template-columns: 1fr; } }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
input, select, textarea {
  width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #0c0e13; color: var(--text); font: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }

button.primary {
  background: linear-gradient(90deg, var(--accent), #5b8cff); color: #fff; border: 0;
  padding: 12px 18px; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 15px;
}
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.primary.full { width: 100%; }
button.ghost, .file-btn {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; display: inline-block;
}
button.danger { background: rgba(248,113,113,.15); border: 1px solid rgba(248,113,113,.4); color: var(--danger); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }

.uploader { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.uploader-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb-x { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.7); color: #fff; border: 0; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 18px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { background: #0c0e13; border: 1px solid var(--line); color: var(--text); padding: 7px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.hint { font-size: 12px; color: var(--muted); margin: -4px 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); font-size: 14px; min-height: 18px; }
.ok { color: var(--ok); font-size: 14px; }
.pos { color: var(--ok); }
.neg { color: var(--danger); }

.batch { min-height: 300px; }
.batch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .batch-grid { grid-template-columns: 1fr; } }
.batch-item { background: #0c0e13; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.batch-item .media { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.batch-item img, .batch-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.batch-item .meta { padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.failed-box { color: var(--danger); }
.spinner { width: 36px; height: 36px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.spinner.small { width: 28px; height: 28px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.lib-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.check-all { margin: 0; display: flex; gap: 6px; align-items: center; color: var(--text); }
.check-all input { width: auto; margin: 0; }
.toolbar { display: none; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; margin: 14px 0; background: #0c0e13; border-radius: 12px; border: 1px solid var(--line); }
.toolbar.active { display: flex; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.lib-item { position: relative; background: #0c0e13; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; margin: 0; }
.lib-item.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124,92,255,.4); }
.lib-item .pick { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; z-index: 2; margin: 0; }
.lib-media { aspect-ratio: 1 / 1; background: #07080b; display: flex; align-items: center; justify-content: center; }
.lib-media img, .lib-media video { width: 100%; height: 100%; object-fit: cover; }
.lib-empty { color: var(--muted); font-size: 13px; }
.lib-meta { padding: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text); }

.qr { background: #fff; padding: 10px; border-radius: 12px; max-width: 280px; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 22px; letter-spacing: 2px; color: var(--accent-2); margin: 8px 0; }
.result { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--line); align-self: flex-start; }
.badge.done, .badge.paid { background: rgba(52,211,153,.15); color: var(--ok); }
.badge.failed { background: rgba(248,113,113,.15); color: var(--danger); }
.badge.processing, .badge.pending { background: rgba(124,92,255,.15); color: #b9a8ff; }

.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 32px 24px 24px; background: #0b0d11; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; text-align: center; }
.contact-card img { width: 220px; max-width: 100%; border-radius: 12px; background: #fff; }
.contact-card h3 { margin: 14px 0 6px; font-size: 16px; }
.contact-card p { margin: 0; font-size: 13px; }
.qr-missing { width: 220px; max-width: 100%; height: 220px; margin: 0 auto; border: 1px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.copyright { text-align: center; margin-top: 20px; font-size: 12px; }
pre { white-space: pre-wrap; word-break: break-all; background: #0c0e13; padding: 8px; border-radius: 8px; margin: 0; font-family: ui-monospace, Consolas, monospace; }
.page-view { max-width: 900px; margin: 0 auto; padding: 0 24px 24px; }
.page-view h2 { margin-top: 0; }
.page-view p, .page-view div { white-space: pre-wrap; line-height: 1.6; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 24px; }
.footer-links button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; }
.footer-links button:hover { color: var(--text); }
a.primary { display: inline-block; padding: 12px 18px; border-radius: 10px; background: linear-gradient(90deg, var(--accent), #5b8cff); color: #fff; text-decoration: none; font-weight: 600; margin: 8px 0; }


