:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --muted: #888;
  --accent: #5b8dee;
  --danger: #e05555;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
}

main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

footer {
  text-align: center;
  padding: 1.2rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

/* ── Home layout ── */
.home-wrap {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

.creator h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -1.5px; margin-bottom: .3rem; }
.tagline { color: var(--muted); margin-bottom: 1.2rem; }

/* ── Key row ── */
.key-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem .8rem;
  margin-bottom: 1rem;
}
.prefix { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.key-row input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .95rem;
  font-family: monospace;
  font-weight: 600;
}
#keyStatus { font-size: .8rem; white-space: nowrap; }
#keyStatus.ok { color: #5bc87a; }
#keyStatus.taken { color: var(--danger); }

/* ── Content area ── */
.content-area { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1rem; }

textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9rem;
  padding: .8rem;
  resize: vertical;
  font-family: monospace;
  outline: none;
  width: 100%;
}
textarea:focus { border-color: var(--accent); }
textarea:disabled { opacity: .4; }

.or-divider { text-align: center; color: var(--muted); font-size: .85rem; }

/* ── Drop zone ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.8rem 1rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: rgba(91,141,238,.05); }
.drop-zone.small { padding: 1rem; }
.drop-zone.has-file { border-color: #5bc87a; }
.link { color: var(--accent); cursor: pointer; }

.file-preview {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .9rem;
  font-size: .88rem;
}

/* ── Buttons ── */
.btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: .6rem 1.4rem;
  font-size: .95rem;
  cursor: pointer;
  font-weight: 600;
  transition: opacity .2s;
  display: inline-block;
  text-decoration: none;
}
.btn:hover:not(:disabled) { opacity: .85; text-decoration: none; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-sm {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .3rem .7rem;
  font-size: .82rem;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .2s;
  white-space: nowrap;
}
.btn-sm:hover { border-color: var(--accent); text-decoration: none; }
.btn-sm.danger { color: var(--danger); border-color: transparent; }
.btn-sm.danger:hover { border-color: var(--danger); }

/* ── Dashboard ── */
.dashboard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.dashboard h3 { font-size: .9rem; color: var(--muted); margin-bottom: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.drop-list { display: flex; flex-direction: column; gap: .4rem; }
.drop-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .2rem;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.drop-item:last-child { border-bottom: none; }
.drop-key { font-family: monospace; font-weight: 600; flex: 1; }
.drop-label { font-size: .78rem; color: var(--muted); max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-icon { font-size: .9rem; }

/* ── Drop page ── */
.drop-page { max-width: 680px; }

.drop-header { margin-bottom: 1.5rem; }
.share-url {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .9rem;
  font-family: monospace;
  font-size: .88rem;
  color: var(--accent);
  margin-top: .5rem;
}
.share-url span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-hint { color: var(--muted); font-size: .78rem; margin-top: .35rem; }
.lock-hint { font-size: .78rem; margin-top: .35rem; color: #f0a500; }
.lock-hint.unlocked { color: var(--muted); }

.clip-existing {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.clip-existing pre { white-space: pre-wrap; word-break: break-all; font-size: .88rem; font-family: monospace; }
.clip-actions { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; }
.clip-form { margin-top: 1rem; display: flex; flex-direction: column; gap: .6rem; }

.file-card.big {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}
.file-icon { font-size: 2rem; }
.fname { font-weight: 600; }
.fsize { font-size: .82rem; }

/* ── Misc ── */
.muted { color: var(--muted); }
.hidden { display: none !important; }
.error { color: var(--danger); font-size: .85rem; }
.empty { font-size: .85rem; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: .5rem 1.2rem;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  z-index: 999;
}
.toast.show { opacity: 1; }

@media (max-width: 700px) {
  .home-wrap { grid-template-columns: 1fr; }
  .dashboard { order: -1; }
  main { padding: 1.5rem 1rem; }
  .creator h1 { font-size: 1.8rem; }
}

/* ── Result box ── */
.result-box {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: var(--surface);
  border: 1px solid #5bc87a;
  border-radius: var(--radius);
  padding: .6rem .9rem;
  margin-top: .8rem;
  font-family: monospace;
  font-size: .9rem;
}
.result-box a { color: var(--accent); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Dashboard actions ── */
.dashboard-actions {
  display: flex;
  gap: .4rem;
  margin-top: .8rem;
  flex-wrap: wrap;
}

/* ── Help page ── */
.help-page { max-width: 640px; }
.help-page h1 { font-size: 2rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 1.5rem; }
.help-page section { margin-bottom: 1.8rem; }
.help-page h2 { font-size: 1rem; font-weight: 700; color: var(--accent); margin-bottom: .4rem; text-transform: uppercase; letter-spacing: .05em; font-size: .82rem; }
.help-page p { color: var(--text); line-height: 1.7; margin-bottom: .5rem; }
.help-page code { background: var(--surface); padding: .1em .4em; border-radius: 4px; font-family: monospace; font-size: .88em; }
.help-page pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; margin: .5rem 0; }
.help-page pre code { background: none; padding: 0; }

/* ── Header nav ── */
header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 2rem; border-bottom: 1px solid var(--border); }
nav a { color: var(--muted); font-size: .88rem; }
nav a:hover { color: var(--text); text-decoration: none; }