* { box-sizing: border-box; }

body{
  margin: 16px;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.4;
  background: #fff;
  color: #111;
  text-transform: lowercase;
}

main{
  max-width: 1100px;
  margin: 0; /* left aligned */
}

.brand{
  font-weight: 700;
}

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

.toplinks a{
  margin-left: 10px;
}

.controls{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 12px 0;
}

input, select{
  font: inherit;
  padding: 2px 4px;
}

a{
  color: #00f;
  text-decoration: underline;
  cursor: pointer;
}

a:visited{
  color: #551a8b;
}

.layout{
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

.muted{
  color: #444;
  margin-bottom: 6px;
}

/* file browser */
#fileBrowser{
  font-size: 14px;
}

.fb-folder,
.fb-file{
  display: block;
  margin: 2px 0;
}

.fb-folder{
  font-weight: 700;
}

.fb-children{
  margin-left: 14px;
}

/* main file list */
#grid{
  display: block;
}

.file-line{
  display: block;
  margin: 2px 0;
}

.file-line small{
  color: #666;
  margin-left: 6px;
}

/* modal */
.hidden{ display: none !important; }

#modal{
  position: fixed;
  inset: 0;
}

#modalBg{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.12);
}

#modalPanel{
  position: relative;
  background: #fff;
  width: min(980px, 96vw);
  margin: 6vh 0 0 0; /* left aligned */
  padding: 10px;
}

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

#modalBody{
  max-height: 75vh;
  overflow: auto;
}

#modalBody img,
#modalBody video{
  max-width: 100%;
  height: auto;
}

@media (max-width: 900px){
  .layout{
    grid-template-columns: 1fr;
  }
}