:root {
  --bg: #0b0c10;
  --bg-soft: #101218;
  --panel: #15171f;
  --panel-raised: #1a1d27;
  --line: #262a36;
  --line-soft: #1e222c;
  --text: #f2f3f7;
  --muted: #9aa1b1;
  --faint: #6b7285;
  --accent: #ff7a59;
  --accent-soft: rgba(255, 122, 89, 0.12);
  --accent-strong: #ff9377;
  --cool: #8b8ff9;
  --good: #4ade80;
  --bad: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(255, 122, 89, 0.09), transparent 60%),
    radial-gradient(700px 400px at 92% 0%, rgba(139, 143, 249, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

.wrap {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand span.dot {
  color: var(--accent);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), #d94f2f);
  box-shadow: 0 6px 18px rgba(255, 122, 89, 0.3);
}

.brand-mark svg {
  width: 17px;
  height: 17px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.9rem;
}

.topnav a {
  color: var(--muted);
}

.topnav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 32px 0 26px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 3.6rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(92deg, var(--accent), var(--cool));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  max-width: 52ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* Drop zone */
.drop {
  position: relative;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  overflow: hidden;
}

.drop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 220px at 50% 0%, var(--accent-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.drop:hover,
.drop.dragging {
  border-color: var(--accent);
}

.drop.dragging {
  transform: scale(1.005);
}

.drop.dragging::before,
.drop:hover::before {
  opacity: 1;
}

.drop-inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 46px 24px 40px;
  text-align: center;
  cursor: pointer;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-raised);
  color: var(--accent);
}

.drop-icon svg {
  width: 24px;
  height: 24px;
}

.drop-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 600;
}

.drop-title button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-strong);
  font-weight: 600;
  cursor: pointer;
}

.drop-title button:hover {
  text-decoration: underline;
}

.drop-hint {
  margin: 0;
  color: var(--faint);
  font-size: 0.86rem;
}

/* Options row */
.options {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  padding: 16px 2px 0;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 130px;
}

.field > label,
.field > .label {
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field select,
.field input[type="text"],
.field input[type="password"],
.field input[type="number"] {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}

.field input::placeholder {
  color: var(--faint);
}

.field select:focus,
.field input:focus {
  border-color: var(--accent);
}

.field.grow {
  flex: 1 1 180px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.options-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--faint);
  font-size: 0.8rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.06s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--panel-raised);
  border-color: #343a4a;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a0d09;
  font-weight: 600;
}

.btn.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn.ghost {
  background: transparent;
}

.btn.danger:hover {
  border-color: rgba(248, 113, 113, 0.5);
  color: var(--bad);
  background: rgba(248, 113, 113, 0.08);
}

.btn.small {
  height: 30px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Section headers */
.section {
  margin-top: 38px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
}

.section-head .linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 0.8rem;
  cursor: pointer;
}

.section-head .linkish:hover {
  color: var(--text);
}

/* Lists */
.list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--panel);
  animation: rise 0.22s ease both;
}

.item:hover {
  border-color: var(--line);
}

.item-main {
  min-width: 0;
}

.item-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-name svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--faint);
}

.item-meta {
  margin-top: 3px;
  color: var(--faint);
  font-size: 0.79rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pill.cool {
  background: rgba(139, 143, 249, 0.12);
  color: #a9adff;
}

.item-actions {
  display: flex;
  gap: 6px;
}

.item-actions .btn.icon {
  width: 32px;
  height: 32px;
  padding: 0;
}

/* Links */
.linkrow {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.linkrow input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* Queue */
.queue {
  border-top: 1px solid var(--line-soft);
  padding: 6px 10px 10px;
  background: rgba(0, 0, 0, 0.18);
}

.queue:empty {
  display: none;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 26px;
  align-items: center;
  gap: 12px;
  padding: 9px 8px;
  font-size: 0.84rem;
}

.queue-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.queue-size {
  color: var(--faint);
  font-size: 0.76rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--cool));
  transition: width 0.15s ease;
}

.queue-cancel {
  border: 0;
  background: none;
  color: var(--faint);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.queue-cancel:hover {
  color: var(--bad);
}

/* Empty state */
.empty {
  padding: 22px 16px;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--faint);
  font-size: 0.87rem;
  text-align: center;
}

/* File page */
.file-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 30px 0 18px;
}

.file-title {
  margin: 0;
  font-size: clamp(1.35rem, 3.4vw, 1.9rem);
  letter-spacing: -0.02em;
  word-break: break-word;
}

.file-sub {
  margin: 6px 0 0;
  color: var(--faint);
  font-size: 0.84rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview {
  margin: 8px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  min-height: 160px;
  display: grid;
  place-items: center;
}

.preview img,
.preview video {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  background: #000;
}

.preview audio {
  width: min(560px, calc(100% - 40px));
  margin: 32px 0;
}

.preview iframe {
  width: 100%;
  height: 70vh;
  border: 0;
  background: #fff;
}

.preview pre {
  width: 100%;
  max-height: 65vh;
  margin: 0;
  padding: 20px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #c9d1e3;
  white-space: pre-wrap;
  word-break: break-word;
  align-self: stretch;
}

.preview .no-preview {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 54px 20px;
  color: var(--faint);
  font-size: 0.88rem;
}

.preview .no-preview svg {
  width: 34px;
  height: 34px;
  opacity: 0.6;
}

.lock {
  margin-top: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  max-width: 430px;
}

.lock h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.lock p {
  margin: 0 0 14px;
  color: var(--faint);
  font-size: 0.85rem;
}

.lock form {
  display: flex;
  gap: 8px;
}

.lock input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.lock input:focus {
  outline: none;
  border-color: var(--accent);
}

.notice {
  padding: 34px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

.notice h1 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  color: var(--text);
}

.notice p {
  margin: 0;
  font-size: 0.88rem;
}

/* Footer */
.footer {
  margin: 54px 0 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  color: var(--faint);
  font-size: 0.78rem;
}

.footer a {
  color: var(--muted);
}

/* Toast */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 50;
  width: min(420px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-raised);
  color: var(--text);
  font-size: 0.86rem;
  box-shadow: var(--shadow);
  animation: rise 0.2s ease both;
}

.toast.bad {
  border-color: rgba(248, 113, 113, 0.4);
  color: #ffc9c9;
}

/* Admin */
.admin-bar {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

.admin-bar input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.admin-bar input:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-stats {
  display: flex;
  gap: 20px;
  margin: 18px 0 6px;
  color: var(--faint);
  font-size: 0.82rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.admin-table th {
  text-align: left;
  padding: 9px 10px;
  color: var(--faint);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.admin-table td.name {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table .num {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 620px) {
  .wrap {
    width: calc(100% - 28px);
  }

  .topbar {
    padding: 16px 0;
  }

  .hero {
    padding: 20px 0 22px;
  }

  .drop-inner {
    padding: 34px 18px 30px;
  }

  .options {
    gap: 12px;
  }

  .field {
    flex: 1 1 130px;
  }

  .item {
    grid-template-columns: minmax(0, 1fr);
  }

  .item-actions {
    justify-content: flex-start;
  }

  .file-actions {
    width: 100%;
  }

  .file-actions .btn {
    flex: 1;
  }

  .admin-table td:nth-child(3),
  .admin-table th:nth-child(3) {
    display: none;
  }
}

/* Inline icon sizing inside controls */
.btn svg {
  width: 15px;
  height: 15px;
}

.pill svg {
  width: 11px;
  height: 11px;
}

.file-title-wrap {
  min-width: 0;
  max-width: 100%;
}

.admin-table a {
  color: var(--text);
}

.admin-table a:hover {
  color: var(--accent-strong);
}
