:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #101113;
  color: #f2f2f2;
}

* { box-sizing: border-box; }

body { margin: 0; }

header {
  background: #17191c;
  border-bottom: 1px solid #303236;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 22px;
}

header strong {
  letter-spacing: 3px;
  font-size: 19px;
}

header small {
  display: block;
  margin-top: 5px;
  color: #a7abb2;
}

nav, .toolbar, .actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar { justify-content: space-between; }

main {
  max-width: 1150px;
  margin: auto;
  padding: 22px;
}

section {
  background: #191b1e;
  border: 1px solid #303236;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 20px;
}

h1, h2 { margin-top: 0; }

p, small { color: #b9bdc4; }

a { color: #f2f2f2; }

button, input, select {
  font: inherit;
  color: inherit;
  background: #24272b;
  border: 1px solid #454950;
  border-radius: 8px;
  padding: 12px;
  max-width: 100%;
}

button, select { cursor: pointer; }

button:disabled {
  opacity: .5;
  cursor: default;
}

label { display: grid; gap: 8px; }

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

progress {
  width: 100%;
  height: 12px;
  accent-color: #b9e46c;
  margin-top: 15px;
}

#search {
  width: 100%;
  margin-bottom: 16px;
}

.file-row {
  border-top: 1px solid #303236;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.file-info {
  min-width: 0;
  overflow-wrap: anywhere;
}

.file-info small {
  display: block;
  margin-top: 6px;
}

dialog {
  width: min(1050px, 94vw);
  max-height: 92vh;
  background: #141518;
  color: inherit;
  border: 1px solid #454950;
  border-radius: 12px;
  padding: 20px;
}

dialog::backdrop {
  background: rgba(0,0,0,.8);
}

#preview-content {
  margin-top: 20px;
  text-align: center;
}

#preview-content img,
#preview-content video {
  max-width: 100%;
  max-height: 72vh;
}

#preview-content audio {
  width: 100%;
}

[hidden] { display: none !important; }

@media (max-width: 600px) {
  main { padding: 12px; }
  section { padding: 15px; }
  .file-row { align-items: flex-start; }
}
