:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --panel: #12161f;
  --border: #232a38;
  --text: #e6e9ef;
  --muted: #8b93a5;
  --accent: #38bdf8;
  --danger: #f87171;
}

* { 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;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 700; letter-spacing: 0.5px; }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px;
  display: grid;
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 15px; margin: 0 0 14px; }

form { display: grid; gap: 12px; }

label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }

input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

input:focus { outline: 1px solid var(--accent); }

button {
  background: var(--accent);
  color: #04121c;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.row { display: flex; align-items: center; gap: 12px; }

.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 12px; }

progress { width: 100%; }

.projects { display: grid; gap: 14px; }

.project { border: 1px solid var(--border); border-radius: 10px; padding: 14px; }

.project-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

.project-head strong { flex: 1; }

.project ul { list-style: none; margin: 0; padding: 0; }

.tree-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.project li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.project li:first-child { border-top: 0; }

.file-name {
  overflow-wrap: anywhere;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.file-actions a,
.file-actions button {
  white-space: nowrap;
}

.copy-url {
  font-size: 12px;
  padding: 7px 10px;
}

button.del, button.del-project { color: var(--danger); background: transparent; border: 0; font-size: 12px; }

@media (max-width: 640px) {
  .project li,
  .project-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-actions {
    width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
  }
}
