@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0d0f12;
  --panel: #15181d;
  --panel-2: #1b1f26;
  --line: #262b34;
  --text: #e6e8eb;
  --muted: #8b93a1;
  --accent: #b6f24a;
  --accent-ink: #0d0f12;
  --danger: #ff5c6c;
  --warn: #ffb547;
  --link: #9ecbff;
  --radius: 10px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(13,15,18,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 12px 16px; }
.logo { font-family: var(--mono); font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: -0.5px; white-space: nowrap; }
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); padding: 7px 12px; border-radius: 8px; font-weight: 500; font-size: 14px; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav a.cta { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.nav a.cta:hover { filter: brightness(1.08); }
.nav a.staff-link { color: var(--warn); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 16px; }
@media (max-width: 720px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--panel); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 16px 14px; }
  .nav.open { display: flex; }
}

/* layout */
main { max-width: 1100px; margin: 0 auto; padding: 28px 16px 80px; }
h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.5px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.banner { background: linear-gradient(90deg, rgba(182,242,74,.14), rgba(182,242,74,.04)); border: 1px solid rgba(182,242,74,.35); color: var(--text); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 20px; }
.banner b { color: var(--accent); }

/* forms */
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { font-family: var(--mono); font-size: 13.5px; min-height: 340px; resize: vertical; tab-size: 2; }
.field { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.prefix-input { display: flex; align-items: stretch; }
.prefix-input span { background: var(--panel-2); border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; padding: 10px 10px; color: var(--muted); font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.prefix-input input { border-radius: 0 8px 8px 0; font-family: var(--mono); }

.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { background: none; border: 0; color: var(--muted); padding: 7px 14px; border-radius: 7px; font: inherit; font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #3a414d; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 36px 16px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s; }
.dropzone.drag, .dropzone:hover { border-color: var(--accent); color: var(--text); }
.dropzone strong { color: var(--text); }

/* paste list */
.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--text); }
.item:first-child { border-top: 0; }
.item:hover { background: var(--panel-2); text-decoration: none; }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.item .when { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; grid-row: span 2; align-self: center; }
.nick { color: var(--accent); font-weight: 500; }
.badge { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.badge.pin { border-color: rgba(182,242,74,.5); color: var(--accent); }
.badge.private { border-color: rgba(255,181,71,.5); color: var(--warn); }
.badge.public { border-color: rgba(158,203,255,.4); color: var(--link); }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }

/* viewer */
.paste-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.paste-head h1 { word-break: break-word; }
.paste-head .meta { color: var(--muted); font-size: 14px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.code-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0a0c0f; }
.code-wrap .bar { display: flex; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-family: var(--mono); background: var(--panel); }
pre.code { margin: 0; overflow: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; display: flex; }
pre.code .gutter { user-select: none; text-align: right; color: #4a5260; padding: 14px 12px 14px 14px; border-right: 1px solid var(--line); min-width: 48px; }
pre.code code { padding: 14px 16px; display: block; white-space: pre; flex: 1; background: transparent !important; }
pre.code.wrap code { white-space: pre-wrap; word-break: break-word; }
.markdown { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; line-height: 1.7; overflow-wrap: anywhere; }
.markdown img { max-width: 100%; }
.markdown pre { background: #0a0c0f; padding: 12px; border-radius: 8px; overflow: auto; }
.markdown code { font-family: var(--mono); font-size: .9em; }
.markdown table { border-collapse: collapse; }
.markdown td, .markdown th { border: 1px solid var(--line); padding: 6px 10px; }
.file-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.file-icon { width: 56px; height: 56px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--mono); font-weight: 800; color: var(--accent); font-size: 13px; }
.preview { margin-top: 16px; }
.preview img, .preview video { max-width: 100%; max-height: 70vh; border-radius: 8px; border: 1px solid var(--line); display: block; }
.preview iframe { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.desc { white-space: pre-wrap; margin-top: 16px; color: var(--text); }

/* tables (account / staff) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
table.t tr:first-child td { border-top: 0; }
table.t td.actions { white-space: nowrap; text-align: right; }
table.t td.actions .btn { margin-left: 4px; }
.mono { font-family: var(--mono); font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .n { font-size: 26px; font-weight: 700; font-family: var(--mono); }
.stat .l { color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

.auth-box { max-width: 420px; margin: 40px auto; }

/* toast */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 10px 16px; border-radius: 10px; opacity: 0; transition: all .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { border-color: var(--danger); color: #ffd0d5; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 40px; }

/* home grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid .empty { grid-column: 1 / -1; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tile { aspect-ratio: 5 / 3; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: #181c22; border: 1px solid #343b47; box-shadow: 0 2px 10px rgba(0,0,0,.35); border-radius: var(--radius); color: var(--text); overflow: hidden; min-width: 0; }
.tile:hover { border-color: var(--accent); text-decoration: none; background: var(--panel-2); }
.tile-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tile-title { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tile .snip { flex: 1; margin: 0; overflow: hidden; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: var(--muted); white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.tile .thumb { flex: 1; border-radius: 8px; background: var(--bg) center / cover no-repeat; border: 1px solid var(--line); }
.tile .fileprev { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 8px; text-align: center; overflow: hidden; word-break: break-all; }
.tile .fileprev span { font-family: var(--mono); font-weight: 800; color: var(--accent); text-transform: uppercase; font-size: 18px; }
.tile-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; min-width: 0; }
.tile-meta .nick { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
